<s>[INST] Solving the differential equation $x^2y''+xy'-y=x^2$ 
$$x^2y''+xy'-y=x^2$$

My attempt:
Divided by $x^2$:
$$y''+\frac{y'}{x}-\frac{y}{x^2}=1$$
Now to solve the homogenous equation using Euler's method
$$y''+\frac{y'}{x}-\frac{y}{x^2}=0$$ 
To look for solution $y=x^r$
so $y'=rx^{r-1}$
$y''=r(r-1)x^{r-2}$
So:
$$r(r-1)x^{r-2}+\frac{rx^{r-1}}{x}-\frac{x^r}{x^2}=0$$
Divided by $x^r$:
$$r(r-1)x^{-2}+\frac{rx^{-1}}{x}-\frac{1}{x^2}=0$$
Is it correct so far?

My problem:
   I don't know how to find $r_1,r_2$

 [/INST] As per ChickenP's answer,
$y_c = Ax + \dfrac{B}{x}$
Now since the D.E. is linear, also account for a particular solution, i.e.
$y_p = s \cdot x^2$ so $y'' + \dfrac{y'}{x} - \dfrac{y}{x^2} = 2s + 2s -s = 3s = 1$ giving $s = \frac{1}{3}$, so $y_p = \frac{1}{3}x^2$
Then the full solution is

$y = Ax + \dfrac{B}{x} + \frac{1}{3}x^2$

</s>