SwiftTools

Partial Fraction Decomposition Calculator

Split a rational function with two distinct linear factors into simple partial fractions. Enter the numerator coefficients and the two denominator roots to get A and B with the full working shown.

Rational function (ax + b) / ((x − r1)(x − r2))
A = (a·r1 + b) ÷ (r1 − r2) · B = (a·r2 + b) ÷ (r2 − r1)

How the partial fraction decomposition calculator works

To split (ax+b)/((x−r1)(x−r2)) into A/(x−r1) + B/(x−r2), set the numerators equal: ax + b = A(x−r2) + B(x−r1). Substituting x = r1 kills the B term, giving A = (a·r1+b)/(r1−r2); substituting x = r2 gives B = (a·r2+b)/(r2−r1). The calculator shows each substitution step.

This form only works when the two linear factors are distinct (r1 ≠ r2) and the numerator’s degree is lower than the denominator’s. Repeated factors and quadratics need the extended method — this calculator flags r1 = r2 as invalid.

cover-up rule: A from x=r1, B from x=r2

Partial fraction decomposition calculator FAQ

What is partial fraction decomposition?

Breaking a complicated fraction like (3x+5)/((x−1)(x−2)) into a sum of simpler fractions — here 8/(x−2) − 5/(x−1) — which are far easier to integrate or invert with Laplace transforms.

When does this calculator apply?

When the denominator factors into two distinct linear factors and the numerator is linear (degree 1). For repeated factors like (x−1)² or irreducible quadratics, the setup needs extra terms.

What is the cover-up method?

A shortcut for distinct linear factors: to find A, “cover up” (x−r1) in the denominator and evaluate what remains at x = r1. The calculator uses exactly this rule.

Why must r1 and r2 be different?

If r1 = r2, the denominator is a repeated factor (x−r1)², and the correct form is A/(x−r1) + B/(x−r1)² — a different template this calculator does not solve.

How do I check the answer?

Recombine: put A/(x−r1) + B/(x−r2) over the common denominator and confirm the numerator simplifies back to ax + b.