The formula for the second solution is $u=u\_1\int \frac{dx}{u\_1^2exp(\int{pdx})}$.

Here, $p(x)=-\frac{x+1}{x}=-1-\frac{1}{x}$.

Substituting in to get $$u=(x+1)\int\frac{dx}{(x+1)^2 \cdot exp(-x-ln(x)+C)}$$

$$=(x+1)\int\frac{xdx}{(x+1)^2 \cdot e^{-x} \cdot e^C}$$
$$=E \cdot (x+1)\int\frac{xdx}{(x+1)^2 \cdot e^{-x} }$$

where $E=\frac{1}{e^C}$.

How do I solve this integral? From experience, the outside $(x+1)$ doesn't cancel with the one in the denominator.

The answer from the book is: $u=Ae^x+B(x+1)$, where $A$ and $B$ are some constants.