Differential Equation $y' = 2y/x - 1$ Can I get help solving this DE?
$$ y' = \frac 2xy - 1$$
Doesn't look too hard but i just can't get to the correct result.
Thank you in advance

$$
y' + \left(- \frac 2 x\right) y = -1
$$
$$
My' + \left(-\frac 2 x M\right) y = -M \tag 1
$$
$$
My' + M' y = -M \tag 2
$$
$$
(My)' = -M
$$
$$
My = \int -M\,dx
$$
$$
\text{etc.}
$$
In order that $(1)$ be equal to $(2)$, you need $\displaystyle -\frac 2 x M = M'$.  Thus
$$
-\frac 2 x M = \frac {dM}{dx}
$$
$$
\frac{-2\,dx} x = \frac{dM} M
$$
$$
-2\log x + C = \log M
$$
$$
M = x^{-2} e^C
$$
You don't need all solutions to this last differential equation, but only one, so let's go with $M=x^{-2}$.
Then $(1)$ above becomes
$$
x^{-2} y' + \left( -2x^{-3} \right) M = -x^{-2}.
$$
$$
\Big( x^{-2} y \Big)' = -x^{-2}.
$$
$$
x^{-2} y = x^{-1} + C
$$
$$
y = x + Cx^2.
$$
