Partial Fraction Decomposition Calculator
Partial fractions turn an awkward rational function into a sum of simple pieces, the key step before integrating or applying an inverse Laplace transform. This calculator handles the most common case: a linear numerator px + q over a product of two distinct linear factors (x - r1)(x - r2). Enter the numerator coefficients and the two roots, and it returns the exact coefficients A and B in the decomposition A/(x - r1) + B/(x - r2), using the cover-up method. Because the roots are distinct, the answer is a closed-form exact result with no estimation.
Partial fraction formulas
(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)
Check: A + B = p, and A*(0 - r2) + B*(0 - r1) over r1*r2 reconstructs q/(r1*r2)
The cover-up method evaluates the surviving factor at each root. A and B always satisfy A plus B equals p, a quick consistency check the calculator reports.
Worked example and notes
- For (x + 1) / ((x - 1)(x - 2)): A = (1 + 1)/(1 - 2) = -2, B = (2 + 1)/(2 - 1) = 3.
- Check A + B = -2 + 3 = 1 = p, confirming the result.
- The decomposition is -2/(x - 1) + 3/(x - 2).
- Roots can be entered as the values that make each factor zero, so x - 1 has root 1.
- Equal roots are rejected because they need a repeated-factor form.
Partial fraction decomposition: frequently asked questions
What is partial fraction decomposition?
Partial fraction decomposition rewrites a rational function as a sum of simpler fractions whose denominators are the factors of the original denominator. It is essential for integrating rational functions, taking inverse Laplace transforms, and simplifying algebraic expressions.
What case does this calculator handle?
It decomposes a proper rational function with a linear numerator px + q over a denominator that factors into two distinct linear terms (x minus r1)(x minus r2). The result is A/(x minus r1) plus B/(x minus r2) with exact coefficients A and B.
What is the cover-up method?
The cover-up method finds each coefficient by covering one factor and evaluating the rest at that factor's root. Here A equals (p times r1 plus q) divided by (r1 minus r2), and B equals (p times r2 plus q) divided by (r2 minus r1). It gives the coefficients directly without solving a linear system.
Why must the two roots be distinct?
If r1 equals r2 the denominator has a repeated factor (x minus r)^2, which requires a different decomposition with a term over (x minus r)^2. The distinct-root formula divides by r1 minus r2, so equal roots make it undefined. The calculator returns n/a in that case.
How can I check the result?
Recombine the two partial fractions over the common denominator: A(x minus r2) plus B(x minus r1) should equal px plus q for all x. The calculator's coefficients satisfy this identity exactly, which is the standard verification.
Official sources
- NIST Digital Library of Mathematical Functions: Algebraic and analytic methods.
- MIT OpenCourseWare: Single variable calculus, partial fractions.
Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.