Solution for y'' + y = sin(x) using method of undetermined coefficients

  • Thread starter Thread starter timsea81
  • Start date Start date
Click For Summary

Homework Help Overview

The discussion centers around solving the differential equation y'' + y = sin(x) using the method of undetermined coefficients. Participants are exploring the challenges associated with finding a particular solution given that the right-hand side is a sine function, which overlaps with the homogeneous solution.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the homogeneous solution and the need to adjust the particular solution due to overlap with the complementary solution. There are questions about the introduction of an additional factor of x in the particular solution and the implications of repeated roots in the characteristic equation.

Discussion Status

There is ongoing exploration of the method of undetermined coefficients, with participants sharing their attempts and clarifying notation. Some have identified potential errors in differentiation and are revisiting their calculations. The discussion reflects a collaborative effort to understand the reasoning behind the adjustments needed for the particular solution.

Contextual Notes

Participants express uncertainty about the derivation of certain terms and the application of the method of undetermined coefficients, particularly regarding the treatment of the complementary solution and its impact on the particular solution. There is also mention of differing notation and approaches from various resources.

timsea81
Messages
89
Reaction score
1
y" + y = sin(x)

Homework Statement


Solve y" + y = sin(x) for y=y(x) using the method of undetermined coefficients


Homework Equations





The Attempt at a Solution


The homogeneous solution Yh = Asin(x) + Bcos(x)

The particular solution Yp = Csin(x).

Y''p = -Csin(x)
Y''p + Yp = -Csin(x) + Csin(x) = 0

No C exists to make Y''p + Yp = sin(x) for all x

What am I doing wrong?
 
Physics news on Phys.org


because the sin(x) gives an undetermined coefficient set {sin(x), cos(x)} and a member of this set (in this case both) satisfies the homogeneous solution Yh = Asin(x) + Bcos(x), you must multiply every member of the UC set by x. So now your UC set is {xsinx, xcosx}

Does that make sense? I tried to follow your notation pattern, mine is slightly different.
 


Thanks for the help. I thought it might be something along those lines but I still get a trivial answer:

Yp = Csin(x) + Dcos(x)
y''p = -Csin(x) - Dcos(x)

y''p + Yp = (C-C)sin(x) + (D-D)cos(x) = 0

Wait, I just read what you wrote a little more carefully and noticed the extra "x" in the set {xsin(x), xcos(x)}

a) Where does this "x" come from?
b) Does this mean I chose a particular solution of the form C(x)sin(x) + D(x)cos(x)?
 


Perhaps my biggest downfall is not really understanding what I am doing, just doing it. Aka, I'm an algorithm applier. So, I cannot tell you where the x comes from, only that you need to multiply every term in the UC set by x if one member of the UC set will satisfy the "complementary" part of the solution. Let's level on notation and terms first so we are sure to be talking about the same things here, especially with the terms being similar in multiple parts.
Your solution will be of the form y=y_c+y_p where y_c is the "complementary" part and y_p is the "particular" part. I am using the method of undetermined coefficients from section 4.6 in my book, but they are presented in 4.5 as well, where 4.5 uses a more elementary technique. I never did section 4.5, so hopefully you and I are on the "same page" lol...

For my notation, I would first say y_c=C_1\cos{x} +C_2\sin{x}
Then, the sinx in the original problem gives a UC set of {sinx, cosx}. Since I see those terms in my y_c equation, I must multiply the set by x, getting {xsinx, xcosx}.
Now, I will find y_p
y_p=Ax\sin{x} +Bx\cos{x}
and then you do Ax\sin{x} +Bx\cos{x} = \sin{x} and solve all that jazz for A and B

EDIT: Err, I mean you take the derivative two times and do all that jazz to find A and B, you know what I mean?

So, does that help clarify everything? Sorry I can't tell you why, just what and how.
 
Last edited:


timsea81 said:
Thanks for the help. I thought it might be something along those lines but I still get a trivial answer:

Yp = Csin(x) + Dcos(x)
y''p = -Csin(x) - Dcos(x)

y''p + Yp = (C-C)sin(x) + (D-D)cos(x) = 0

Wait, I just read what you wrote a little more carefully and noticed the extra "x" in the set {xsin(x), xcos(x)}

a) Where does this "x" come from?
The explanation is on the longish side. It has to do with how you deal with repeated roots of the characteristic equation.

Here is the short version. If the characteristic equation of the DE has a factor (x - r), then the associated solution set of the homogeneous equation contains erx. If the characteristic equation has a repeated factor (x - r)2, then the associated solution set of the homogeneous equation contains erx and xerx.

Similarly, if there is a repeated factor (x - r)3, the solution set contains erx, xerx, and x2erx.

This pattern continues in the same way.
timsea81 said:
b) Does this mean I chose a particular solution of the form C(x)sin(x) + D(x)cos(x)?
No, if your notation is what I think it is. I am interpreting C(x) and D(x) as functions of x. What you want is Cxsin(x) + Dxcos(x) for your particular solution.
 


ArcanaNoir said:
Perhaps my biggest downfall is not really understanding what I am doing, just doing it. Aka, I'm an algorithm applier. So, I cannot tell you where the x comes from, only that you need to multiply every term in the UC set by x if one member of the UC set will satisfy the "complementary" part of the solution. Let's level on notation and terms first so we are sure to be talking about the same things here, especially with the terms being similar in multiple parts.
Your solution will be of the form y=y_c+y_p where y_c is the "complementary" part and y_p is the "particular" part. I am using the method of undetermined coefficients from section 4.6 in my book, but they are presented in 4.5 as well, where 4.5 uses a more elementary technique. I never did section 4.5, so hopefully you and I are on the "same page" lol...

For my notation, I would first say y_c=C_1\cos{x} +C_2\sin{x}
Then, the sinx in the original problem gives a UC set of {sinx, cosx}. Since I see those terms in my y_c equation, I must multiply the set by x, getting {xsinx, xcosx}.
Now, I will find y_p
y_p=Ax\sin{x} +Bx\cos{x}
and then you do Ax\sin{x} +Bx\cos{x} = \sin{x} and solve all that jazz for A and B

EDIT: Err, I mean you take the derivative two times and do all that jazz to find A and B, you know what I mean?

So, does that help clarify everything? Sorry I can't tell you why, just what and how.

Yes, what you are saying makes sense. I don't expect a full answer to "why" in the thorough sense, but what you're saying is that because Yp happens to be the same as Yh (or Yc in your notation) in that it is some linear combination of sin(x) and cos(x), you have to multiply the x through Yp to get some new expression to work with.

Unfortunately, I'm still not getting the right answer. This approach reduces to:
Y''p + Yp = (A+B)cos(x) + (A-B)sin(x) = sin(x)
This tells me that A+B=0 and A-B=1? That can't be.
 


Mark44 said:
The explanation is on the longish side. It has to do with how you deal with repeated roots of the characteristic equation.

Here is the short version. If the characteristic equation of the DE has a factor (x - r), then the associated solution set of the homogeneous equation contains erx. If the characteristic equation has a repeated factor (x - r)2, then the associated solution set of the homogeneous equation contains erx and xerx.

Similarly, if there is a repeated factor (x - r)3, the solution set contains erx, xerx, and x2erx.

This pattern continues in the same way.

No, if your notation is what I think it is. I am interpreting C(x) and D(x) as functions of x. What you want is Cxsin(x) + Dxcos(x) for your particular solution.

If I understand you correctly, this is an explanation of the methods for finding Yh. There are 3 cases:
#1: roots m and n are real and distinct --> y=Ae^mx + Be^nx
#2: roots are real and equal m --> y=e^mx(A+Bx)
#3: roots are complex a+bi and a-bi --> y=e^ax[Acos(bx)+Bsin(bx)]

This is an example of case 3 but I'm not having trouble with the homogeneous solution (Yh or Yc). I'm having trouble with the particular solution Yp.

And yes, my notation was off in the expression "C(x)sin(x) + D(x)cos(x)" I meant a constant C or D times x, not functions of x; C(x) and D(x)
 


I got A=0 and B=-1/2
Maybe you did a derivative wrong?
What did you have for y''p?
 


ArcanaNoir said:
I got A=0 and B=-1/2
Maybe you did a derivative wrong?
What did you have for y''p?

Something wrong (see attached)
 

Attachments

  • IMAG0301.jpg
    IMAG0301.jpg
    16.8 KB · Views: 1,313
  • #10


your yp' is okay but you make a couple mistakes getting to yp''
 
  • #11


I got it now. I forgot to differentiate the 3rd and 6th term in the step from Yp' to Y''p.

Thanks for your help!
 
  • #12


glad to procrastinate from my own diffy-q :)
 
  • #13


timsea81 said:
If I understand you correctly, this is an explanation of the methods for finding Yh. There are 3 cases:
#1: roots m and n are real and distinct --> y=Ae^mx + Be^nx
#2: roots are real and equal m --> y=e^mx(A+Bx)
#3: roots are complex a+bi and a-bi --> y=e^ax[Acos(bx)+Bsin(bx)]

This is an example of case 3 but I'm not having trouble with the homogeneous solution (Yh or Yc). I'm having trouble with the particular solution Yp.
In terms of the derivative operator D, your differential equation can be written as $$(D^2+1)y = \sin x.$$ If you apply (D2+1) one more time, you get
$$(D^2+1)(D^2+1)y = (D^2+1)\sin x = 0.$$ Why would you want to do this? Because (D2+1) annihilates the forcing function sin x, leaving you with a homogeneous equation, y'''' + 2 y'' + y = 0, which you know how to solve. The characteristic equation has repeated roots, so you'll find that y has the form
$$y(x) = Ax\sin x+Bx\cos x+C\sin x + D\cos x.$$ The last two terms correspond to the homogeneous solution of the original differential equation; the first two terms, to the particular solution.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 52 ·
2
Replies
52
Views
9K
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K