reduction order method $xy''-(1+x)y'+y=x^2e^{2x}$, $y_1=1+x$ reduction order method $xy''-(1+x)y'+y=x^2e^{2x}$, being $y_1=1+x$ a solution of the homogeneous equation.
I made y=u(1+x) and got $u''(x^2+x)-u'(x^2+1)=x^2e^{2x}$
Then i did $u'=w$ and obtained $w=\frac{e^{2x}x^2+c_1e^xx}{(x+1)^2}$, however $u=\int{w }dx$ will be a strange expression that will not give to the solution $y=c_1e^x+c_2(1+x)+\frac{e^{2x}(x-1)}{2}$.
Can you help me finding my mistake?
Thanks

Your work so far looks correct, so to find $u=\displaystyle\int\frac{x^{2}e^{2x}+Cxe^x}{(x+1)^2}dx=\int\frac{(xe^x)(xe^x+C)}{(x+1)^2}dx$,
use integration by parts with $w=xe^x+C, dw=(x+1)e^x dx$ and $ dv=\frac{xe^x}{(x+1)^2}dx, \;v=\frac{e^x}{x+1}$
to get $\displaystyle u=(xe^{x}+C)\left(\frac {e^x}{x+1}\right)-\int e^{2x}dx=\frac{xe^{2x}+Ce^x}{x+1}-\frac{1}{2}e^{2x}+D$.
Then $y=(x+1)u$ should give the correct solution.
