Answer
See below
Work Step by Step
$y''+2y'+5y=4e^{-x}\cos 2x$
The complementary function is
$y_c(x)=c_1 e^{-x}\sin 2x+c_2 e^{-x} \cos 2x$
We consider the complex differential equation
$z''+2z'+5z=4e^{(-1+2i)x}$
An appropriate complex-valued trial solution for this differential equation is:
$z_p(x)=A_0xe^{(-1+2i)x}$
where $A_0$ is a complex constant.
so that $z _p$ is a solution if and only if
$4iA_0e^{(-1+2i)x}=4e^{(-1+2i)x}\\
\rightarrow A_0=-i$
Hence, $z=-ixe^{(-1+2i)x}$
A particular solution is:
$y_p(x)=Re_{\{z_p\}}=xe^{-x}\sin 2x$
so that the general solution is
$y(x)=c_1e^{-x}\sin 2x+c_2e^{-x}\cos 2x+xe^{-x}\sin 2x$