Answer
$y=\dfrac{1}{x^2}(\sin x+c)$
Work Step by Step
The standard form of the given equation is:
$y'+\dfrac{2y}{x}=\dfrac{\cos x}{x^2}$ ....(1)
The integrating factor is: $e^{\int (2/x) dx}=x^2$
In order to determine the general solution, multiply equation (1) with the integrating factor and integrate both sides.
$\int [x^2y]' dx=\int \cos x dx$
or, $x^2y=\sin x+c$
Thus, the general solution is as follows:
$y=\dfrac{1}{x^2}(\sin x+c)$