Solve ODE $$(x-1)y''-xy'+y=(x-1)^2e^x$$ if there is one particular solution for corresponding homogeneous equation: $y_1=e^x$
My attempt: using Liouville-Ostrogradski formula, I got: $$\big({y_2\over y_1}\big)'=C\exp\{-\int{-x\over x-1}dx\}\\ \big({y_2\over y_1}\big)'=C(x-1)e^{-x}\\ {y_2\over y_1}=C\big(\int xe^{-x}dx-\int e^{-x}dx\big)+C_1\\ {y_2\over y_1}=C\big(-e^{-x}(x+1)+e^{-x}\big) + C_1\\ {y_2\over y_1}=-xCe^{-x}+C_1\;\text{multiply by }y_1=e^x\\ y_2=-Cx+C_1e^x$$ And here I got stuck, because I don't have any particular solution for initial nonhomogeneous equation. Does it make sence what I've done at all? I'm really frustrated with this problem and need help
$$(x-1)y''-xy'+y=(x-1)^2e^x$$ The solution of the associated homogeneous ODE is : $$(x-1)y_h''-xy_h'+y_h=0 \quad\to\quad y_h=c_1e^x+c_2x$$ One can find a particular solution of the inhomogeneous ODE thanks to the method of variation of parameters : http://mathworld.wolfram.com/VariationofParameters.html
This consists in replacing the coefficients by unknown functions to be determined : $ y=u(x)e^x+v(x)x$
In the present case, since $e^x$ is already in the right term of the equation, one can simplify the calculus in looking for the form : $y=u(x)e^x$.
$y=e^x u \quad\to\quad y'=e^x(u+u') \quad\to\quad y''=e^x(u+2u'+u'')$
$$(x-1)e^x(u+2u'+u'')-xe^x(u+u')+e^x u=(x-1)^2e^x$$ $$(x-1)u''+(x-2)u'=(x-1)^2$$ With $v=u'\quad\to\quad (x-1)v'+(x-2)v=(x-1)^2$
This is a first order ODE easy to solve. I suppose that you can take it from here. Finally : $$y(x)=c_1e^x+c_2x+e^x\left(\frac{x^2}{2}-x \right)$$