## Calculus (3rd Edition)

$y=- \cos x +\frac{1}{x}\sin x +\frac{C}{x}$
This is a linear equation and has the integrating factor as follows $$\alpha(x)= e^{\int P(x)dx}=e^{ \int \frac{1}{x} 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)\\ & =\frac{1}{x}\left( -x\cos x +\sin x +C\right)\\ & =- \cos x +\frac{1}{x}\sin x +\frac{C}{x}\\ \end{align} where we did the integration by parts.