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

Jan 14, 2017

Because the order of the numerator is greater than the denominator some reduction must be done before expanding the partial fractions. Please see the explanation.

#### Explanation:

Given: $\frac{{x}^{4} + {x}^{3} + {x}^{2} + 1}{{x}^{2} + x - 2}$

Begin reducing by adding 0 to the numerator in the form of $- 2 {x}^{2} + 2 {x}^{2}$

$\frac{{x}^{4} + {x}^{3} - 2 {x}^{2} + 2 {x}^{2} + {x}^{2} + 1}{{x}^{2} + x - 2}$

Break into two fractions:

$\frac{{x}^{4} + {x}^{3} - 2 {x}^{2}}{{x}^{2} + x - 2} + \frac{2 {x}^{2} + {x}^{2} + 1}{{x}^{2} + x - 2}$

Factor ${x}^{2}$ from the numerator of the first term:

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

The first term becomes ${x}^{2}$ and we combine like terms in the numerator of the second fraction:

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

Add 0 to the numerator of the second term in the form of $3 x - 6 - 3 x + 6$:

${x}^{2} + \frac{3 {x}^{2} + 3 x - 6 - 3 x + 6 + 1}{{x}^{2} + x - 2}$

Break the second term into two fractions:

${x}^{2} + \frac{3 {x}^{2} + 3 x - 6}{{x}^{2} + x - 2} + \frac{- 3 x + 6 + 1}{{x}^{2} + x - 2}$

Remove a factor of 3 from the first numerator and combine like terms in the last fraction:

${x}^{2} + \frac{3 \left(\cancel{{x}^{2} + x - 2}\right)}{\cancel{{x}^{2} + x - 2}} + \frac{7 - 3 x}{{x}^{2} + x - 2}$

The second term becomes 3:

${x}^{2} + 3 + \frac{7 - 3 x}{{x}^{2} + x - 2}$

Partial Fraction Expansion of the last term:

$\frac{7 - 3 x}{{x}^{2} + x - 2} = \frac{A}{x + 2} + \frac{B}{x - 1}$

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

Make B disappear by letting x = -2

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

$A$ = -13/3

Make A disappear by Letting x = 1:

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

$B = \frac{4}{3}$

Check

$\frac{- \frac{13}{3}}{x + 2} + \frac{\frac{4}{3}}{x - 1}$

$\frac{- \frac{13}{3}}{x + 2} \frac{x - 1}{x - 1} + \frac{\frac{4}{3}}{x - 1} \frac{x + 2}{x + 2}$

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

$\frac{7 - 3 x}{\left(x + 2\right) \left(x - 1\right)}$

This checks

Returning to the main problem:

$\int \frac{{x}^{4} + {x}^{3} + {x}^{2} + 1}{{x}^{2} + x - 2} \mathrm{dx} = \int {x}^{2} \mathrm{dx} + 3 \int \mathrm{dx} - \frac{13}{3} \int \frac{1}{x + 2} \mathrm{dx} + \frac{4}{3} \int \frac{1}{x - 1} \mathrm{dx}$

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