# Help in solving $xy'' -(1+x)y' + y = x^{2}e^{x}$

Can anyone help in solving the following problem: $$x \frac{d^{2}y}{dx^{2}} -(1+x) \cdot \frac{dy}{dx} + y = x^{2}\cdot e^{x}$$

I have gone through some methods where i reduce this to the standard form of $y" + Py' + Qy = f(x)$ but didn't get how to solve this problem.

-

Let $z(x)=y'(x)-y(x)$. Then the equation becomes $x z'(x)-z(x)=x^2 e^x$, which you can solve using integrating factor. Once you know $z$, you can go on and solve for $y$.
The form of the equation suggests that the problem can be simplified by looking for a solution of the form $y=e^xu$. Why? Because the term $e^x$ will be a common factor on all the terms on the right hand side, and dividing by it will produce a new equation that we hope will be easier to solve. In this case it turns out that this new equation is $$x\,u''+(x-1)u'=x^2,$$ that in fact is easy to solve.