Integration of Rational Functions via Partial Fraction Decomposition
To integrate a rational function P(x)/Q(x), divide if the fraction is improper, factor the denominator, decompose into partial fractions and integrate each simple term, which gives logarithms, arctangents and rational functions. In brief: (5x + 7)/((x + 1)(x + 2)) = 2/(x + 1) + 3/(x + 2), so the integral is 2 ln|x + 1| + 3 ln|x + 2| + C. Every rational function has an elementary antiderivative.
Rational functions are the one large class for which integration always works. The method rests on the decomposition of a fraction into terms of three kinds: A/(x − a)k, and (Bx + C)/(x2 + px + q)k, each with a known antiderivative. This guide gives the integrals of the basic fractions, the full procedure with examples for distinct, repeated and quadratic factors, completing the square for the quadratic terms and a table of standard forms.
What are the basic integrals?
- ∫ dx/(x − a) = ln|x − a| + C.
- ∫ dx/(x − a)k = −1/((k − 1)(x − a)k−1) + C, for k ≥ 2.
- ∫ dx/(x2 + a2) = (1/a) arctan(x/a) + C.
- ∫ x dx/(x2 + a2) = (1/2) ln(x2 + a2) + C.
- ∫ dx/(x2 − a2) = (1/(2a)) ln|(x − a)/(x + a)| + C.
The last one comes from the decomposition 1/(x2 − a2) = (1/(2a))[1/(x − a) − 1/(x + a)].
What is the procedure?
- If deg P ≥ deg Q, divide: P/Q = polynomial + R/Q with deg R < deg Q.
- Factor Q into linear factors and irreducible quadratic factors.
- Write the decomposition with unknown coefficients.
- Find the coefficients.
- Integrate each term with the basic formulas, completing the square where needed.
Distinct and repeated linear factors
Example 1: distinct factors
∫ (5x + 7)/((x + 1)(x + 2)) dx = ∫ [2/(x + 1) + 3/(x + 2)] dx = 2 ln|x + 1| + 3 ln|x + 2| + C.
Example 2
∫ dx/(x2 − 5x + 6) = ∫ dx/((x − 2)(x − 3)). 1/((x − 2)(x − 3)) = −1/(x − 2) + 1/(x − 3) (check at x = 0: 1/6 = 1/2 − 1/3 ✓). The integral is ln|x − 3| − ln|x − 2| + C = ln|(x − 3)/(x − 2)| + C.
Example 3: a repeated factor
∫ (3x + 5)/((x − 1)(x + 2)2) dx. The decomposition is (8/9)/(x − 1) − (8/9)/(x + 2) + (1/3)/(x + 2)2. So the integral is (8/9) ln|x − 1| − (8/9) ln|x + 2| − 1/(3(x + 2)) + C = (8/9) ln|(x − 1)/(x + 2)| − 1/(3(x + 2)) + C.
Example 4: a double root
∫ (x + 3)/(x2 + 2x + 1) dx = ∫ (x + 3)/(x + 1)2 dx = ∫ [1/(x + 1) + 2/(x + 1)2] dx = ln|x + 1| − 2/(x + 1) + C.
Irreducible quadratic factors
For the quadratic factor with a negative discriminant, the term is (Bx + C)/(x2 + px + q). Complete the square: x2 + px + q = (x + p/2)2 + d2. Split the numerator into a multiple of the derivative of the denominator, 2x + p, plus a constant: this gives a logarithm plus an arctangent.
Example 5
∫ (2x2 + x + 3)/((x − 1)(x2 + 1)) dx = ∫ [3/(x − 1) − x/(x2 + 1)] dx = 3 ln|x − 1| − (1/2) ln(x2 + 1) + C.
Example 6: completing the square
∫ dx/(x2 + 2x + 5) = ∫ dx/((x + 1)2 + 4) = (1/2) arctan((x + 1)/2) + C.
Example 7: a linear numerator
∫ (2x + 3)/(x2 + 2x + 5) dx. Write 2x + 3 = (2x + 2) + 1. Then ∫ (2x + 2)/(x2 + 2x + 5) dx = ln(x2 + 2x + 5), and ∫ dx/(x2 + 2x + 5) = (1/2) arctan((x + 1)/2). The result: ln(x2 + 2x + 5) + (1/2) arctan((x + 1)/2) + C.
Example 8: x3 + 1
∫ dx/(x3 + 1): x3 + 1 = (x + 1)(x2 − x + 1). 1/(x3 + 1) = (1/3)/(x + 1) + (−x/3 + 2/3)/(x2 − x + 1). Check at x = 0: 1/3 + 2/3 = 1 ✓. The second term: −(1/6)(2x − 1)/(x2 − x + 1) + (1/2)/(x2 − x + 1), since −x/3 + 2/3 = −(1/6)(2x − 1) + 1/2. With x2 − x + 1 = (x − 1/2)2 + 3/4: the integral is (1/3) ln|x + 1| − (1/6) ln(x2 − x + 1) + (1/√3) arctan((2x − 1)/√3) + C.
Improper fractions and definite integrals
Example 9: dividing first
∫ (x3 + 2x2 + 1)/(x2 − 1) dx. The division gives x + 2 + 2/(x − 1) − 1/(x + 1). The integral is x2/2 + 2x + 2 ln|x − 1| − ln|x + 1| + C.
Example 10: a definite integral
∫23 dx/(x2 − 1) = (1/2)[ln|(x − 1)/(x + 1)|]23 = (1/2)(ln(2/4) − ln(1/3)) = (1/2) ln(3/2) ≈ 0.2027.
Example 11: a probability-type integral
∫0∞ dx/(x2 + 1) = [arctan x]0∞ = π/2.
Table of standard forms
| Integrand | Integral | Condition |
|---|---|---|
| 1/(x − a) | ln|x − a| | x ≠ a |
| 1/(x − a)2 | −1/(x − a) | x ≠ a |
| 1/(x2 + a2) | (1/a) arctan(x/a) | a ≠ 0 |
| x/(x2 + a2) | (1/2) ln(x2 + a2) | – |
| 1/(x2 − a2) | (1/(2a)) ln|(x − a)/(x + a)| | x ≠ ±a |
| 1/((x − 2)(x − 3)) | ln|(x − 3)/(x − 2)| | x ≠ 2, 3 |
| 1/(x2 + 2x + 5) | (1/2) arctan((x + 1)/2) | completed square |
Where does the method come from?
Johann Bernoulli and Leibniz exchanged letters in 1702–1703 about the integration of rational functions, and Bernoulli showed that the integral can always be expressed through logarithms and arctangents. The method rests on the algebraic fact that every real polynomial factors into linear and quadratic factors, which is a consequence of the fundamental theorem of algebra. Ostrogradsky gave a method in the nineteenth century to find the rational part of the integral without factoring.
Where is it used?
Rational integrals appear in the inverse Laplace transform for solving differential equations, in the analysis of electrical circuits, in chemical kinetics (second-order reactions give ∫ dc/c2), and in logistic growth models.
Which mistakes are common?
Forgetting to divide an improper fraction
If the degree of the numerator is at least that of the denominator, divide first. Otherwise the decomposition fails.
Forgetting the absolute value in the logarithm
∫ dx/(x − 2) = ln|x − 2| + C, valid for x on either side of 2.
Using ln for an irreducible quadratic
∫ dx/(x2 + 1) is arctan x, not ln(x2 + 1). The logarithm appears only when the numerator is the derivative of the denominator.
Missing the factor 1/a in the arctangent formula
∫ dx/(x2 + 4) = (1/2) arctan(x/2) + C. The factor 1/2 is essential.