Method of Undetermined Coefficients complementary solution

I couldn't find anything similar using google. But I have a problem, which is find the general solution of

$$y'' + 4y = 2\sin2x$$

And I know the answer is $C_1 \sin(2x) + C_2 cos(2x) - \frac{1}{2} x \cos(2x)$. I'm confused because I thought the complementary solution would be $C_1 e^0 + C_2 e^{-4x}$, since those are the roots of the characteristic equation. Can someone help me out with this? Thanks.

• characteristic equation is $r^2+4=0$, not $r^2+4\color{red}{r}=0$ – ganeshie8 Mar 25 '15 at 19:32
• oh oops that makes much more sense – Rohan A Mar 25 '15 at 19:34
• rest should be pretty straightforward... see if you can finish it off :) – ganeshie8 Mar 25 '15 at 19:35
• I'm actually having trouble getting the particular solution, when I guess Acos(2x) + Bsin(2x) = y_particular, I end up getting 0 = 2sin2x when I plug into the equation. – Rohan A Mar 25 '15 at 19:47
• Right! thats because $\sin 2x$ is part of complementary solution itself. So change your guess to $Y_p = x(A\cos(2x) + B\sin(2x))$ – ganeshie8 Mar 25 '15 at 19:50