Calculus (3rd Edition)

$$y= x^{-1}\left( \frac{1}{2} \sin(x^2)+C\right) .$$
This is a linear equation which has the integrating factor as follows $$\alpha(x)= e^{\int P(x)dx}=e^{\int x^{-1} dx}=e^{\ln x}=x$$ Now the general solution is \begin{align} y&=\alpha^{-1}(x)\left( \int\alpha(x) Q(x)dx +C\right)\\ &=x^{-1}\left( \int x\cos(x^2)dx +C\right)\\ &=x^{-1}\left( \frac{1}{2} \sin(x^2)+C\right) \end{align} The general solution is $$y= x^{-1}\left( \frac{1}{2} \sin(x^2)+C\right) .$$