Originally Posted by
x3bnm By partial fraction expansion:
$\displaystyle \begin{align*}\frac{A}{x} + \frac{B}{x+1} =& \frac{x+2}{x^2+x}......\text{(1)}\\ A(x+1) + Bx =& x + 2\\ (A+B)x + A =& x + 2\end{align*}$
$\displaystyle A + B = 1......\text{(2)}$
$\displaystyle A = 2.............\text{(3)}$
$\displaystyle \therefore\,\,B = -1$
Now plugging these values of $\displaystyle A$ and $\displaystyle B$ into (1) and integrating both sides:
$\displaystyle \begin{align*}\int \frac{x+2}{x^2+x}\,\,dx =& \int \left(\frac{A}{x} + \frac{B}{x+1}\right)\,\,dx\\ =& \int \frac{2}{x}\,\,dx - \int \frac{1}{x+1}\,\,dx\\ =& 2\ln{(x)} - \ln{(x+1)} + C\end{align*}$