Artificial intelligent assistant

Find the general solution of $y'' − 2y' + 5y = e^x \cos(2x)$ 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.

Use undetermined coefficients

I think your supposed to let $y_p=Axe^{x}\cos \left(2x\right)+bxe^{x}\sin \left(2x\right)$

then take $y'\left(p\right)$ and $y"\left(p\right)$ plug em in for $y"\left(p\right)+2y'\left(p\right)+y\left(p\right)$ and solve for $A and B$ to find particular solution

But taking all these derivatives would be an extreme hassle.

After simplifying $y"\left(p\right)+2y'\left(p\right)+y\left(p\right)=e^x\cos \left(2x\right)$ I end up with

$4Be^x\cos 2x-4Ae^x\sin \left(2x\right)=e^x\cos \left(2x\right)$

So $4B=1$ and $A=0$ then $y_p=\frac{1}{4}xe^x\sin \left(2x\right)$

Remember product rule for three functions is $\left(fgh\right)'=f'gh+fg'h+fgh'$

Also remember to multiply an $x$ to the guess for the form of the particular solution since the normal guess of $y_p=Ae^{x}\cos \left(2x\right)+be^{x}\sin \left(2x\right)$ appears in the complementary solution.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 3febb95e0e876ccbf07b2fc05c02868e