Home » Blog » Evaluate the following integral (x+2) / (x2 + x)

Evaluate the following integral (x+2) / (x2 + x)

Compute the following integral.

    \[ \int \frac{x+2}{x^2+x} \, dx. \]


We have

    \begin{align*}  \int \frac{x+2}{x^2+x} \, dx &= \int \frac{x+1 + 1}{x(x+1)} \, dx \\  &= \int \frac{1}{x} \, dx + \int \frac{1}{x(x+1)} \, dx. \end{align*}

To evaluate the second integral on the right we use partial fractions. Write,

    \[ \frac{1}{x(x+1)} = \frac{A}{x} + \frac{B}{x+1}. \]

This gives us the equations

    \[ A(x+1) + Bx = 1. \]

Letting x = 0 and x = -1 we have

    \[ A = 1 \qquad \text{and} \qquad B = -1. \]

Therefore, we have

    \begin{align*}  \int \frac{x+2}{x^2+x} \, dx &= \int \frac{1}{x} \, dx + \int \frac{1}{x(x+1)} \, dx \\  &= \log |x| + \int \frac{1}{x} \, dx - \int \frac{1}{x+1} \, dx \\  &= \log |x| + \log |x| - \log |x+1| + C \\  &= 2 \log |x| - \log|x+1| + C. \end{align*}

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):