How Partial Fraction Decomposition works
Partial fraction decomposition rewrites a "complicated" rational function as a sum of simpler fractions with lower-degree denominators. This calculator handles the common case of a linear numerator over a quadratic denominator: (px + q) / (ax² + bx + c). The technique is the reverse of combining fractions over a common denominator, and it is the standard first step for integrating rational functions, computing inverse Laplace transforms, and simplifying transfer functions in engineering.
Formula and method
First, factor the denominator using the quadratic formula: r = (−b ± √(b² − 4ac)) / (2a), where D = b² − 4ac is the discriminant. Three cases follow. If D > 0, there are two distinct real roots r1 and r2, so ax² + bx + c = a(x − r1)(x − r2), and the decomposition is (px + q)/(ax² + bx + c) = A/(x − r1) + B/(x − r2) with A = (p·r1 + q) / (a·(r1 − r2)) and B = (p·r2 + q) / (a·(r2 − r1)) — found by multiplying both sides by the denominator and substituting x = r1 and x = r2 (the Heaviside cover-up method). If D = 0, the denominator has one repeated root r = −b/(2a), giving ax² + bx + c = a(x − r)², and the decomposition becomes A/(x − r) + B/(x − r)² with A = p/a and B = q/a + A·r, found by matching coefficients of x and the constant term. If D < 0, the quadratic has no real roots — it is irreducible over the reals — so the fraction cannot be split into real linear terms at all.
Common sources of error
- Forgetting the leading coefficient a: the denominator factors as a(x − r1)(x − r2), not (x − r1)(x − r2) — dropping the a scales both A and B incorrectly.
- Sign errors in the roots: the quadratic formula's ± sign controls which root is r1 and which is r2; swapping them swaps A and B.
- Treating a repeated root like two distinct roots: when D = 0, dividing by (r1 − r2) is a division by zero — the repeated-root form A/(x − r) + B/(x − r)² must be used instead.
- Missing the improper-fraction case: if the numerator's degree were equal to or greater than the denominator's, you would need polynomial long division first — this calculator assumes a proper fraction (numerator degree less than 2).
Checking your result
To verify a decomposition, recombine A/(x − r1) + B/(x − r2) over the common denominator (x − r1)(x − r2) and confirm the numerator simplifies back to px + q. As a quick numeric check, plug in any convenient value of x (not equal to a root) into both the original fraction and the decomposed sum — the two should match to within rounding.
Applications
Partial fractions are used to integrate rational functions term by term in calculus, to invert Laplace and z-transforms in control theory and signal processing, and to simplify electrical circuit transfer functions before analyzing poles and residues. Recording the coefficients A and B alongside the roots lets you reconstruct or double-check the decomposition later.