# Is it possible to solve this second order differential equation by hand without using complex numbers

I need to find a particular solution to the following differential equation: $y''+4y=\cos(2t)-2\sin(2t)$. I solved it using complex numbers, but I haven't been able to do it without complex numbers. I used the method of undetermined coefficients, which gave me the following solution (using real numbers): $y=(\frac{1}{t^2+1})\cos(2t)+\frac{t}{t^2+1}\sin(2t)$, but I don't think this is right. Is there any way to do this without complex numbers?

## 3 Answers

The solutions to $$y''+4y=0$$ are $$y_h=C_1\cos 2t+C_2\sin 2t.$$ To find a special solution to your equation, do the ansatz $$y_p=t(A\cos 2t+B\sin 2t).$$ Insert the ansatz $y_p$ (all of it together!) into your differential equation and solve for $A$ and $B$.

Finally, your solutions to the differential equation are $$y=y_h+y_p.$$

• So I need to insert y= yh + yp into the equation, and not just yp? Feb 5 '15 at 19:36
• No, just $y_p$. I updated. The reason I wrote as I did was that I got the impression that you looked at sine and cosine separately and not together... Feb 5 '15 at 19:37
• Ok, turns out I was getting the wrong answer because I kept forgetting the 4y term. Feb 5 '15 at 19:50

You can notice that this is the equation of a driven spring, with the driving frequency matching the natural spring frequency (because the solution to the homogeneous equation $y''+4y=0$ is $y = H \cos(2t+\delta)$.

A spring driven at its natural frequency would pick up a fixed amount of amplitude in each cycle, so it is natural to try solutions of the form $$y = (At+M)\cos(2t) + (Bt+N)\sin(2t)$$ (in the end, $M$ and $N$ will be absorbed into the added solution to the homogeneuous equation). $$y' = -2(At+M)\sin(2t) +2(Bt+N)\cos(2t) + A \cos(2t) + B \sin(2t)$$ Then the equation becomes $$y'' + 4y = -4(Ax+m) \cos(2t) + 4(Bx+N)\sin(2t) -2A\sin(2t) + 2B\cos(2t) -2A\sin(2t) + 2B\cos(2t) +4(Ax+m) \cos(2t) = 4(Bx+N)\sin(2t) = -4A \sin(2t) +4B\cos(4t) = -2\sin(2t) + \cos(2t)$$ so $$A=\frac{1}{2} \\ B = \frac{1}{4}$$ and the general solution is $$y = \left( \frac{t}{2}+M \right) \cos(2t) + \left( \frac{t}{2}+N \right) \sin(2t)$$

Hint: assume $$y_p=C_1tcos(2t)+C_2tsin(2t)$$

• Multiply that ansatz by $t$. Feb 5 '15 at 19:23
• I did exactly that. Also, I found y1 for cos(2t) and y2 for -2sin(2t) separately. Then I put y = y1 + y2. Feb 5 '15 at 19:24
• @mickep thanks for your attention
– user187581
Feb 5 '15 at 19:36