Partial Fraction Decomposition Calculator with Steps
By FindMySum · Last reviewed
Partial fraction decomposition splits a fraction of two polynomials into a sum of simpler fractions, one for each factor of the denominator. It is the standard first step for integrating rational functions in calculus and for inverse Laplace transforms in engineering. This calculator does it exactly, with fractions rather than decimals: it divides if the fraction is improper, factors the denominator over the rational numbers, sets up the terms, solves for the unknown coefficients and checks the answer by recombining. Its opening example is (x² + 4)/(x(x − 1)²).
Step 1: make the fraction proper
Partial fractions only work when the numerator's degree is less than the denominator's. If it isn't, divide first with polynomial long division:
P(x)/Q(x) = S(x) + R(x)/Q(x), with deg R < deg Q
For example, (x³ + 2)/(x² − 1): x² − 1 goes into x³ exactly x times, leaving x³ + 2 − x(x² − 1) = x + 2. So the fraction is x + (x + 2)/(x² − 1), and only the remainder is decomposed.
Step 2: factor the denominator
Next, factor Q completely into linear factors and quadratic factors that can't be split. The calculator does this exactly over the rational numbers:
- it takes out any power of x;
- it tests every candidate root p/q allowed by the rational root theorem (p divides the constant term, q divides the leading coefficient) and divides each root out as many times as it goes;
- for what is left, it searches for quadratic factors with integer coefficients (Kronecker's method).
x⁶ − 1, for instance, becomes (x + 1)(x − 1)(x² − x + 1)(x² + x + 1). A factor such as x³ − 2, with no rational roots and no quadratic factor, can't be split using rational numbers, and the calculator reports it rather than guessing with decimals.
Step 3: write one term per factor
The form of each term depends on the factor (OpenStax's four cases):
- Distinct linear factor (x − a): one term A/(x − a).
- Repeated linear factor (x − a)ᵏ: k terms, A₁/(x − a) + A₂/(x − a)² + … + Aₖ/(x − a)ᵏ.
- Irreducible quadratic (x² + bx + c): one term (Bx + C)/(x² + bx + c), with a linear numerator.
- Repeated quadratic (x² + bx + c)ᵏ: k terms with linear numerators.
The number of unknowns always equals the degree of the denominator.
Step 4: solve for the coefficients
Multiply both sides by the factored denominator. The left side becomes the numerator; the right side becomes a polynomial whose coefficients involve the unknowns. Matching the coefficients of each power of x gives a system of linear equations, which the calculator solves exactly with Gaussian elimination.
Worked example: (x² + 4)/(x(x − 1)²)
The denominator has a single factor x and a repeated factor (x − 1)², so:
(x² + 4)/(x(x − 1)²) = A/x + B/(x − 1) + C/(x − 1)²
Multiplying by x(x − 1)²:
x² + 4 = A(x − 1)² + Bx(x − 1) + Cx
Substituting convenient values is quickest by hand. At x = 0: 4 = A, so A = 4. At x = 1: 5 = C. Comparing the x² coefficients: 1 = A + B, so B = −3. The result:
(x² + 4)/(x(x − 1)²) = 4/x − 3/(x − 1) + 5/(x − 1)²
Matching all the coefficients instead gives three equations (for x², x and the constant) and the same answer; that is the method the calculator uses, because it works for every case.
Step 5: check
Adding the terms back over the common denominator must give the original numerator: 4(x − 1)² − 3x(x − 1) + 5x = 4x² − 8x + 4 − 3x² + 3x + 5x = x² + 4. The calculator does this check exactly every time.
Fractions in the answer
When a coefficient is a fraction, the calculator writes the term in the usual textbook style, multiplying the denominator instead of nesting fractions. For 1/((x − 1)(x² + 1)) the coefficients are A = 1/2, B = −1/2 and C = −1/2, shown as:
1/(2(x − 1)) − (x + 1)/(2(x² + 1))
Factors with a leading coefficient keep their integer form, so 1/(4x² − 4x + 1) is shown as 1/(2x − 1)².
Using the result
Each term has a standard integral: ∫ 4/x dx = 4 ln|x|, ∫ −3/(x − 1) dx = −3 ln|x − 1| and ∫ 5/(x − 1)² dx = −5/(x − 1), so the example integrates to 4 ln|x| − 3 ln|x − 1| − 5/(x − 1) + C. In Laplace-transform work, choose s as the variable: each A/(s − a) term corresponds to Ae^(at).
Limits
The calculator works with rational coefficients and denominators up to degree 6 that split into linear and quadratic factors over the rationals. It doesn't factor over the real or complex numbers, handle letters as coefficients, or integrate the result for you.
More questions
What is the cover-up method?
A shortcut for distinct linear factors, credited to Oliver Heaviside. To find the coefficient over (x − a), cover that factor in the original fraction and substitute x = a into what's left. For (3x + 11)/((x + 2)(x − 3)), covering (x − 3) and putting x = 3 gives 20/5 = 4. It needs adjusting for repeated factors.
How do partial fractions help with integrals?
Each simple fraction has a standard integral: ∫ A/(x − a) dx = A ln|x − a| + C, ∫ A/(x − a)ⁿ dx = −A/((n − 1)(x − a)ⁿ⁻¹) + C, and quadratic terms give a logarithm plus an arctangent. So after decomposing, the integral of any rational function can be written down term by term.
Are partial fractions used in engineering?
Constantly, in control systems and signal processing. A system's transfer function is a ratio of polynomials in s; splitting it into partial fractions gives terms like A/(s + a) whose inverse Laplace transforms are exponentials Ae^(−at). Choose s as the variable to work in that notation.
Is the decomposition unique?
Yes. Once the denominator is factored into irreducible factors, there is exactly one set of coefficients that works, so any correct method gives the same answer, though it may be written with fractions arranged differently, such as 3/(2(x − 1)) versus (3/2)/(x − 1).
What does it mean that a factor is irreducible over the rationals?
It can't be written as a product of lower-degree polynomials with rational coefficients. x² + 1 and x² − 2 are irreducible over the rationals (x² − 2 has irrational roots ±√2), while x² − 1 = (x − 1)(x + 1) is not. Over the real numbers every polynomial splits into linear and quadratic factors, but finding them can need irrational numbers.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.