Calculus · Grade 12 and undergraduate

Integration by Partial Fractions

Quick answer

A rational function whose denominator factors can be split into simpler fractions, each of which integrates to a logarithm: 1/((x − 1)(x + 2)) = (1/3)/(x − 1) − (1/3)/(x + 2). Write one term A/(x − r) for each distinct linear factor, find the constants by clearing denominators and substituting convenient values of x, then integrate term by term. Divide first if the numerator's degree is not lower than the denominator's; a repeated factor (x − r)² needs the two terms A/(x − r) and B/(x − r)².

What you'll learn

  • Decompose a rational function with distinct linear factors
  • Find the constants by substituting convenient values
  • Integrate the decomposition term by term
  • Handle top-heavy fractions and repeated factors

Adding fractions, run backward

Adding two fractions over a common denominator merges them:

1x−1−1x+1=(x+1)−(x−1)(x−1)(x+1)=2x2−1\frac{1}{x - 1} - \frac{1}{x + 1} = \frac{(x + 1) - (x - 1)}{(x - 1)(x + 1)} = \frac{2}{x^2 - 1}

Integrating the left side is immediate: two logarithms. Integrating the right side is not. Partial fractions runs the addition backward, splitting a fraction into pieces that each integrate to a logarithm.

The method

For a fraction P(x)Q(x)\tfrac{P(x)}{Q(x)} whose denominator factors into distinct linear factors:

  1. If the degree of PP is not less than the degree of QQ, divide first.
  2. Factor QQ completely.
  3. Write one term Ax−r\tfrac{A}{x - r} for each factor x−rx - r.
  4. Multiply through by QQ and find the constants.
  5. Integrate: each Ax−r\tfrac{A}{x - r} gives Aln⁡∣x−r∣A\ln\lvert x - r \rvert.

Why substituting the roots finds the constants

Take 1(x−1)(x+2)=Ax−1+Bx+2\tfrac{1}{(x - 1)(x + 2)} = \tfrac{A}{x - 1} + \tfrac{B}{x + 2}. Multiplying by (x−1)(x+2)(x - 1)(x + 2) gives

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

This is an identity: it holds for every xx, not only for one. So choose the values of xx that make terms vanish. At x=1x = 1 the BB term drops out and 1=3A1 = 3A. At x=−2x = -2 the AA term drops out and 1=−3B1 = -3B. The decomposition is an identity, so substitute the roots, and each one reveals a constant.

Worked examples

Common mistakes

Practice problems

  1. Find ∫dx(x−2)(x+3)\displaystyle\int \frac{dx}{(x - 2)(x + 3)}.

    Answer

    15ln⁡∣x−2x+3∣+C\tfrac{1}{5}\ln\left\lvert \tfrac{x - 2}{x + 3} \right\rvert + C

    Full solution

    1=A(x+3)+B(x−2)1 = A(x + 3) + B(x - 2). At x=2x = 2, A=15A = \tfrac{1}{5}; at x=−3x = -3, B=−15B = -\tfrac{1}{5}.

  2. Find ∫5x2+x−6 dx\displaystyle\int \frac{5}{x^2 + x - 6}\,dx.

    Answer

    ln⁡∣x−2x+3∣+C\ln\left\lvert \tfrac{x - 2}{x + 3} \right\rvert + C

    Full solution

    x2+x−6=(x−2)(x+3)x^2 + x - 6 = (x - 2)(x + 3), and 5=A(x+3)+B(x−2)5 = A(x + 3) + B(x - 2) gives A=1A = 1 and B=−1B = -1.

  3. Find ∫3x+1x2−1 dx\displaystyle\int \frac{3x + 1}{x^2 - 1}\,dx.

    Answer

    2ln⁡∣x−1∣+ln⁡∣x+1∣+C2\ln\lvert x - 1 \rvert + \ln\lvert x + 1 \rvert + C

    Full solution

    3x+1=A(x+1)+B(x−1)3x + 1 = A(x + 1) + B(x - 1). At x=1x = 1, 4=2A4 = 2A; at x=−1x = -1, −2=−2B-2 = -2B.

  4. Find ∫dxx2−4\displaystyle\int \frac{dx}{x^2 - 4}.

    Answer

    14ln⁡∣x−2x+2∣+C\tfrac{1}{4}\ln\left\lvert \tfrac{x - 2}{x + 2} \right\rvert + C

    Full solution

    1=A(x+2)+B(x−2)1 = A(x + 2) + B(x - 2) gives A=14A = \tfrac{1}{4} and B=−14B = -\tfrac{1}{4}.

  5. Find ∫x+1x2−3x dx\displaystyle\int \frac{x + 1}{x^2 - 3x}\,dx.

    Answer

    −13ln⁡∣x∣+43ln⁡∣x−3∣+C-\tfrac{1}{3}\ln\lvert x \rvert + \tfrac{4}{3}\ln\lvert x - 3 \rvert + C

    Full solution

    x2−3x=x(x−3)x^2 - 3x = x(x - 3), and x+1=A(x−3)+Bxx + 1 = A(x - 3) + Bx. At x=0x = 0, 1=−3A1 = -3A; at x=3x = 3, 4=3B4 = 3B.

  6. Find ∫dx2x2+x−1\displaystyle\int \frac{dx}{2x^2 + x - 1}.

    Answer

    13ln⁡∣2x−1∣−13ln⁡∣x+1∣+C\tfrac{1}{3}\ln\lvert 2x - 1 \rvert - \tfrac{1}{3}\ln\lvert x + 1 \rvert + C

    Full solution

    2x2+x−1=(2x−1)(x+1)2x^2 + x - 1 = (2x - 1)(x + 1), and 1=A(x+1)+B(2x−1)1 = A(x + 1) + B(2x - 1). At x=12x = \tfrac{1}{2}, A=23A = \tfrac{2}{3}; at x=−1x = -1, B=−13B = -\tfrac{1}{3}. Then ∫2/32x−1 dx=13ln⁡∣2x−1∣\int \tfrac{2/3}{2x - 1}\,dx = \tfrac{1}{3}\ln\lvert 2x - 1 \rvert.

  7. Evaluate ∫01dxx2+3x+2\displaystyle\int_0^1 \frac{dx}{x^2 + 3x + 2}.

    Answer

    ln⁡43≈0.288\ln\tfrac{4}{3} \approx 0.288

    Full solution

    1(x+1)(x+2)=1x+1−1x+2\tfrac{1}{(x + 1)(x + 2)} = \tfrac{1}{x + 1} - \tfrac{1}{x + 2}, so the integral is [ln⁡x+1x+2]01=ln⁡23−ln⁡12=ln⁡43\big[\ln\tfrac{x + 1}{x + 2}\big]_0^1 = \ln\tfrac{2}{3} - \ln\tfrac{1}{2} = \ln\tfrac{4}{3}.

  8. Find ∫x2+1x2−1 dx\displaystyle\int \frac{x^2 + 1}{x^2 - 1}\,dx.

    Answer

    x+ln⁡∣x−1x+1∣+Cx + \ln\left\lvert \tfrac{x - 1}{x + 1} \right\rvert + C

    Full solution

    Divide: x2+1x2−1=1+2x2−1\tfrac{x^2 + 1}{x^2 - 1} = 1 + \tfrac{2}{x^2 - 1}, and 2x2−1=1x−1−1x+1\tfrac{2}{x^2 - 1} = \tfrac{1}{x - 1} - \tfrac{1}{x + 1}.

  9. Find ∫dxx2(x+1)\displaystyle\int \frac{dx}{x^2(x + 1)}.

    Answer

    −ln⁡∣x∣−1x+ln⁡∣x+1∣+C-\ln\lvert x \rvert - \tfrac{1}{x} + \ln\lvert x + 1 \rvert + C

    Full solution

    1=Ax(x+1)+B(x+1)+Cx21 = Ax(x + 1) + B(x + 1) + Cx^2. At x=0x = 0, B=1B = 1; at x=−1x = -1, C=1C = 1; the x2x^2 terms give 0=A+C0 = A + C, so A=−1A = -1. Then ∫x−2 dx=−1x\int x^{-2}\,dx = -\tfrac{1}{x}.

  10. A student writes 1x2−9=1x2−19\tfrac{1}{x^2 - 9} = \tfrac{1}{x^2} - \tfrac{1}{9} and integrates to −1x−x9+C-\tfrac{1}{x} - \tfrac{x}{9} + C. What went wrong?

    Hint

    Test the student’s first step with x=4x = 4.

    Answer

    A fraction does not split over a difference in its denominator. The integral is 16ln⁡∣x−3x+3∣+C\tfrac{1}{6}\ln\left\lvert \tfrac{x - 3}{x + 3} \right\rvert + C.

    Full solution

    At x=4x = 4, 116−9=17\tfrac{1}{16 - 9} = \tfrac{1}{7}, but 116−19\tfrac{1}{16} - \tfrac{1}{9} is negative.

    Factor instead: x2−9=(x−3)(x+3)x^2 - 9 = (x - 3)(x + 3) and 1=A(x+3)+B(x−3)1 = A(x + 3) + B(x - 3) give A=16A = \tfrac{1}{6} and B=−16B = -\tfrac{1}{6}.

Frequently asked questions

What is partial fraction decomposition?

Rewriting a fraction of polynomials as a sum of simpler fractions, one for each factor of the denominator. It is adding fractions run backward.

How do I find the constants A and B?

Multiply both sides by the denominator. The result holds for every x, so substitute each root of the denominator: each substitution makes all but one term vanish.

What if the numerator's degree is too high?

Divide first. Partial fractions apply only to the proper fraction left after long division.

What do I do with a repeated factor like (x − 1)²?

Include a term for each power: A/(x − 1) + B/(x − 1)². The second term integrates to −B/(x − 1).

What about a factor like x² + 1 that does not factor?

Give it a term (Bx + C)/(x² + 1), which integrates to a logarithm and an arctangent after completing the square.

What to learn next