<s>[INST] Find the general solution for: $\frac{dy}{dx} + \frac{y}{x}=\frac{1}{x^2}$ 

Find the general solution for: $$\frac{dy}{dx} + \frac{y}{x}=\frac{1}{x^2} $$


I don't want to solve this using an integrating factor, I wanted to try solve this with a substitution $y=vx$
With the sub of $y=vx$ it implies that $dy = xdv+vdx$ and $\frac{y}{x}= v$
Hence the differential equation is transformed into
$$ \frac{xdv + vdx}{dx} + v =\frac{1}{x^2}$$
$$ \Leftrightarrow \frac{xdv}{dx} + 2v = \frac{1}{x^2}$$
$$ \Leftrightarrow \frac{xdv}{dx} = \frac{1}{x^2} - 2v $$
$$ \Leftrightarrow \frac{dv}{dx} = \frac{1}{x^3} - \frac{2v}{x}$$
Now I am stuck  how should I continue? Is this substitution even correct for this question?
 [/INST] Try the natural substitution $y(x)=x^n f(x)$. 
Note that 
$y' = x^n f' + n x^{n-1}f$. 
Therefore, 
$x^n f' + n x^{n-1}f + x^{n-1}f = 1/x^2$
or 
$$x^n f' + (n+1)x^{n-1}f = \frac{1}{x^2}.$$
This differential equation simplifies significantly if we let $n=-1$, which we are free to do. 
Then 
$f'/x = 1/x^2$
or 
$$f' = \frac{1}{x}.$$
Integrate to find $f$. 
The solution to the original differential equation is $y = f/x$. 
</s>