How can I solve the equation $x^2y'' - 2xy' + 2y = x$ with Green Function? I have hard time solving the equation:

$$x^2y'' - 2xy' + 2y = x$$
$$y(1) = 2, y'(1) = -1$$ 

with Green Function, the answer is $4x - 2x^2 - x\ln x$, however I followed the steps of Green Function but I got the totally different answer, and I don't know where I went wrong. The following are my steps, could anyone help me to find out where were the mistakes and how to get the correct answer? Coz I've checked at least five times and still couldn't figure out. Thank you~
$y_c = x^m$ (homogeneous solution)
$m(m-1)-2m+2 = (m-1)(m-2) = 0$
$y_1 = x, y_2 = x^2$
$W = x^2$ (Wroskian of y1 and y2)
$G(x,t) = (tx^2-xt^2)/t^2$ (Green Function)
$y_p = \int_{1}^{x}((tx^2-xt^2)/t^2)f(t)dt$    (particular solution)
$ = \int_{1}^{x}((tx^2-xt^2)/t^2)tdt$
$ = \int_{1}^{x}(tx^2-xt^2)/t)dt$
$ = \int_{1}^{x}(x^2-xt))dt$
$ = x^2(t|_{1}^{x}) - x(t^2/2|_{1}^{x})$
$ = x^2(x-1) - x(x^2/2 - 1/2)$
$ = x^3/2 - x^2 + x/2$
So general solution is $y = y_c + y_p = c_1x + c_2x^2 + x^3/2 - x^2 + x/2$
with the IVP $y(1) = 2, y'(1) = -1$
I got $y(1) = c_1 + c_2 + (1/2) - 1 + (1/2) = 2$
and $y' = c_1 + 2c_2 + (3/2)x^2 - 2x + (1/2)$ 
$y'(1) = c_1 + 2c_2 + (3/2) - 2 + (1/2) = -1$
=> $c_1 = 5, c_2 = -3$
=> $ y = (11/2)x - 4x^2 + x^3/2$
Thank you for willing to invent time seeing this, I really appreciate that~
 A: Your mistake is mainly in the calculation formula of Green's function.
$$P_{\overset{\,}0}(x)y^{(n)}+P_{\overset{\,}1}(x)y^{(n-1)}+P_{\overset{\,}2}(x)y^{(n-2)}+\cdots+P_{\overset{\,}{n-1}}(x)y'+P_{\overset{\,}n}(x)y=Q(x)$$
$$y_{\overset{\,}c}=C_{\overset{\,}1}\phi_{\overset{\,}1}(x)+C_{\overset{\,}2}\phi_{\overset{\,}2}(x)+\cdots+C_{\overset{\,}n}\phi_{\overset{\,}n}(x)$$
$$P_{\overset{\,}0}(\xi\,)=\,***\qquad\qquad\,Q(\xi\,)=\,***$$
\begin{align*}
E(\,x,\xi\,)=\begin{vmatrix}
\phi_{\overset{\,}1}(x)&\phi_{\overset{\,}2}(x)&\phi_{\overset{\,}3}(x)&\cdots&\phi_{\overset{\,}n}(x)\\
\phi_{\overset{\,}1}(\xi\,)&\phi_{\overset{\,}2}(\xi\,)&\phi_{\overset{\,}3}(\xi\,)&\cdots&\phi_{\overset{\,}n}(\xi\,)\\
{\phi_{\overset{\,}1}}\!'(\xi\,)&{\phi_{\overset{\,}2}}\!'(\xi\,)&{\phi_{\overset{\,}3}}\!'(\xi\,)&\cdots&{\phi_{\overset{\,}n}}\!'(\xi\,)\\
\vdots&\vdots&\vdots&&\vdots\\
{\phi_{\overset{\,}1}}\!^{(n-2)}(\xi\,)&{\phi_{\overset{\,}2}}\!^{(n-2)}(\xi\,)&{\phi_{\overset{\,}3}}\!^{(n-2)}(\xi\,)&\cdots&{\phi_{\overset{\,}n}}\!^{(n-2)}(\xi\,)\\
\end{vmatrix}
\end{align*}
\begin{align*}
W(\,\xi\,)=\begin{vmatrix}
\phi_{\overset{\,}1}(\xi\,)&\phi_{\overset{\,}2}(\xi\,)&\phi_{\overset{\,}3}(\xi\,)&\cdots&\phi_{\overset{\,}n}(\xi\,)\\
{\phi_{\overset{\,}1}}\!'(\xi\,)&{\phi_{\overset{\,}2}}\!'(\xi\,)&{\phi_{\overset{\,}3}}\!'(\xi\,)&\cdots&{\phi_{\overset{\,}n}}\!'(\xi\,)\\
{\phi_{\overset{\,}1}}\!''(\xi\,)&{\phi_{\overset{\,}2}}\!''(\xi\,)&{\phi_{\overset{\,}3}}\!''(\xi\,)&\cdots&{\phi_{\overset{\,}n}}\!''(\xi\,)\\
\vdots&\vdots&\vdots&&\vdots\\
{\phi_{\overset{\,}1}}\!^{(n-1)}(\xi\,)&{\phi_{\overset{\,}2}}\!^{(n-1)}(\xi\,)&{\phi_{\overset{\,}3}}\!^{(n-1)}(\xi\,)&\cdots&{\phi_{\overset{\,}n}}\!^{(n-1)}(\xi\,)\\
\end{vmatrix}
\end{align*}
$$\operatorname{Gre}(\,x,\xi\,)=\dfrac{E(\,x,\xi\,)}{P_{\overset{\,}0}(\xi)W(\,\xi\,)}$$
$$\psi(x)=\int_{x_0}^x\operatorname{Gre}(\,x,\xi\,)Q(\xi){\mathrm{d}}\xi=\int_{x_0}^x\dfrac{Q(\xi)E(\,x,\xi\,)}{P_{\overset{\,}0}(\xi)W(\,\xi\,)}{\mathrm{d}}\xi$$
%%%%% %%%%% %%%%% %%%%% %%%%% %%%%% %%%%%
$$x^2y''-2xy'+2y=x$$
$$y_{\overset{\,}c}=C_{\overset{\,}1}\phi_{\overset{\,}1}(x)+C_{\overset{\,}2}\phi_{\overset{\,}2}(x)=C_{\overset{\,}1}x+C_{\overset{\,}2}x^2$$
$$P_{\overset{\,}0}(\xi\,)=\xi^2\qquad\qquad\,Q(\xi\,)=\xi$$
\begin{align*}
E(\,x,\xi\,)=\begin{vmatrix}
x&x^2\\
\xi&\xi^2\\
\end{vmatrix}=x\xi^2-x^2\xi
\end{align*}
\begin{align*}
W(\,\xi\,)=\begin{vmatrix}
\xi&\xi^2\\
1&2\xi\\
\end{vmatrix}=2\xi^2-\xi^2=\xi^2
\end{align*}
\begin{align*}
\boxed{\phantom{\hspace{2cm}}
\operatorname{Gre}(\,x,\xi\,)=\dfrac{E(\,x,\xi\,)}{P_{\overset{\,}0}(\xi)W(\,\xi\,)}=\dfrac{x\xi^2-x^2\xi}{\xi^4}\phantom{\hspace{2cm}}}
\end{align*}
$$\psi(x)=\int_{1}^x\dfrac{\xi\cdot(x\xi^2-x^2\xi)}{\xi^2\cdot\xi^2}{\mathrm{d}}\xi=x - x^2 + x\ln\left(x\right)$$
