I need to find the general solution to the following ODE, given that the first solution is $y_1=e^x$ : $\left(1-x\right)y''+xy'-y=2\left(x-1\right)^2e^{-x}$
I tried to solve the homogenous equation first, using $y_2\left(x\right)=u\left(x\right)y_1\left(x\right)=u\left(x\right)e^x$.
I got this solution: $u\left(x\right)=\left(C_2-C_1x\right)e^{1-x}\:\:\rightarrow \:\:y_2=u\left(x\right)y_1\left(x\right)=\left(C_2-C_1x\right)e^{-x}e^x=C_2-C_1x$
After that I tried to find the general solution:
$W=\begin{pmatrix}y_1&y_2\\ y_1'&y_2'\end{pmatrix}=\begin{pmatrix}e^x&x\\ e^x&1\end{pmatrix}=\left(1-x\right)e^x$
$v_1=-\int \frac{f\left(x\right)y_2\left(x\right)}{W},\:\:\:\:\:\:v_2=\int \frac{f\left(x\right)y_1\left(x\right)}{W}\:$
$v_1=-\int \frac{2\left(1-x\right)xe^{-x}}{\left(1-x\right)e^x}=\left(x+\frac{1}{2}\right)e^{-2x}$
$v_2=\int \frac{2\left(1-x\right)e^{-x}e^x}{\left(1-x\right)e^x}=-e^{-x}$
$y\left(x\right)=v_1y_1+v_2y_2=\left(x+\frac{1}{2}\right)e^{-2x}e^x-e^{-x}x=-\frac{e^{-x}}{2}$
However, a quick check has showed that this solution is wrong. I'd appreciate it a lot if someone could show me where I went wrong and explain how to solve this equation properly...
$$y_p\left(x\right)=v_1y_1+v_2y_2=\left(x+\frac{1}{2}\right)e^{-2x}e^x-\color{red}{2e^{-x}x}$$ $$y_p(x)=-xe^{-x}+\frac{e^{-x}}{2}$$ A factor two is missing in the integral of $v_2$. $$v_2=\int \frac{2\left(1-x\right)e^{-x}e^x}{\left(1-x\right)e^x}=2\int e^{-x}dx=-2e^{-x}$$