Answer
See below
Work Step by Step
The general solution for the given differential equation is: $y(x)=c_1e^{-x}+c_2 e^{3x}+A_0x e^{-x}+B_0\cos x$
The trial solution for $y_p= A_0x e^{-x}+B_0\cos x$ can be computed as by plugging back into the given differential equation.
So, we have: $(D+1)(D-3)y_p(x)=4(e^{-x}-2\cos x)\\ (D^2-2D-3)(A_0 xe^{-x}+B_0\cos x)=4(e^{-x}-2\cos x)\\-4A_0e^{-x} -4B_0\cos x=4e^{-x}-8\cos x$
On comparing coefficients, we get: $A_0=-1$ and $B_0=2$
Therefore, the general solution for the given differential equation is: $y(x)=c_1e^{-x}+c_2 e^{3x}-xe^{-x}+2\cos x$