# How do you integrate x^2/( (x-1)(x+2)) using partial fractions?

Jan 26, 2017

$\int {x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) \mathrm{dx} = x - \frac{4}{3} \ln \left\mid x + 2 \right\mid + \frac{1}{3} \ln \left\mid x - 1 \right\mid + C$

#### Explanation:

As the numerator has the same degree of the denominator we start by separating the rational function in a way that allows a simplification:

${x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) = \frac{{x}^{2} - 1}{\left(x - 1\right) \left(x + 2\right)} + \frac{1}{\left(x - 1\right) \left(x + 2\right)}$

${x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) = \frac{\left(x - 1\right) \left(x + 1\right)}{\left(x - 1\right) \left(x + 2\right)} + \frac{1}{\left(x - 1\right) \left(x + 2\right)}$

${x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) = \textcolor{b l u e}{\frac{x + 1}{x + 2}} + \frac{1}{\left(x - 1\right) \left(x + 2\right)}$

The first addendum can be separated again to simplify:

${x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) = \textcolor{b l u e}{\frac{x + 2 - 1}{x + 2}} + \frac{1}{\left(x - 1\right) \left(x + 2\right)}$

${x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) = \textcolor{b l u e}{1 - \frac{1}{x + 2}} + \textcolor{red}{\frac{1}{\left(x - 1\right) \left(x + 2\right)}}$

Now we write the second term (in red) as a sum of partial fractions with parametric numerators:

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

compute the sum in the second member:

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

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

As the denominators are equal, the equation is satisfied when the numerators are equal:

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

which implies:

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

$\left\{\begin{matrix}A = - B \\ 3 A = 1\end{matrix}\right.$

$\left\{\begin{matrix}A = \frac{1}{3} \\ B = - \frac{1}{3}\end{matrix}\right.$

Substituting in the expressions above:

${x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) = 1 - \frac{1}{x + 2} + \frac{1}{3} \left(\frac{1}{x - 1}\right) - \frac{1}{3} \left(\frac{1}{x + 2}\right)$

${x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) = 1 - \frac{4}{3} \left(\frac{1}{x + 2}\right) + \frac{1}{3} \left(\frac{1}{x - 1}\right)$

We are now ready to integrate:

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

$\int {x}^{2} / \left(\left(x - 1\right) \left(x + 2\right)\right) \mathrm{dx} = x - \frac{4}{3} \ln \left\mid x + 2 \right\mid + \frac{1}{3} \ln \left\mid x - 1 \right\mid + C$