Exact fractions

Partial fraction decomposition calculator

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.

Polynomials such as x^2+3x+2 or (x-1)(x+2)^2. A comma list such as 1, 0, -1 is read from the highest power down to the constant. Use ^ for powers. A slash in one box only divides by a number, as in (1/2)x. A decimal is an exact fraction of a power of ten, so 0.5 is 1/2. One variable: x, or y, t, or n.

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.

Disclaimer. Educational estimate only. This page is not a computer algebra system and not a proof. See the site disclaimer and the FAQ on calculators versus understanding.

Common questions

What is partial fraction decomposition?

Partial fraction decomposition writes a rational function as a polynomial plus a sum of simpler fractions. Each simpler denominator is a power of a linear factor, or a power of a quadratic that has no rational root. Numerators are constants, or linear polynomials when the denominator is quadratic. That identity is the algebra behind many antiderivatives and telescoping series.

What if the numerator has degree at least as high as the denominator?

Divide first. Polynomial division produces a quotient and a remainder whose degree is smaller than the denominator degree. The original function equals the quotient plus that proper fraction. Only the proper fraction is split into partial fractions. This page shows the division, then the decomposition of the remainder.

How do repeated linear factors change the setup?

A factor (x − r) that divides the denominator m times needs m fractions: a constant over (x − r), a constant over (x − r)^2, and so on up to the mth power. The coefficient of the highest power is the numerator at x = r, divided by the other factors at that root. The lower coefficients come from matching the remaining powers of x.

When is the numerator over a quadratic linear?

When a quadratic factor has no rational root, it stays in one piece. Its discriminant is not a perfect square. Over that factor, and over each of its powers, the numerator is a linear polynomial Bx + C. A single constant cannot produce every proper fraction with that denominator.

Why does the calculator keep fractions instead of decimals?

With rational coefficients, and a denominator that factors into linears and irreducible quadratics, the partial fraction coefficients are rational. A decimal can hide a value such as 1/2. This page uses exact rational arithmetic. A decimal you type is read as a fraction of a power of ten, so 0.5 becomes 1/2. Type 1/3 when you mean one third.

Does this page find the integral?

It stops at the decomposition. Integrating 1/(x − r) gives a logarithm, and integrating 1/(x − r)^m for m greater than 1 gives a power. A quadratic denominator leads to a logarithm of that quadratic, or to an arctangent after you complete the square. Those antiderivatives are the next step. The page shows the algebra that makes them possible.

Want a tool that matches a new explainer, or a check that a page and a calculator disagree? Write a short note.

Suggest a topic or tool