This tool decomposes a rational function into partial fractions and writes each algebra step. A rational function is one polynomial divided by another. The boxes start with 1 over x^2 − 1, the distinct-linear example written out below. You can also type a repeated factor such as (x − 1)^2, or an irreducible quadratic such as x^2 + 1.
If the numerator has degree at least as high as the denominator, the page divides first and keeps the quotient. It then factors the denominator, sets up one fraction for each linear power and a linear numerator for each irreducible quadratic, and solves for the unknown constants in exact fractions.
The same split shows up before an antiderivative on the calculus foundations map, in a telescoping series such as 1/(n(n + 2)), and when a separable equation such as y' = y(2 − y) is integrated. This page stops at the decomposition. The integral is the next step.
How to read the result
The large line is the decomposition. A polynomial at the front is the quotient from division. Each later term is a partial fraction. A coefficient that comes out zero is omitted, and the steps say so. The lines under the answer are the division, the factoring, the cover-up substitutions, and the coefficient matching.
For distinct linear factors, each constant is a cover-up value: substitute the root of one factor into the numerator and into the other factors, then divide. For a repeated linear factor (x − r)^m, cover-up finds only the coefficient of 1/(x − r)^m. The lower powers come from equating coefficients. For an irreducible quadratic, the numerator is Bx + C, and those two constants come from the same system.
The check multiplies the partial fractions back together. If that sum is the numerator you started with, after any division and any canceled common factor, the identity holds wherever the denominator is not zero.
Three textbook setups
Distinct linear factors. 1/(x^2 − 1) = 1/((x − 1)(x + 1)). The decomposition is −(1/2)/(x + 1) + (1/2)/(x − 1). The same identity is often written (1/2)/(x − 1) − (1/2)/(x + 1).
A repeated linear factor. (x + 2)/(x − 1)^2 = 1/(x − 1) + 3/(x − 1)^2. One fraction over (x − 1) cannot carry both coefficients. The 3 is the numerator at x = 1. The 1 is the coefficient of x after you expand.
An irreducible quadratic. 1/(x(x^2 + 1)) = 1/x − x/(x^2 + 1). The discriminant of x^2 + 1 is −4, which is not a square, so the quadratic stays whole and its numerator is allowed to be linear. The constant term in that numerator is 0, and the steps drop it.
An improper fraction is divided first. (x^2 + 1)/(x − 1) equals x + 1 + 2/(x − 1). The quotient is a polynomial. Only 2/(x − 1) is a partial fraction.
A fully worked example
Both examples below are written on the page, so you can read them with scripts turned off. The form opens on the first one. Clear the boxes and type the second numerator and denominator if you want the repeated case from the buttons as well.
Distinct linear factors. Numerator 1, denominator x^2 - 1.
Numerator: 1.
Denominator: x^2 − 1.
The numerator has degree 0 and the denominator has degree 2.
The degree of the numerator is smaller, so the fraction is proper. There is no polynomial quotient to split off.
Factor the denominator x^2 − 1.
By the rational root theorem, any rational root p/q in lowest terms has p dividing the constant term −1 and q dividing the leading coefficient 1.
The rational root theorem produces a root x = −1, so x + 1 is a factor.
Dividing x^2 − 1 by (x + 1) leaves x − 1.
The remaining factor x − 1 is linear.
Factored denominator: (x + 1)(x − 1).
Expanding that product returns x^2 − 1.
Set up the partial fractions.
1 / (x^2 − 1) = A/(x + 1) + B/(x − 1).
Cover (x + 1) and substitute x = −1.
The numerator there is 1. The other factors, evaluated at that root, equal −2.
A = 1 / (−2) = −1/2.
Cover (x − 1) and substitute x = 1.
The numerator there is 1. The other factors, evaluated at that root, equal 2.
B = 1 / 2 = 1/2.
Decomposition
1 / (x^2 − 1) = −(1/2)/(x + 1) + (1/2)/(x − 1).
Check. Multiply each partial fraction by the factors it does not already include, then add.
−(1/2)·(x − 1) + (1/2)·(x + 1) = 1.
That is the numerator of the proper fraction, so the decomposition is correct wherever the denominator is not zero.
Repeated linear factor. Numerator x + 2, denominator (x - 1)^2.
Numerator: x + 2.
Denominator: x^2 − 2x + 1.
The numerator has degree 1 and the denominator has degree 2.
The degree of the numerator is smaller, so the fraction is proper. There is no polynomial quotient to split off.
Factor the denominator x^2 − 2x + 1.
By the rational root theorem, any rational root p/q in lowest terms has p dividing the constant term 1 and q dividing the leading coefficient 1.
The rational root theorem produces a root x = 1, so x − 1 is a factor, and it divides 2 times.
Dividing x^2 − 2x + 1 by (x − 1)^2 leaves 1.
Factored denominator: (x − 1)^2.
Expanding that product returns x^2 − 2x + 1.
Set up the partial fractions.
(x + 2) / (x^2 − 2x + 1) = A/(x − 1) + B/(x − 1)^2.
Cover (x − 1)^2 and substitute x = 1.
The numerator there is 3. The other factors, evaluated at that root, equal 1.
B = 3 / 1 = 3.
Substitution fixed the coefficient on each full linear power. Expand the identity to find the remaining letters.
Multiply through by the factored denominator. Each letter multiplies the factors that its own denominator does not already include.
A multiplies x − 1.
B is the whole numerator of its fraction, because that denominator power is the entire factored denominator.
The sum of those pieces equals x + 2.
Match coefficients, then substitute the cover-up values.
Constant term: −A + B = 2
Coefficient of x: A = 1
Substitute B = 3.
The equations that still have an unknown letter:
Constant term: −A = −1
Coefficient of x: A = 1
1. Divide the constant term equation by −1 so the coefficient of A is 1.
Constant term: A = 1
Coefficient of x: A = 1
2. Subtract the equation that isolates A from the coefficient of x equation, to clear A.
Constant term: A = 1
Coefficient of x: 0 = 0
A = 1.
Decomposition
(x + 2) / (x^2 − 2x + 1) = 1/(x − 1) + 3/(x − 1)^2.
Check. Multiply each partial fraction by the factors it does not already include, then add.
1·(x − 1) + 3 = x + 2.
That is the numerator of the proper fraction, so the decomposition is correct wherever the denominator is not zero.
Related reading
Place the algebra on calculus foundations. A telescoping series uses the same split: sequences, series, and when infinite sums make sense writes 1/(n(n + 2)) by partial fractions and then takes a limit. The sequence calculator adds a finite list. It does not decompose a rational term.
The logistic step in separable differential equations integrates 1/(y(2 − y)) after a partial fraction split. The Riemann sum calculator estimates a definite integral with rectangles. The quadratic formula calculator is the discriminant test for whether a quadratic factor has rational roots. The short definition is partial fraction decomposition in the glossary.