Partial Fractions Calculator
Partial fraction decomposition rewrites a single complicated fraction as a sum of simpler fractions, a technique essential for integrating rational functions and for inverse Laplace transforms. This calculator handles the most common case: a proper fraction whose numerator is linear and whose denominator is the product of two distinct linear factors, written (px plus q) over (x minus r1)(x minus r2). It splits this into A over (x minus r1) plus B over (x minus r2) and finds the two constants A and B. It uses the cover-up method, the cleanest way to find each constant: to get A, substitute x equals r1 into the numerator divided by the remaining factor, and to get B, substitute x equals r2 likewise. This works because each substitution makes the other term vanish. You enter the numerator coefficients and the two roots of the denominator, and the calculator returns A and B exactly. The decomposition is the reverse of adding the two simple fractions back together over a common denominator, so you can always check the answer by recombining. Every figure is computed deterministically from your inputs, never estimated. The method and a worked example that reconciles to the calculator default are shown in full below so you can follow each step.
For a fraction (px+q) / ((x-r1)(x-r2)), the cover-up method gives A = (p*r1+q)/(r1-r2) and B = (p*r2+q)/(r2-r1). The default (3x+5) / ((x+1)(x+2)) decomposes to 2/(x+1) + 1/(x+2).
Formula
(p x + q) / ((x - r1)(x - r2)) = A / (x - r1) + B / (x - r2)
A = (p r1 + q) / (r1 - r2)
B = (p r2 + q) / (r2 - r1)
Each constant is found by the cover-up method: substitute the root of one factor into the numerator divided by the other factor. The substitution makes the matching denominator vanish, isolating one constant at a time.
Worked example
Decompose (3x + 5) over (x + 1)(x + 2), so p = 3, q = 5, r1 = -1 and r2 = -2.
- A = (3(-1) + 5) / ((-1) - (-2)) = 2 / 1 = 2
- B = (3(-2) + 5) / ((-2) - (-1)) = (-1) / (-1) = 1
- So (3x + 5)/((x+1)(x+2)) = 2/(x+1) + 1/(x+2)
- Check: 2(x+2) + 1(x+1) = 3x + 5, which matches the numerator
These are the calculator's default inputs, so A = 2 and B = 1 match the widget exactly.
Partial Fractions Calculator: frequently asked questions
What is partial fraction decomposition?
It is the process of writing one rational expression as a sum of simpler fractions whose denominators are the factors of the original denominator. It is widely used to integrate rational functions and to invert Laplace transforms.
What cases does this calculator handle?
It handles a proper fraction with a linear numerator over the product of two distinct linear factors. The two denominator roots must be different.
What is the cover-up method?
To find the constant over a factor (x - r), substitute x = r into the numerator divided by the remaining factor. The matching denominator vanishes, so only that constant remains.
What if the roots are equal?
Repeated factors need a different form with terms like B/(x-r)^2, which this calculator does not cover. Use two distinct roots here.
How do I check the answer?
Add the two simple fractions back over the common denominator. The combined numerator should match the numerator you entered, as shown in the worked example.
Official sources
- Algebra and rational function reference: US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.