Integration by Partial Fractions

Integration by partial fractions integrates a rational function by splitting it into simpler fractions. Factor the denominator, write the fraction as a sum like A/(x − a) + B/(x − b), solve for the constants, and integrate each piece. Linear pieces give natural logs, and pieces over x² + a² can give arctangents.

Before this lesson: Partial Fraction Decomposition (Precalculus), Integrals That Give Natural Logarithms and Integrals That Give Inverse Trig Functions

Why splitting helps

A fraction like 5/((x − 1)(x + 4)) has no basic antiderivative as written. But it equals 1/(x − 1) − 1/(x + 4), and each of those integrates to a natural log in one step.

Finding the pieces is the algebra skill of partial fraction decomposition. This lesson adds the last step: integrating the pieces.

Flow diagram. The fraction 5 over (x − 1)(x + 4) splits into 1 over (x − 1) minus 1 over (x + 4). Each simple piece integrates to a natural log, giving ln|x − 1| − ln|x + 4| + C.
Factor, split into simple fractions, then integrate each piece to a log.

Partial fraction forms

Factor in the denominatorTerms in the splitIntegrates to
Distinct linear (x − a)\dfrac{A}{x - a}A\ln|x - a|
Repeated linear (x − a)²\dfrac{A}{x - a} + \dfrac{B}{(x - a)^2}A\ln|x - a| - \dfrac{B}{x - a}
Irreducible quadratic x² + k²\dfrac{Bx + D}{x^2 + k^2}\dfrac{B}{2}\ln(x^2 + k^2) + \dfrac{D}{k}\arctan\dfrac{x}{k}

Steps:

  1. If the top’s degree is at least the bottom’s, divide first (see polynomial long division).
  2. Factor the denominator completely.
  3. Write the split with one term for each factor, using the forms above.
  4. Multiply through by the denominator and solve for the constants. Plug in the roots, or match coefficients.
  5. Integrate each piece.

Integration by partial fractions examples

Example 1: Two distinct linear factors

Find \int \dfrac{5}{(x - 1)(x + 4)}\,dx.

\dfrac{5}{(x - 1)(x + 4)} = \dfrac{A}{x - 1} + \dfrac{B}{x + 4}

One term for each linear factor.

5 = A(x + 4) + B(x - 1)

Multiply both sides by (x − 1)(x + 4).

5 = A(1 + 4) + B(1 - 1) = 5A

Put in x = 1 so the B term is 0.

A = 1

Divide both sides by 5.

5 = A(-4 + 4) + B(-4 - 1) = -5B

Put in x = −4 so the A term is 0.

B = -1

Divide both sides by −5.

\int \dfrac{5}{(x - 1)(x + 4)}\,dx = \int \left(\dfrac{1}{x - 1} - \dfrac{1}{x + 4}\right)dx

Rewrite with the pieces.

= \ln|x - 1| - \ln|x + 4| + C

Integrate each piece (see integrals that give natural logarithms).

Answer: \ln|x - 1| - \ln|x + 4| + C, which can also be written \ln\left|\dfrac{x - 1}{x + 4}\right| + C.

Example 2: Factor first

Find \int \dfrac{x + 7}{x^2 - x - 6}\,dx.

x^2 - x - 6 = (x - 3)(x + 2)

Factor the denominator (see factoring trinomials).

x + 7 = A(x + 2) + B(x - 3)

Write the split and clear the denominators.

10 = A(3 + 2) = 5A

Put in x = 3.

A = 2

Divide by 5.

5 = B(-2 - 3) = -5B

Put in x = −2.

B = -1

Divide by −5.

\int \left(\dfrac{2}{x - 3} - \dfrac{1}{x + 2}\right)dx = 2\ln|x - 3| - \ln|x + 2| + C

Integrate each piece.

Answer: 2\ln|x - 3| - \ln|x + 2| + C

Example 3: A repeated factor

Find \int \dfrac{2x + 3}{(x + 1)^2}\,dx.

\dfrac{2x + 3}{(x + 1)^2} = \dfrac{A}{x + 1} + \dfrac{B}{(x + 1)^2}

A repeated factor needs a term for each power.

2x + 3 = A(x + 1) + B

Multiply by (x + 1)².

2(-1) + 3 = B

Put in x = −1.

B = 1

Simplify.

A = 2

Match the x terms: 2x = Ax.

\int \left(\dfrac{2}{x + 1} + \dfrac{1}{(x + 1)^2}\right)dx = 2\ln|x + 1| - \dfrac{1}{x + 1} + C

The second piece is (x + 1)⁻²; use the power rule.

Answer: 2\ln|x + 1| - \dfrac{1}{x + 1} + C

Example 4: An irreducible quadratic factor

Find \int \dfrac{3x^2 + 3x + 4}{x(x^2 + 4)}\,dx.

\dfrac{3x^2 + 3x + 4}{x(x^2 + 4)} = \dfrac{A}{x} + \dfrac{Bx + D}{x^2 + 4}

x² + 4 can’t be factored, so its numerator is Bx + D.

3x^2 + 3x + 4 = A(x^2 + 4) + (Bx + D)x

Multiply by x(x² + 4).

4 = 4A

Put in x = 0, so A = 1.

3x^2 + 3x + 4 = (A + B)x^2 + Dx + 4A

Expand and group by powers of x.

B = 3 - A = 2, \; D = 3

Match the x² and x coefficients.

\int \left(\dfrac{1}{x} + \dfrac{2x}{x^2 + 4} + \dfrac{3}{x^2 + 4}\right)dx

Split (2x + 3)/(x² + 4) into two fractions.

= \ln|x| + \ln(x^2 + 4) + \dfrac{3}{2}\arctan\dfrac{x}{2} + C

Log rule for the first two; arctangent rule with a = 2 for the third.

Answer: \ln|x| + \ln(x^2 + 4) + \dfrac{3}{2}\arctan\dfrac{x}{2} + C

Example 5: Water flowing into a tank

Water flows into a tank at a rate of r(t) = \dfrac{10}{(t + 1)(t + 2)} liters per minute. How much water flows in from t = 0 to t = 3?

\dfrac{10}{(t + 1)(t + 2)} = \dfrac{10}{t + 1} - \dfrac{10}{t + 2}

Split: 10 = A(t + 2) + B(t + 1) gives A = 10 (t = −1) and B = −10 (t = −2).

\int_0^3 \left(\dfrac{10}{t + 1} - \dfrac{10}{t + 2}\right)dt = \Big[10\ln(t + 1) - 10\ln(t + 2)\Big]_0^3

Integrate; both insides are positive here.

= (10\ln 4 - 10\ln 5) - (10\ln 1 - 10\ln 2)

Plug in the limits.

= 10\ln\dfrac{4 \cdot 2}{5} = 10\ln 1.6

ln 1 = 0; combine the logs (see properties of logarithms).

\approx 4.70

ln 1.6 ≈ 0.4700.

Answer: about 4.70 liters.

Common mistakes

MistakeExample of the errorFix
Skipping long divisionSplitting \dfrac{x^2 + 1}{x^2 - 1} directlyThe degrees are equal, so divide first: 1 + \dfrac{2}{x^2 - 1}.
Missing a term for a repeated factor\dfrac{2x + 3}{(x + 1)^2} = \dfrac{B}{(x + 1)^2}Include every power: \dfrac{A}{x + 1} + \dfrac{B}{(x + 1)^2}.
Using a constant over a quadratic\dfrac{D}{x^2 + 4} aloneAn irreducible quadratic needs \dfrac{Bx + D}{x^2 + 4}.
Integrating 1/(x + 1)² as a log\int \dfrac{1}{(x + 1)^2}\,dx = \ln(x + 1)^2Only power −1 gives a log: the answer is -\dfrac{1}{x + 1} + C.
Sign errors when plugging in rootsx = −4 giving 5 = 5B−4 − 1 = −5, so 5 = −5B and B = −1.

Related methods

Completing the square instead

If the quadratic doesn’t factor, such as x² + 2x + 5, complete the square and use the log and arctangent rules. Practice problem 9 works one out.

Logistic models

The logistic differential equation leads to \int \dfrac{1}{P(K - P)}\,dP, which splits as \dfrac{1}{K}\left(\dfrac{1}{P} + \dfrac{1}{K - P}\right). Practice problem 10 uses this. Logistic growth is modeled in logistic functions.

Practice problems

  1. Find \int \dfrac{1}{x(x + 1)}\,dx.
  2. Find \int \dfrac{3}{x^2 - 9}\,dx.
  3. Find \int \dfrac{x - 1}{x^2 + 5x + 6}\,dx.
  4. Find \int \dfrac{4x}{(x - 1)^2}\,dx.
  5. Find \int \dfrac{2}{x^2(x + 2)}\,dx.
  6. Find \int \dfrac{x^2 + 1}{x^2 - 1}\,dx.
  7. Find \int \dfrac{5x^2 + 4}{x(x^2 + 4)}\,dx.
  8. Evaluate \int_2^4 \dfrac{1}{x^2 - 1}\,dx.
  9. Find \int \dfrac{2x + 5}{x^2 + 2x + 5}\,dx.
  10. A population grows by the logistic model, so the time to grow from 10 to 50 animals is t = \int_{10}^{50} \dfrac{100}{P(100 - P)}\,dP years. Find t.
Show answers

1.

1 = A(x + 1) + Bx

Clear denominators.

A = 1, \; B = -1

Put in x = 0, then x = −1.

\int \left(\dfrac{1}{x} - \dfrac{1}{x + 1}\right)dx = \ln|x| - \ln|x + 1| + C

Integrate each piece.

Answer: \ln|x| - \ln|x + 1| + C

2.

3 = A(x + 3) + B(x - 3)

x² − 9 = (x − 3)(x + 3) (see factoring difference of squares).

A = \dfrac{1}{2}, \; B = -\dfrac{1}{2}

x = 3 gives 3 = 6A; x = −3 gives 3 = −6B.

\int \left(\dfrac{1/2}{x - 3} - \dfrac{1/2}{x + 3}\right)dx = \dfrac{1}{2}\ln|x - 3| - \dfrac{1}{2}\ln|x + 3| + C

Integrate each piece.

Answer: \dfrac{1}{2}\ln|x - 3| - \dfrac{1}{2}\ln|x + 3| + C

3.

x - 1 = A(x + 3) + B(x + 2)

x² + 5x + 6 = (x + 2)(x + 3).

A = -3, \; B = 4

x = −2 gives −3 = A; x = −3 gives −4 = −B.

\int \left(-\dfrac{3}{x + 2} + \dfrac{4}{x + 3}\right)dx = -3\ln|x + 2| + 4\ln|x + 3| + C

Integrate each piece.

Answer: -3\ln|x + 2| + 4\ln|x + 3| + C

4.

4x = A(x - 1) + B

Split as A/(x − 1) + B/(x − 1)².

B = 4, \; A = 4

x = 1 gives B = 4; matching x terms gives A = 4.

\int \left(\dfrac{4}{x - 1} + \dfrac{4}{(x - 1)^2}\right)dx = 4\ln|x - 1| - \dfrac{4}{x - 1} + C

Integrate each piece.

Answer: 4\ln|x - 1| - \dfrac{4}{x - 1} + C

5.

2 = Ax(x + 2) + B(x + 2) + Dx^2

Split as A/x + B/x² + D/(x + 2).

B = 1, \; D = \dfrac{1}{2}, \; A = -\dfrac{1}{2}

x = 0 gives 2 = 2B; x = −2 gives 2 = 4D; the x² terms give 0 = A + D.

\int \left(-\dfrac{1/2}{x} + \dfrac{1}{x^2} + \dfrac{1/2}{x + 2}\right)dx = -\dfrac{1}{2}\ln|x| - \dfrac{1}{x} + \dfrac{1}{2}\ln|x + 2| + C

Integrate each piece.

Answer: -\dfrac{1}{2}\ln|x| - \dfrac{1}{x} + \dfrac{1}{2}\ln|x + 2| + C

6.

\dfrac{x^2 + 1}{x^2 - 1} = 1 + \dfrac{2}{x^2 - 1}

Divide: x² + 1 = (x² − 1) + 2.

\dfrac{2}{x^2 - 1} = \dfrac{1}{x - 1} - \dfrac{1}{x + 1}

Split: 2 = A(x + 1) + B(x − 1) gives A = 1, B = −1.

\int \left(1 + \dfrac{1}{x - 1} - \dfrac{1}{x + 1}\right)dx = x + \ln|x - 1| - \ln|x + 1| + C

Integrate each piece.

Answer: x + \ln|x - 1| - \ln|x + 1| + C

7.

5x^2 + 4 = A(x^2 + 4) + (Bx + D)x

Split as A/x + (Bx + D)/(x² + 4).

A = 1, \; B = 4, \; D = 0

x = 0 gives A = 1; x² terms: 5 = A + B; x terms: 0 = D.

\int \left(\dfrac{1}{x} + \dfrac{4x}{x^2 + 4}\right)dx = \ln|x| + 2\ln(x^2 + 4) + C

The top 4x is twice the derivative of x² + 4.

Answer: \ln|x| + 2\ln(x^2 + 4) + C

8.

\dfrac{1}{x^2 - 1} = \dfrac{1}{2}\left(\dfrac{1}{x - 1} - \dfrac{1}{x + 1}\right)

Split as in problem 6.

\int_2^4 \dfrac{1}{x^2 - 1}\,dx = \dfrac{1}{2}\Big[\ln(x - 1) - \ln(x + 1)\Big]_2^4

Integrate; both insides are positive on [2, 4].

= \dfrac{1}{2}\big((\ln 3 - \ln 5) - (\ln 1 - \ln 3)\big) = \dfrac{1}{2}\ln\dfrac{9}{5}

Plug in the limits and combine the logs.

\approx 0.294

ln 1.8 ≈ 0.5878.

Answer: \dfrac{1}{2}\ln\dfrac{9}{5} \approx 0.294

9.

\dfrac{2x + 5}{x^2 + 2x + 5} = \dfrac{2x + 2}{x^2 + 2x + 5} + \dfrac{3}{(x + 1)^2 + 4}

The bottom doesn’t factor. Split off its derivative, 2x + 2, and complete the square.

\int \dfrac{2x + 2}{x^2 + 2x + 5}\,dx = \ln(x^2 + 2x + 5) + C

The top is the derivative of the bottom.

\int \dfrac{3}{(x + 1)^2 + 4}\,dx = \dfrac{3}{2}\arctan\dfrac{x + 1}{2} + C

Arctangent rule with u = x + 1 and a = 2.

Answer: \ln(x^2 + 2x + 5) + \dfrac{3}{2}\arctan\dfrac{x + 1}{2} + C

10.

\dfrac{100}{P(100 - P)} = \dfrac{1}{P} + \dfrac{1}{100 - P}

Split: 100 = A(100 − P) + BP gives A = 1 (P = 0) and B = 1 (P = 100).

\int_{10}^{50} \left(\dfrac{1}{P} + \dfrac{1}{100 - P}\right)dP = \Big[\ln P - \ln(100 - P)\Big]_{10}^{50}

The integral of 1/(100 − P) is −ln(100 − P).

= (\ln 50 - \ln 50) - (\ln 10 - \ln 90) = \ln 9

Plug in the limits; ln 90 − ln 10 = ln 9.

\approx 2.20

ln 9 ≈ 2.197.

Answer: about 2.2 years

Integration by partial fractions FAQ

When do you use partial fractions to integrate?

Use it for a rational function, a polynomial over a polynomial, whose denominator factors and whose top has a smaller degree. If the top’s degree is too big, divide first.

How do you set up partial fractions with a repeated factor?

Give each power of the factor its own term. For (x + 1)², use A/(x + 1) + B/(x + 1)².

What do you do with an irreducible quadratic factor?

Give it a numerator of the form Bx + D. After you solve, split that piece into a log part and an arctangent part.

How do you find the constants A and B?

Multiply both sides by the denominator. Then plug in each root to make terms vanish, or expand and match the coefficients of each power of x.

Summary

  • Divide first if the top’s degree is at least the bottom’s.
  • Factor the denominator and write one term per factor (every power for repeated factors).
  • Use Bx + D over an irreducible quadratic.
  • Solve for the constants by plugging in roots or matching coefficients.
  • Linear pieces give logs; repeated pieces give powers; quadratic pieces give logs and arctangents.

Previous lesson: Trigonometric Substitution

Next lesson: Hyperbolic Functions

Back to the Calculus 2 Index