Solve $y^{(4)}-2y^{(3)}+2y'-y=xe^x.$ Solve $y^{(4)}-2y^{(3)}+2y'-y=xe^x.$
The characteristic equation is $(r-1)^3(r+1)\Rightarrow y_h=(C_1+C_2x+C_3x^2)e^x+C_4e^{-x}.$
The problem is the particular equation. Why doesn't it work with the ansatz
$$y=(ax+b)e^x?$$
I get 
\begin{array}{lcl}
y        & = & e^x(ax+b) \\
y'       & = & e^x(a(x+1)+b)\\
y''      & = & e^x(a(x+2)+b)  \\
y^{(3)}  & = & e^x(a(x+3)+b)  \\
y^{(4)}  & = & e^x(a(x+4)+b)
\end{array}
Setting these in i get $$e^x[((a(x+4)+b))-2((a(x+3)+b))+2(e^x(a(x+1)+b))-(e^x(ax+b))] = e^x\cdot 0=0.$$
So this doesn't work. Is it because I already have corresponding powers of $x$
in the homogenous solution? How can i fix my ansatz?

The  particular solution is $$y*=\frac{1}{(D-1)^3(D+1)}xe^x=e^x\frac{1}{D^3(D+2)}x=e^x\frac{1}{2D^3(1+\frac{D}{2})}x=e^x\frac{1}{2D^3}(1-\frac{D}{2}+...)x$$
$$=e^x\frac{1}{2D^3}(x-\frac{1}{2})=e^x\frac{1}{2}\int{\int{\int{(x-\frac{1}{2})dx}dx}dx}=\frac{e^x}{2}(\frac{x^4}{24}-\frac{x^3}{12})=e^x(\frac{x^4}{48}-\frac{x^3}{24})   $$
