Partial Fractions

Every rational function has an antiderivative built from a rational part, logarithms and arctangents, once its denominator is factored. Step through one decomposition, then type your own answers: the page differentiates whatever you type and shows where its derivative parts from the integrand.

Each linear piece
Each quadratic piece
Its coefficient, for a simple root a
Loading interactive simulation...

Lesson

The theory — Partial Fractions

A partial-fraction decomposition writes a rational function P(x)/Q(x), with P of lower degree than Q, as a sum of simple fractions, one group for each factor of Q over the reals: A/(x − a)k for every power of a linear factor up to its multiplicity, and (Bx + C)/(x² + px + q)k for every power of a quadratic factor with no real root. When P's degree is not lower, divide first. Each fraction integrates to a rational function, a logarithm or an arctangent.

What each symbol means

P/Q
the integrand, numerator over denominator; the real roots of Q are the poles of f
C
a constant of integration, free to differ on each interval between poles

Where the formula comes from

  1. A simple factor: cover it up. Multiply the identity by x − a and put x = a. Every other fraction vanishes, and A is P(a) divided by what is left of the denominator at a.
  2. A repeated factor needs one fraction per power. For (x − a)², write A/(x − a) + B/(x − a)². The cover-up gives B; compare the coefficients of one power of x, or put in any other value of x, to find A.
  3. A quadratic with no real root. Split its numerator into a multiple of the quadratic’s derivative and a constant. The first part integrates to a logarithm; the second, once the square is completed, to an arctangent.
Breaks when
The decomposition needs the roots of Q, and above degree four they may have no formula in radicals; the coefficients are still exact numbers, but they can be out of reach of radicals too: on the x⁵ − x − 1 preset the first is exactly 1/(5r⁴ − 1), r the real root, and like r it has no radical formula. The page works with numerical approximations to them. The rational part of the answer never needs the roots: Charles Hermite showed it can be found by polynomial arithmetic alone, and Hardy's §4 gives his method.

Problems solved in full

  1. Two linear factors: the cover-up rule 3 steps

    Find ∫(x + 7)/((x − 1)(x + 3)) dx.

    1. One fraction for each linear factor:

    2. Cover up each factor in turn and put in its root:

    3. Each fraction integrates to a logarithm:

    Answer

    2 ln|x − 1| − ln|x + 3| + C. Two lines of arithmetic, no simultaneous equations. The cover-up works because multiplying by x − 1 and putting x = 1 sends every other fraction to zero.

  2. A repeated factor 3 steps

    Find ∫dx/(x²(x + 1)).

    Show solution
    1. x² is a repeated factor, so it needs two fractions, one for x and one for x²:

    2. Cover-up gives B and C; the coefficient of x² gives A:

    3. Integrate each piece. B/x² is a power, not a logarithm:

    Answer

    ln|(x + 1)/x| − 1/x + C. Writing only B/x² and C/(x + 1) is the slip: two fractions cannot add up to this one, and the comparison of coefficients would have no solution.

  3. A quadratic with no real root 2 steps

    Find ∫(3x + 1)/(x² + 1) dx.

    Show solution
    1. x² + 1 does not factor, so split the numerator into a multiple of its derivative 2x and a constant:

    2. The first part is f′/f, the second the arctangent:

    Answer

    (3/2) ln(x² + 1) + arctan x + C. No bars on the logarithm, because x² + 1 is never negative.

  4. A linear factor times a quadratic 3 steps

    Find ∫dx/(x(x² + 1)).

    Show solution
    1. The quadratic piece gets a linear numerator, Bx + C:

    2. Cover-up gives A; matching the rest gives B and C:

    3. A logarithm, and a logarithm of the quadratic:

    Answer

    ln|x| − ½ ln(x² + 1) + C. A constant over x² + 1 would not be enough: the numerator over a quadratic is always allowed to be linear.

  5. An improper fraction: divide first 3 steps

    Find ∫(x³ + x)/(x − 1) dx.

    Show solution
    1. The top has the higher degree, so divide first:

    2. A polynomial plus a proper fraction:

    3. Integrate term by term:

    Answer

    x³/3 + x²/2 + 2x + 2 ln|x − 1| + C. Partial fractions start only once the top’s degree is below the bottom’s.

  6. Completing the square 2 steps

    Find ∫dx/(x² + 4x + 13).

    Show solution
    1. The discriminant is 16 − 52 < 0, so there is no real root. Complete the square:

    2. This is the arctangent form with h = −2 and k = 3:

    Answer

    (1/3) arctan((x + 2)/3) + C. Forgetting the 1/3 in front is the usual slip: arctan((x + 2)/3) differentiates to 3/(x² + 4x + 13), three times the integrand.

  7. A definite integral between the poles 2 steps

    Evaluate ∫01 dx/(x² − 4).

    Show solution
    1. x² − 4 = (x − 2)(x + 2), and the cover-up gives ±1/4:

    2. Both poles, at ±2, lie outside [0, 1], so the formula may be used between the limits:

    Answer

    −(ln 3)/4 ≈ −0.2747. Negative, because 1/(x² − 4) is below zero on [0, 1]. Over an interval with a pole inside, the same subtraction would give a number for an integral that does not exist, which is the warning in the insight block on the constants of integration.

  8. ∫ dx/(x⁴ + 1): no real roots, two real quadratics 5 steps

    Find ∫₀^∞ dx/(x⁴ + 1). The denominator has no real root, so there is no pole and no linear factor, and none of the page's problems looks like it. Press An arctangent for the building block.

    Open this problem in the tool

    Show solution
    1. x⁴ + 1 has no real root, but it is a difference of two squares once 2x² is added and taken away, so it splits into two real quadratics:

    2. Neither quadratic has a real root (both discriminants are 2 − 4 = −2), so each gets a linear top. Comparing coefficients gives:

    3. Each quadratic piece splits into a multiple of the bottom's derivative, which gives a logarithm, and a constant over a completed square, which gives an arctangent:

    4. So the antiderivative, valid on the whole line, is:

    5. At x = 0 the logarithm is ln 1 = 0 and the arctangents cancel. As x grows the logarithm tends to ln 1 = 0 again and each arctangent to π/2:

    Answer

    π/(2√2) ≈ 1.1107. The page's explorer stops at x² + c; a quartic with no real roots needs the same two moves, a logarithm and an arctangent, carried out twice, with √2 in every coefficient.

An arctangent is a logarithm whose roots went complex 🖖

Press Two logarithms and look at the explorer below the trainer. At c = −1 the integrand is 1/(x² − 1), whose denominator has the real roots ±1, so it splits into two partial fractions and integrates to logarithms: the area from 2 to 3 is ½ ln(3/2) = 0.2027. Press An arctangent. At c = 1 the denominator x² + 1 has no real root, nothing splits over the reals, and the answer is arctan 3 − arctan 2 = 0.1419. Now drag c through zero. The formula changes twice, from logarithms to −1/x at exactly c = 0, where the area is 1/6 = 0.1667, and then to an arctangent, and the curve on the right does not notice: no jump, and no corner. They are one function written three ways. Allow complex numbers and x² + 1 = (x − i)(x + i) splits like any other quadratic; the arctangent is then a logarithm too, and Brian Conrad's notes on Liouville's theorem check by differentiation that 2i·arctan x, plus a constant, is a logarithm of (x − i)/(x + i). “Logarithms and arctangents” is how the real numbers say “logarithms”.

One +C is not enough 🖖

Press Two poles, then Show one answer: the page writes 3 ln|x − 2| − 3 ln|x + 1| for f = 9/((x − 2)(x + 1)). Now press Shift the constants. The page adds a different constant on each of the three intervals that the poles at −1 and 2 cut the line into, draws the shifted branches over the old ones, and asks the checker again. Still right: on each interval a constant has derivative zero, and nothing ties one interval to the next. The general antiderivative here has three independent constants, and “+ C” names only the slice of it where all three are equal. Count the real poles and add one. A jump anywhere else is wrong, and the checker says so: add + sign(x) to the answer, which jumps at 0 where f is smooth, and it is refused. This is where the constants bite. The integral of this f from 0 to 3 does not exist, since it runs through the pole at 2, yet subtracting the formula's values at 0 and 3 gives a perfectly confident number, −3 ln 8.

The theorem promises the form of the answer, not a formula for its numbers 🖖

Press x⁵ − x − 1. Over the reals every polynomial factors into linear and quadratic pieces, so every rational function integrates into a rational part, logarithms and arctangents, and this one does: a logarithm for the real root near 1.1673 and, for each of the two complex pairs, a logarithm of a quadratic and an arctangent. Step through the worked example to see all five terms. What the theorem does not supply is a formula for the roots, and for this denominator none exists. Mod 5 it does not factor at all, and mod 2 it is (x² + x + 1)(x³ + x² + 1); together those force its Galois group to be S₅, and then no root can be written with +, −, ×, ÷ and radicals. So the page computes the roots numerically, to about fifteen significant digits, and the checker accepts the antiderivative built from them. Copy the four-decimal coefficients of the last step into the answer box instead and the checker refuses it, because it asks for agreement to one part in a million. G. H. Hardy said it plainly in 1916: the roots “cannot as a rule be determined in any explicit form. The method of partial fractions is therefore subject to serious limitations.”

Learning path

Techniques of integration

References (3)