Partial Fractions for Integrating Rational Functions
Split a ratio of polynomials into simple pieces you can integrate, covering every factor type with checked examples.
Key takeaways
- First make sure the numerator has lower degree than the denominator, using polynomial long division if it does not.
- Factor the denominator into linear factors and irreducible quadratic factors, then write one term for each power of each factor.
- Linear factors integrate to logarithms or negative powers; irreducible quadratics lead to logarithms and arctangents.
- Check the split by recombining the fractions or by testing one convenient value of x.
The method of partial fractions rewrites a complicated ratio of polynomials as a sum of simple fractions, each of which you can integrate with a logarithm, a power rule or an arctangent. It is algebra done in service of calculus: once the fraction is split, the integration is usually the short part.
A rational function is one polynomial divided by another. This guide covers the full procedure, one factor type at a time.
The idea: undoing a common denominator
You already know how to add fractions:
2/(x − 2) + 3/(x + 1) = [2(x + 1) + 3(x − 2)] / [(x − 2)(x + 1)]
= (5x − 4)/(x² − x − 2) The right side is awkward to integrate. The left side is easy: 2 ln|x − 2| + 3 ln|x + 1| + C. Partial fractions is the art of running the addition backward.
The form of the answer is dictated by the denominator. You write down that form with unknown constants, then solve for them.
Distinct linear factors
Start with (5x − 4)/(x² − x − 2). The denominator factors as (x − 2)(x + 1), so set:
(5x − 4)/((x − 2)(x + 1)) = A/(x − 2) + B/(x + 1)
5x − 4 = A(x + 1) + B(x − 2) (multiply through)
x = 2: 6 = 3A, so A = 2
x = −1: −9 = −3B, so B = 3 Choosing x-values that make factors vanish finds each constant in one line. The identity of polynomials holds for all x, including those where the original fraction was undefined.
A shortcut called the cover-up method does the same thing. To get A, cover the factor (x − 2) in the original denominator and evaluate what remains at x = 2: (10 − 4)/3 = 2. It works directly for factors that appear only once.
With limits, the integral from 3 to 4 equals 3 ln 5 − 4 ln 2, which is ln(125/16), about 2.056.
Do the long division first
The method assumes a proper fraction, with numerator degree smaller than denominator degree. For x³/(x² − 1), divide first:
x³ = x(x² − 1) + x
x³/(x² − 1) = x + x/(x² − 1)
∫ = x²/2 + (1/2) ln|x² − 1| + C Here the remaining fraction yielded to a substitution without further splitting. Always look for that before setting up unknowns: when the numerator is a constant multiple of the denominator's derivative, substitution finishes the job at once.
Skipping the division is the most common failure. The system of equations for the constants then has no solution, which can cost a lot of time before you notice why.
Repeated linear factors
If a factor appears as (x − r)ᵏ, you need a separate term for every power from 1 to k. For (3x + 5)/(x + 1)²:
(3x + 5)/(x + 1)² = A/(x + 1) + B/(x + 1)²
3x + 5 = A(x + 1) + B
x = −1: 2 = B
coefficient of x: 3 = A
∫ = 3 ln|x + 1| − 2/(x + 1) + C Leaving out the lower power is a tempting mistake. Without the A term you could only produce a constant numerator, never 3x + 5.
Mixing factor types
Real problems combine cases, and the template simply combines too. For 1/(x³ − x), factor the denominator as x(x − 1)(x + 1). All three factors are distinct, so cover-up gives each constant:
at x = 0: 1/((−1)(1)) = −1
at x = 1: 1/((1)(2)) = 1/2
at x = −1: 1/((−1)(−2)) = 1/2
∫ = −ln|x| + (1/2) ln|x − 1| + (1/2) ln|x + 1| + C Now take (x² + 1)/(x(x − 1)²), which has one simple factor and one repeated factor. Write A/x + B/(x − 1) + C/(x − 1)² and clear denominators:
x² + 1 = A(x − 1)² + Bx(x − 1) + Cx
x = 0: 1 = A
x = 1: 2 = C
x² coefficient: 1 = A + B, so B = 0
∫ = ln|x| − 2/(x − 1) + C A constant may well turn out to be zero. Include it in the template anyway, because you cannot know that in advance.
When no convenient root is left to plug in, either compare coefficients of like powers or substitute any other small number for x. Both give valid linear equations.
Irreducible quadratic factors
A quadratic is irreducible over the real numbers if its discriminant b² − 4ac is negative, so it has no real roots. Such a factor gets a linear numerator, Bx + C. Consider (3x² + 2x + 1)/((x − 1)(x² + 1)).
3x² + 2x + 1 = A(x² + 1) + (Bx + C)(x − 1)
x = 1: 6 = 2A, so A = 3
x² coefficient: 3 = A + B, so B = 0
constant term: 1 = A − C, so C = 2
check x term: 2 = C − B holds The integral is 3 ln|x − 1| + 2 arctan x + C.
When the quadratic is not a plain x² + 1, complete the square. For 1/(x² + 4x + 13), write the denominator as (x + 2)² + 9. The integral is (1/3) arctan((x + 2)/3) + C.
If the numerator contains x, split it into a multiple of the quadratic's derivative, which gives a logarithm, plus a constant, which gives an arctangent.
Splitting a numerator over a quadratic
Here is that split in action for (2x + 7)/(x² + 4x + 13). The derivative of the denominator is 2x + 4, so write the numerator as (2x + 4) + 3.
∫ (2x + 4)/(x² + 4x + 13) dx = ln(x² + 4x + 13)
∫ 3/((x + 2)² + 9) dx = arctan((x + 2)/3)
sum, plus C No absolute value is needed on this logarithm, since the quadratic is always positive.
A squared irreducible quadratic is the hardest standard case. The basic example, found by substituting x = tan θ, is:
∫ dx/(x² + 1)² = x/(2(x² + 1)) + (arctan x)/2 + C Differentiate the right side and the two pieces combine to the integrand. In practice, many people take integrals of this kind from a table or from computer algebra, after doing the decomposition themselves.
Which template goes with which factor
| Factor in denominator | Terms to include | Typical integral |
|---|---|---|
| (x − r) | A/(x − r) | Logarithm |
| (x − r)² | A/(x − r) + B/(x − r)² | Logarithm and reciprocal |
| (x² + px + q), no real roots | (Bx + C)/(x² + px + q) | Logarithm and arctangent |
| (x² + px + q)², no real roots | Two terms, each with a linear numerator | Also needs a trigonometric substitution or reduction |
The number of unknown constants always equals the degree of the denominator. Count them as a quick check on your template.
Why it always works in principle
By the fundamental theorem of algebra and the fact that complex roots of real polynomials come in conjugate pairs, every real polynomial factors into real linear and quadratic pieces. Unlike many other functions, then, every rational function has an antiderivative expressible with rational functions, logarithms and arctangents.
The catch is the phrase "in principle". Factoring the denominator requires finding its roots, and for polynomials of degree five or higher there is no general formula in radicals, as explained in the big idea of Galois theory. For such cases you may need numerical roots, or to evaluate the definite integral with a numerical rule.
Beyond integration
The same decomposition appears wherever a rational function must be taken apart. Solving differential equations with the Laplace transform usually ends with a fraction that must be split before you can read off the solution.
The logistic equation y′ = y(1 − y) is another example. Separating variables leads to 1/(y(1 − y)), which splits as 1/y + 1/(1 − y). For 0 < y < 1, integrating gives ln(y/(1 − y)) = t + C, and solving for y produces the familiar S-shaped curve.
It also tames some infinite sums. Since 1/(k(k + 1)) = 1/k − 1/(k + 1), adding these terms from k = 1 to n collapses to 1 − 1/(n + 1), which approaches 1.
Turning other integrals into rational ones
A substitution can convert an integrand that is not rational into one that is. For ∫ dx/(1 + eˣ), let u = eˣ, so that dx = du/u.
∫ du/(u(1 + u)) = ∫ (1/u − 1/(1 + u)) du
= ln u − ln(1 + u) + C
= x − ln(1 + eˣ) + C Roots of a linear expression respond to the same treatment: setting u = √x turns many integrals in √x into rational ones. There is even a general substitution, t = tan(x/2), that converts any rational expression in sin x and cos x into a rational function of t on intervals where it is defined.
Choosing a method before you start
Not every ratio of polynomials needs the full machinery. A short checklist saves effort.
- Is the numerator a constant multiple of the denominator's derivative? Then the answer is that constant times a logarithm.
- Is the denominator a single power, such as (x − 4)³? Substitute u = x − 4 and divide term by term.
- Is the denominator a quadratic with no real roots? Complete the square and split the numerator.
- Does the expression involve only even powers of x? Treating x² as a single symbol while decomposing can halve the algebra.
For an example of the last shortcut, 1/((x² + 1)(x² + 4)) behaves like 1/((w + 1)(w + 4)) with w = x². That splits as (1/3)/(w + 1) − (1/3)/(w + 4). Replacing w by x² and integrating gives (1/3) arctan x − (1/6) arctan(x/2) + C.
Common mistakes
- Using a constant numerator over an irreducible quadratic.
- Treating x² − 4 as irreducible. It factors as (x − 2)(x + 2).
- Forgetting absolute value bars inside logarithms.
- Integrating across a root of the denominator, where the integrand blows up and the integral must be handled as improper.
- Writing ln|(x + 2)² + 9| style answers for 1/(x² + 4x + 13). The reciprocal of a quadratic is not the derivative of its logarithm.
To test a decomposition quickly, substitute an easy value such as x = 0 into both sides. In the first example, the left side is (−4)/(−2) = 2 and the right side is 2/(−2) + 3/1 = 2. A mismatch tells you to recheck the algebra before you integrate anything.