# Second order linear differential equation non homogenuous

I am given the differential equation: $$y''+4y=3xcos(2x)$$

The complementary solution is $$y_c = C_1cos(2x)+C_2sin(2x)$$

I am to set up a particular solution. $$y_p = (Ax+B)(Ccos(2x)+Dsin(2x)$$

Clearly there is duplication of $$cos(2x)$$ so I have to multiply everything by x

$$y_p= x(Ax+B)(Ccos(2x)+Dsin(2x))$$

foiling: $$x(Ax+B)= Ax^2+Bx$$

foiling: $$Ax^2+Bx(Ccos(2x)+Dsin(2x)) = Ax^2Ccos(2x)+Ax^2Dsin(2x)+BxCcos(2x)+BxDsin(2x)$$

for a final answer of: $$Ax^2Ccos(2x)+Ax^2Dsin(2x)+BxCcos(2x)+BxDsin(2x)$$

But the answer in the book is: $$y_p= Axcos(2x)+Bxsin(2x)+Cx^2cos(2x)+Dx^2sin(2x)$$

I am unsure of where I went wrong

• Maybe you mean $y''$ and not $y^2$ Commented Mar 24, 2020 at 20:30
• Okay yes my mistake Commented Mar 24, 2020 at 20:32
• @BlackKnightRider Why do you think your answer is different from the solution? There is no point in keeping products of arbitrary constants... Commented Mar 24, 2020 at 20:34
• Both solutions are the same. The book 's guess is simply more simple. Both guess have four constants. Commented Mar 24, 2020 at 20:34

It's the same. Call $$BC=A_{book}$$, $$BD=B_{book}$$, $$AC=C_{book}$$, and $$AD=D_{book}$$