## Calculus (3rd Edition)

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