# Trouble finding solution in 2nd order ODE

I was trying to solve and get the general solution of the differential equation $$y''-2y'+2y=x e^{x}\cos{2x}+e^x \sin{2x}+xe^x \sin{x}$$ and I think that in order to get the particular solution it can be solved by the undetermined coefficients but it is very long, is there any other method or trick?

• I believe undetermined coefficients is the easiest way – John Doe Apr 28 '19 at 2:11

What I should have done first is to let $$y=z\,e^x$$ to make the equation $$y''-2y'+2y=x e^{x}\cos{(2x)}+e^x \sin{(2x)}+xe^x \sin{(x)}$$ to become $$z''+z=x \cos{(2x)}+ \sin{(2x)}+x \sin{(x)}$$ which is more pleasant and easier to work using undetermined coefficients.