I've racked my head against this for hours. Finding the complementary solution (homogenous solution) is fairly simple and I got $y_c = e^x[ C_1\sin(2x)+ C_2\cos(2x) ].$
But I am stuck on finding the particular solution to complete the general solution.
I tried the undetermined coefficient approach but everything would keep cancelling out and I would get a 0 on one side.
Best Answer
$$y'' − 2y' + 5y = e^x \cos(2x)\implies (D^2-2D+5)y=e^x \cos(2x)\qquad \text{where}\quad D\equiv \frac{d}{dx}$$
For particular integral (P.I.),
P.I.$~=\frac{1}{D^2-2D+5}~e^x \cos(2x)$
$~~~~~~~= ~e^x~\frac{1}{(D+1)^2-2(D+1)+5}~\cos(2x)$
$~~~~~~~= ~e^x~\frac{1}{D^2+4}~\cos(2x)$
$~~~~~~~=~\frac{x}{4}~e^x~\sin(2x)$
So the general solution is $$y(x)= e^x[ C_1\sin(2x)+ C_2\cos(2x) ]~+~\frac{x}{4}~e^x~\sin(2x)\qquad \text{where}\quad C_1,~C_2~\text{are constants.}$$
Note$~ 1:$
Note$~ 2:$ For the Particular Integral (i.e., P.I.) of trigonometric functions you have to follow the following rules: