Answer
$y = \frac{ln~x}{x}-\frac{1}{x}+\frac{3}{x^2}$
Work Step by Step
A first-order linear differential equation is one that can be put into the form:
$\frac{dy}{dx} + P(x)~y = Q(x)$
We can consider the given equation:
$x^2y' + 2xy = ln~x$
$y' + \frac{2}{x}y = \frac{ln~x}{x^2}$
Let $P(x) = \frac{2}{x}$
Let $Q(x) = \frac{ln~x}{x^2}$
We can find the integrating factor:
$I(x) = e^{\int \frac{2}{x} ~dx} = e^{2~ln~x} = e^{ln~x^2} = x^2$
We can multiply by the integrating factor:
$x^2~y'+2x~y = ln~x$
$\frac{d}{dx}(x^2~y) = ln~x$
We can integrate both sides of the equation:
$x^2~y = \int ln~x~dx$
$x^2~y = x~ln~x-x+C$
$y = \frac{ln~x}{x}-\frac{1}{x}+\frac{C}{x^2}$
We can use the initial condition to find $C$:
$y(1) = 2$
$\frac{ln~1}{1}-\frac{1}{1}+\frac{C}{1^2} = 2$
$0-1+C = 2$
$C = 3$
We can write the solution:
$y = \frac{ln~x}{x}-\frac{1}{x}+\frac{3}{x^2}$