Example using integration factor
Consider the equation $$ xy' + (1-x)y = 1. $$
First, writing it in the standard form, $$ y' + \Big(\frac1x - 1\Big) y = \frac1x. $$
Let $\mu(x)$ be the integrating factor such that $$\begin{align*} \ln\mu &= \int^x \Big(\frac1u - 1\Big)\,du \\ &= \ln x - x \\ \mu &= xe^{-x}. \end{align*}$$
So now $$\begin{align*} \frac{d}{dx}(xe^{-x} y) &= xe^{-x}\cdot\frac1x \\ xe^{-x} y &= -e^{-x} + C \\ y &= -\frac1x + \frac{C}{x}e^{x}. \end{align*}$$