How do you integrate int (x+4) / (x^2-x-2) dx using partial fractions?

Jan 13, 2017

$2 \ln | x - 2 | - \ln | x + 1 | + C$

Explanation:

The trinomial ${x}^{2} - x - 2$ can be factored as $\left(x - 2\right) \left(x + 1\right)$.

$\frac{A}{x - 2} + \frac{B}{x + 1} = \frac{x + 4}{\left(x - 2\right) \left(x + 1\right)}$

$A \left(x + 1\right) + B \left(x - 2\right) = x + 4$

$A x + A + B x - 2 B = x + 4$

$\left(A + B\right) x + \left(A - 2 B\right) = x + 4$

Write a system of equations:

$\left\{\begin{matrix}A + B = 1 \\ A - 2 B = 4\end{matrix}\right.$

$B = 1 - A \to A - 2 \left(1 - A\right) = 4$

$A - 2 + 2 A = 4$

$3 A = 6$

$A = 2$

$B = 1 - A = 1 - 2 = - 1$

The partial fraction decomposition is therefore:

$\frac{2}{x - 2} - \frac{1}{x + 1}$

This can be integrated as $2 \ln | x - 2 | - \ln | x + 1 | + C$

Hopefully this helps!

Jan 13, 2017

I got the same answer in a bit of a different approach.

$2 \ln | x - 2 | - \ln | x + 1 | + C$

Sometimes if you can do something to simplify the problem, try it.

As an alternative answer, consider the following trick:

$\int \frac{x + 4}{{x}^{2} - x - 2} \mathrm{dx}$

$= \int \frac{x + 4}{\left(x - 2\right) \left(x + 1\right)} \mathrm{dx}$

$= \int \frac{\textcolor{red}{x - 2 + 6}}{\left(x - 2\right) \left(x + 1\right)} \mathrm{dx}$

$= \int \frac{1}{x + 1} \mathrm{dx} + 6 \int \frac{1}{\left(x - 2\right) \left(x + 1\right)} \mathrm{dx}$

Now partial fractions becomes a little easier. The second integrand, ignoring the $6$ for now, can be set up as

$\frac{1}{\left(x - 2\right) \left(x + 1\right)} = \frac{A}{x - 2} + \frac{B}{x + 1}$,

so that we get upon cross-multiplying,

$A \left(x + 1\right) + B \left(x - 2\right) = 1$,

$\implies \left(A + B\right) x + \left(A - 2 B\right) = 1$,

thus giving the system of equations

$A + B = 0$,
$A - 2 B = 1$.

Now we simply get

$A = - B$,
$- B - 2 B = - 3 B = 1$,

so that $B = - \frac{1}{3}$ and $A = \frac{1}{3}$ and the entire integral from the start of the problem becomes:

$\textcolor{b l u e}{\int \frac{x + 4}{\left(x - 2\right) \left(x + 1\right)} \mathrm{dx}}$

$= \int \frac{1}{x + 1} \mathrm{dx} + 6 \int \frac{1}{3} \frac{1}{x - 2} - \frac{1}{3} \frac{1}{x + 1} \mathrm{dx}$

$= \int \frac{1}{x + 1} \mathrm{dx} + 2 \int \frac{1}{x - 2} \mathrm{dx} - 2 \int \frac{1}{x + 1} \mathrm{dx}$

$= 2 \int \frac{1}{x - 2} \mathrm{dx} - \int \frac{1}{x + 1} \mathrm{dx}$

$= \textcolor{b l u e}{2 \ln | x - 2 | - \ln | x + 1 | + C}$