Second order ODE with RHS = product of two functions

Click For Summary
The discussion revolves around solving the second-order ordinary differential equation (ODE) y'' + 16y = 64x cos(4x) and finding its particular solution given initial conditions. Participants explore various forms for the particular integral, initially suggesting y_p(x) = x(C_1 cos(4x) + C_2 sin(4x))(ax + b), but encounter difficulties with too many unknowns relative to the equations generated. It is advised to use a more flexible form, such as y_p = (Cx^2 + Dx)cos(4x) + (Ex^2 + Fx)sin(4x), to avoid restrictive assumptions that lead to inconsistencies. Ultimately, the discussion emphasizes the importance of correctly identifying the form of the particular solution to successfully solve for the coefficients. The thread highlights common pitfalls in solving ODEs and the need for careful consideration of the solution's structure.
CAF123
Gold Member
Messages
2,918
Reaction score
87

Homework Statement


Find the general solution of the ODE $$ y'' + 16y = 64x \cos x.$$ If ## y(0)=1, y'(0) = 0##, what is the particular solution?

The Attempt at a Solution



I am confident I can tackle this question, I really just want to check that my particular integral form is correct. I originally said ##y_p(x) = x(C_1 \cos 4x + C_2 \sin 4x)(ax + b)##, where ##C_1, C_2, a,b ## are constants. However, when I do the first derivative and then the second derivative and then sub this into the ODE, I get two eqns with 4 unknowns. (The 4 unknowns being the constants). So then I tried combining the form so that there was only two constants. So I have either ##x[(C_1 \cos 4x + C_2 \sin 4x)(C_1 x + C_2)]## or ## x[(C_1 x +C_2)\cos 4x + (C_1x +C_2)\sin 4x]## Should I go with the second option?
Thanks
 
Physics news on Phys.org
CAF123 said:
I really just want to check that my particular integral form is correct. I originally said ##y_p(x) = x(C_1 \cos 4x + C_2 \sin 4x)(ax + b)##
Surely for the PI you will need functions like x cos(x), x sin(x).
 
Sorry, I mistyped the problem. It should be RHS = ##64x \cos 4x##
 
Remember the general solution is made up of your homogeneous solution plus a particular solution, y= y_c(x) + y_p(x).

So start by solving L[y] = 0 for your homogeneous solution y_c(x). I believe your roots will be ±4i.

Now you want to solve the non-homogeneous equation L[y] = 64xcosx for the particular solution y_p(x). You have two ways to go about this, the method or undetermined coefficients or the method of variation of parameters.

In this case since your polynomial is of relatively low degree, I would choose undetermined coefficients. So your guess at a particular solution should have the form :

y_p(x) = (Ax+b)(Csin4x + Dcos4x)

I leave the rest to you now.
 
Last edited:
I corrected my initial post. The RHS should read 64x cos4x. I took the particular integral to be x(a cos4x + bsin4x)(cx +d). In the end, I get two eqns , with the 4 unknowns. So what I then tried to do was to give a form incorporating only two constants,(see my first post), but when I tried that I got my apparent constants being functions of x.

I think the way with 4 constants is correct, but I don't see how you can get solutions for the constants. Many thanks.
 
CAF123 said:
I corrected my initial post. The RHS should read 64x cos4x. I took the particular integral to be x(a cos4x + bsin4x)(cx +d). In the end, I get two eqns , with the 4 unknowns. So what I then tried to do was to give a form incorporating only two constants,(see my first post), but when I tried that I got my apparent constants being functions of x.

I think the way with 4 constants is correct, but I don't see how you can get solutions for the constants. Many thanks.

I edited my last post to reflect your changes.

Now, what is yp' and yp''? After you find these, plug them back into L[y] = 64xcos4x and solve for your coefficients. What do you get?
 
Zondrina said:
I edited my last post to reflect your changes.

Now, what is yp' and yp''? After you find these, plug them back into L[y] = 64xcos4x and solve for your coefficients. What do you get?

I think the particular integral you wrote should be multiplied by x since ±4i are roots of the auxiliary eqn. When I sub in for yp' and yp'' into the ODE, I keep getting each constant as a function of something else. I am going to try it again now. Thanks

EDIT:The eqns I get in the end are $$ -8A(2Cx+D) + 2CB = 0,\,\,\,2CA + 8B(2Cx +D) = 64x, $$ which is 4 unknowns in 2 eqns, so I can't get a solution for each of the constants.
 
Last edited:
CAF123 said:
The eqns I get in the end are $$ -8A(2Cx+D) + 2CB = 0,\,\,\,2CA + 8B(2Cx +D) = 64x, $$ which is 4 unknowns in 2 eqns, so I can't get a solution for each of the constants.
No, there are four equations there. In order to be true for all x, the different powers of x must vanish independently. Trouble is, you then find there are no solutions.
 
I think the combinations tried have been too restrictive.
Try (quadratic)*sin 4x + (quadratic)*cos 4x.
 
  • #10
Ok, so what I have tried is the following:
1)##y_p = (Cx^2 +Dx)\cos4x + (Cx^2+Dx)\sin4x##. When I differentiate twice, sub it into ODE, I get my (apparant) constants being functions of x.
2) ##y_p = (Cx^2 +Dx)A\cos4x + (Cx^2+Dx)B\sin4x##. This, to me, seems the most plausible form of solution, and after differentiating twice and subbing in, I tried both of the following, still yielding things that I could not solve :frown:
i)collected terms in cos4x and sin4x, The two eqns I got from that I showed in my last post(@haruspex: How is that 4 eqns?)
ii) Alternatively, I collected terms in xcos4x, cos4x, x2cos4x, sin4x, xsin4x and x2sin4x. I now get 6 eqns and only 4 unknowns, yet I can't solve the following set of non-linear eqns: (In fact, after some manipulation I feel they look inconsistent)
##-16AC = 0##.
##-16AD + 16CB = 64##,
##-16BC=0##,
##2CA+8BD=64x##,
##-8DA+2CB=0##,
##-16CA-16DB=0##.
I don't know what to try next. Everything I have tried seems reasonable - I just get to a stage where I can go no further. Any advice?
 
  • #11
CAF123 said:
Ok, so what I have tried is the following:
1)##y_p = (Cx^2 +Dx)\cos4x + (Cx^2+Dx)\sin4x##.
No, you cannot assume cos 4x and sin 4x have the same coefficients. Use (Cx^2+ Dx)cos(4x)+ (Ex^2+ Fx) sin(4x) and solve for all four of C, D, E, and F.

When I differentiate twice, sub it into ODE, I get my (apparant) constants being functions of x.
2) ##y_p = (Cx^2 +Dx)A\cos4x + (Cx^2+Dx)B\sin4x##. This, to me, seems the most plausible form of solution, and after differentiating twice and subbing in, I tried both of the following, still yielding things that I could not solve :frown:
i)collected terms in cos4x and sin4x, The two eqns I got from that I showed in my last post(@haruspex: How is that 4 eqns?)
ii) Alternatively, I collected terms in xcos4x, cos4x, x2cos4x, sin4x, xsin4x and x2sin4x. I now get 6 eqns and only 4 unknowns, yet I can't solve the following set of non-linear eqns: (In fact, after some manipulation I feel they look inconsistent)
##-16AC = 0##.
##-16AD + 16CB = 64##,
##-16BC=0##,
##2CA+8BD=64x##,
##-8DA+2CB=0##,
##-16CA-16DB=0##.
I don't know what to try next. Everything I have tried seems reasonable - I just get to a stage where I can go no further. Any advice?
 
  • #12
Yes, as I said the other method seemed more plausible. I eventually get to the eqns ##DA=1, BD=8x, CB=4, CA=0##. I think these are inconsistent?
EDIT: Is ##y_p = (Cx^2 + Dx)A\cos4x + (Cx^2+Dx)B\sin4x## ok?
 
  • #13
CAF123 said:
Yes, as I said the other method seemed more plausible. I eventually get to the eqns ##DA=1, BD=8x, CB=4, CA=0##. I think these are inconsistent?
EDIT: Is ##y_p = (Cx^2 + Dx)A\cos4x + (Cx^2+Dx)B\sin4x## ok?
Still too restrictive. You are assuming the x2 and x coefficients are in the same ratio for the cos and the sin. Try the C, D, E, F form Halls suggested.
 
  • #14
haruspex said:
Still too restrictive. You are assuming the x2 and x coefficients are in the same ratio for the cos and the sin. Try the C, D, E, F form Halls suggested.
Thanks a lot. I now get solutions and eqns that were a lot easier to solve. Was the reason I couldn't solve my previous set of eqns due to the fact I had too much restriction on the particular integral?
EDIT: Wait.. Isn't mine and Halls proposed integral effectively the same? If you let, in my form, CA = E, DA = F, CB = G and DB = H, then this is essentially what Halls proposed?
 
Last edited:
  • #15
CAF123 said:
If you let, in my form, CA = E, DA = F, CB = G and DB = H, then this is essentially what Halls proposed?
No. With those relationships, E/F = C/D = G/H. In general, there's no reason why E/F = G/H.
Because you had four unknowns you assumed you had four degrees of freedom, but that is not necessarily the case. E.g. in your version A=B=2, C=D=1 is the same solution as A=B=1, C=D=2.
 

Similar threads

Replies
8
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
1K
Replies
4
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K