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?
 A: Seeing that the differential equation does not seem particularly complicated, I thought I'd do the following in lieu of substitution:
You start off by multiplying both sides by $x$:
$$x\frac{dy}{dx}+1\times y=\frac 1x$$
$$x\frac{dy}{dx}+\frac{dx}{dx}y=\frac 1x$$
$$xy'+x'y=\frac 1x$$
Using the product rule (in the different-than-usual way), gives us:
$$(xy)'=\frac 1x$$
Integrating on both sides:
$$(xy)'=\int\frac 1x dx$$
$$xy=\ln(x)+c$$
$$\boxed{\color{blue}{y=\frac {\ln(x)}x+\frac cx}}$$
where $c$ is the integration constant.
A: Hint:
$$xy'+y=\frac{1}{x}$$
let
$$z=\log x$$
then you can change the D.E respect to $z$ to get
$$\frac{dy}{dz}+y=e^{-z}$$
A: $y'+y/x=1/x^2$
Homogeneous solution.
$y'+y/x=0$, $y'/y=-1/x$, $ln(y)=-ln(x)+c$, $y=d/x$
Set $y(x)=d(x)/x, y'(x)=d'(x)/x-d(x)/x^2$
$y'+y/x = d'(x)/x-d(x)/x^2+d(x)/x^2=1/x^2$
$d'(x)=1/x$, $d(x)=ln(x)+e$, the general solution $(ln(x)+e)/x$.
A: 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$. 
A: You are quite close (even if faster ways do exist as shown in answers and comments).
Considering $$y' + \frac{y}{x}=\frac{1}{x^2}$$ let (just as you did) $$y=v x\implies y'=x v'+v$$ So the differential equation becomes $$2v+xv'=\frac{1}{x^2}$$ The solution of the homogneous equation is then $$v=\frac c {x^2}$$ Now, variation of constant $$v=\frac c {x^2}\implies v'=\frac{x c'-2 c}{x^3}$$ and the differential equation becomes $$\frac{2c}{x^2}+x\frac{x c'-2 c}{x^3}=\frac{1}{x^2}\implies c'=\frac 1x\implies c=\log(x)+C$$ which makes $$v=\frac{\log(x)+C}{x^2}\implies y=v x=\frac{\log(x)+C}{x}$$
