Finding the particular solution for a DE with resonant forcing term Given differential equation $(D^2 + 4)y = \sin(2x)$,
here the auxiliary equation is: $m^2 - 4=0$.
We get the general solution of this auxiliary equation as: $y=Y_c=e^{2ix}+e^{-2ix}.$
For the particular solution of the given inhomogeneous ode we take $Y_p$ of the form $A\sin(2x)+B\cos(2x)$.
But taking this form just cancels out with each other when substituted in the original equation. This means the terms of $Y_p$ are constant multiples of the terms of $Y_c$.
Now my problem is how do I compare and check the terms of $Y_p$ and $Y_c$. One of them is in the exponential form and the other is in trigonometry/polar form. How do I convert the terms of $Y_c$ into polar/trigonometry form?
 A: There's two possibilities. Either you meant $D^2-4$, in which case your homogeneous solution is wrong and should be normal exponentials rather than complex exponentials (and then you won't have a problem with the particular solution). In that case, see the other answer. Instead if you meant $D^2+4$, then this answer explains what to do.
In fact, your homogeneous solution can equivalently be written in terms of trigonometric functions. You got a general solution of $$Ae^{2ix}+Be^{-2ix}$$You can rewrite the constants as $A=\frac{C+iD}2$, $B=\frac{C-iD}2$. Then you get $$\frac12(Ce^{2ix}+Ce^{-2ix}+iDe^{2ix}-iDe^{-2ix})=C\cos 2x+D\sin 2x$$
This shows that any $Y_p$ you choose of this form will not work, since under the operation $D^2+4$, it just goes to $0$. This is called resonance, and it is when your forcing function on the RHS of the DE (here that is $\sin 2x$) is part of the homogeneous solution.
So what do you do? Try $Y_p=ax\sin 2x+bx\cos 2x$. (This is a common trick - if you have resonance, then multiply the homogeneous solution by $x$, and then try this as a particular solution (and determine $a,b$).
A: Using annihilator 's method
$$(D^2 - 4)y = \sin(2x)$$
$$(D^2 - 4)(D^2+4)y =0$$
$$(D - 2)[D+2)(D+2i)(D-2i)y =0$$
$$y(x)=\color{blue}{y_h}+ \color{green}{y_p}$$
$$
\begin {cases}
\color{blue}{y_h=c_1e^{2x}+c_2e^{-2x}} \\
\color{green}{y_p=c_3\cos(2x)+c_4\sin(2x)}
\end{cases}
$$
And ,
$$y(x)=\color{blue}{c_1e^{2x}+c_2e^{-2x}}+ \color{green}{c_3\cos(2x)+c_4\sin(2x)}$$
Edit
As John pointed out $c_3$ and $c_4$ are defined constants. Plug the particular solution in the equation to evaluate these constants..
