Solve the following differential equations $\displaystyle x \frac{dy}{dx}+2y=\frac{2}{x} \ln(x)$.  Differential equations is one of my toughest subjects, could someone please help with solving
 A: *

*Divide by $x$. The eq. becomes:
$$ \dfrac{dy}{dx} + 2 \dfrac{y}{x} = \dfrac{2}{x^2} \ln{x} $$

*Calculate the Integrating Factor.
$$ \text{I.F.} = e^{\int{\dfrac{2}{x} dx}} = e^{2\ln{x}} = x^2 $$

*Multiply the whole eq. by $x^2$.
$$ x^2 \dfrac{dy}{dx} + 2xy = 2 \ln{x} $$

*Let $u = x^2y$, so
$$ \dfrac{du}{dx} = x^2 \dfrac{dy}{dx} + 2xy $$

*The original eq. now becomes:
$$ \dfrac{du}{dx} = 2 \ln{x} $$

*Integrate both sides, w.r.t $x$:
$$ u = 2 \int{ \ln{x} \text{ } dx} = 2 \left( x \ln{x} - x\right)  $$

*Replace $u$ in terms of $x$ and $y$.
$$ y = \dfrac{2}{x} \cdot \left( \ln{x} - 1 \right) + \text{I} $$
where, $I$ is the integrating constant.
A: We get
$$y'+y\frac{2}{x}=\frac{2\ln x}{x^2}$$
which is a first order linear ordinary differential equation. This is of the form
$$ y' + y\cdot P(x)=Q(x)$$
whose solution is given by
$$y\cdot e^{\int P(x)dx}=\int \left[Q(x)\cdot e^{\int P(x)dx} dx\right] + C.$$
So, the solution of the given DE is
$$y\cdot e^{\int \frac{2}{x}dx}=\int \left[\frac{2\ln x}{x^2}\cdot e^{\int \frac{2} {x}dx} dx\right] + C.$$
Hope you can finish the solution on your own.:)
A: If we do not know any systematic methods, we can rewrite the equation as $x^2\frac{dy}{dx}+2xy=2\ln x$ and recognize the left-hand side as the derivative of $x^2y$. It follows that 
$$x^2y=\int 2\ln x\,dx=2x\ln x-2x+C.$$ 
