Sub topic 17
Partial fraction decomposition
Partial fraction decomposition writes one rational expression as a sum of simpler fractions. It reverses the common-denominator step from the chapter on adding and subtracting. This chapter assumes you can factor polynomials completely, do polynomial long division, and solve a small system of linear equations. It also assumes you have met the idea of a slant asymptote.
Why decompose
Adding fractions combines pieces into one fraction with a larger denominator:
1/(x − 1) + 1/(x + 1) = 2x/((x − 1)(x + 1))
Decomposition goes the other way. Starting from one fraction with a factored denominator, you recover the pieces. Each piece has a single factor in its denominator, so it is easier to work with. This is the main use of the technique in later courses, where each simple piece can be integrated or summed on its own.
The working model
A rational expression N(x)/D(x) can be decomposed when two conditions hold:
- The expression is proper, meaning the degree of N is less than the degree of D.
- D is factored completely over the real numbers.
Each factor of D then contributes a fixed pattern of terms with unknown numerators.
| Factor in the denominator | Terms it contributes |
|---|---|
| Linear factor (x − a), appearing once | A/(x − a) |
| Repeated linear factor (x − a)^n | A1/(x − a) + A2/(x − a)^2 + ... + An/(x − a)^n |
| Irreducible quadratic (x^2 + bx + c) | (Bx + C)/(x^2 + bx + c) |
| Repeated irreducible quadratic, power n | One term (Bk x + Ck)/(x^2 + bx + c)^k for each k from 1 to n |
The numerator of each term has degree one less than its factor. A linear factor gets a constant. A quadratic factor gets a linear numerator.
Case 1: distinct linear factors
Decompose 1/(x² − 1). The denominator factors as (x − 1)(x + 1), so write
1/((x − 1)(x + 1)) = A/(x − 1) + B/(x + 1)
Multiply both sides by (x − 1)(x + 1):
1 = A(x + 1) + B(x − 1)
This equation holds for every x, so you can choose convenient values. Setting x = 1 gives 1 = 2A, so A = 1/2. Setting x = −1 gives 1 = −2B, so B = −1/2. This shortcut is called the cover-up method. It works because each chosen value zeroes out every term except one.
The result is 1/(2(x − 1)) − 1/(2(x + 1)). SymPy's apart performs the same computation, and you can confirm any decomposition by recombining it.
from sympy import symbols, apart, simplify
x = symbols('x')
expr = 1/(x**2 - 1)
parts = apart(expr)
print(parts) # equivalent to 1/(2*(x - 1)) - 1/(2*(x + 1))
print(simplify(parts - expr) == 0) # TrueCase 2: repeated linear factors
Decompose (x + 3)/(x − 1)². The factor (x − 1) appears twice, so you need a term for each power:
(x + 3)/(x − 1)² = A/(x − 1) + B/(x − 1)²
Clearing denominators gives x + 3 = A(x − 1) + B. Setting x = 1 gives B = 4. Comparing the coefficients of x gives A = 1. So
(x + 3)/(x − 1)² = 1/(x − 1) + 4/(x − 1)²
Cover-up only gives you the coefficient of the highest power, here B. For the other coefficients, compare coefficients or substitute other x-values.
Case 3: irreducible quadratic factors
A quadratic that has no real roots cannot be split into real linear factors. Its term needs a linear numerator. Decompose (3x + 5)/((x + 1)(x² + 1)):
(3x + 5)/((x + 1)(x² + 1)) = A/(x + 1) + (Bx + C)/(x² + 1)
Clearing denominators gives
3x + 5 = A(x² + 1) + (Bx + C)(x + 1)
Setting x = −1 gives 2 = 2A, so A = 1. Subtract A(x² + 1) from both sides:
3x + 5 − (x² + 1) = −x² + 3x + 4 = −(x − 4)(x + 1)
This equals (Bx + C)(x + 1), so Bx + C = −x + 4. That gives B = −1 and C = 4. The decomposition is
1/(x + 1) + (4 − x)/(x² + 1)
A quick check at x = 1: the original gives 8/4 = 2, and the decomposition gives 1/2 + 3/2 = 2.
from sympy import symbols, apart, simplify
x = symbols('x')
expr = (3*x + 5) / ((x + 1) * (x**2 + 1))
parts = apart(expr)
print(parts) # equivalent to 1/(x + 1) + (4 - x)/(x**2 + 1)
print(simplify(parts - expr) == 0) # TrueImproper fractions: divide first
The patterns above assume a proper fraction. If the degree of N is at least the degree of D, divide first. Take (x² + 1)/(x − 1):
from sympy import symbols, div, apart
x = symbols('x')
quotient, remainder = div(x**2 + 1, x - 1, x)
print(quotient, remainder) # x + 1 2
print(apart((x**2 + 1)/(x - 1))) # x + 1 + 2/(x - 1)So (x² + 1)/(x − 1) = x + 1 + 2/(x − 1). Only the remainder fraction 2/(x − 1) needs decomposing, and here it is already a single term. The quotient x + 1 is the slant asymptote from the earlier chapter. The decomposition shows why: as x grows, the term 2/(x − 1) approaches 0, and the graph approaches y = x + 1.
Common errors
- Skipping the division. Writing A/(x − 1) for an improper fraction produces equations with no solution.
- Stopping at an incomplete factorization. A factor such as x² − 4 must be split into (x − 2)(x + 2) before you write the pattern.
- Dropping lower powers. For (x − 1)³ you need terms over (x − 1), (x − 1)² and (x − 1)³. Using only the highest power loses solutions.
- Using a constant over an irreducible quadratic. A/(x² + 1) is too restrictive. Use (Bx + C)/(x² + 1).
- Treating cover-up as universal. It fails for irreducible quadratics and gives only the top coefficient for repeated factors.
- Never checking. Recombining over the common denominator, or comparing with
apart, catches arithmetic slips quickly.
Exercise
Decompose (5x + 7)/((x + 1)(x + 2)) into partial fractions.
Show answer
Write A/(x + 1) + B/(x + 2), so 5x + 7 = A(x + 2) + B(x + 1). Setting x = −1 gives 2 = A. Setting x = −2 gives −3 = −B, so B = 3. The result is 2/(x + 1) + 3/(x + 2). Check at x = 0: the original is 7/2, and 2 + 3/2 = 7/2.
Exercise
Write the form of the decomposition (with unknown constants, without solving) for (x³ + 2)/(x²(x² + 4)). Is any division needed first?
Show answer
The numerator has degree 3 and the denominator has degree 4, so the fraction is proper and no division is needed. The factor x² is a repeated linear factor and x² + 4 is an irreducible quadratic, so the form is A/x + B/x² + (Cx + D)/(x² + 4).