Partial Fraction Decomposition Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

What this partial fraction decomposition calculator does

This calculator decomposes rational functions of the form (ax + b) / ((x − r₁)(x − r₂)) into a sum of simpler fractions. It assumes the denominator is already factored into linear terms and that the numerator is a first–degree polynomial. The output is written as A / (x − r₁) + B / (x − r₂) for distinct roots, or in a repeated-root form when r₁ = r₂.

Partial fraction decomposition is widely used in calculus, differential equations, and control theory. By rewriting a single complicated fraction as a sum of simple fractions, standard integral and Laplace-transform formulas become easy to apply.

Core formulas

The calculator works with rational functions of the form (for real parameters a, b, r₁, r₂):

f(x) = (ax + b) / ((x − r₁)(x − r₂))

For distinct roots r₁ ≠ r₂, the decomposition is

(ax + b) / ((x − r₁)(x − r₂)) = A / (x − r₁) + B / (x − r₂).

Multiplying both sides by (x − r₁)(x − r₂) and equating coefficients yields a linear system for A and B. In expanded form, this identity is

ax + b = A(x − r₂) + B(x − r₁).

The parameters A and B are chosen so that this equality holds for all x.

The same relationship can be written using MathML. The general form is

ax+b (xr1) (xr2) = A xr1 + B xr2

When r₁ = r₂ = r (a repeated root), the denominator becomes (x − r)² and the expression is

(ax + b) / (x − r)² = A / (x − r) + B / (x − r)².

In that case there is still a pair of unknowns A and B, but they are related to a, b, and r in a slightly different way (the calculator handles this automatically).

How the calculator works step by step

The tool automates the algebraic steps you would normally do by hand:

  1. Model the function. You are working with (ax + b) / ((x − r₁)(x − r₂)). The inputs a, b, r₁, and r₂ define this function.
  2. Form the identity. The calculator sets up either (ax + b) = A(x − r₂) + B(x − r₁) (distinct roots) or the corresponding repeated-root identity.
  3. Expand and collect terms. It expands the right-hand side and groups coefficients of x and constants.
  4. Solve for A and B. From the grouped coefficients, it solves a 2×2 linear system to find A and B.
  5. Return the decomposition. The result is displayed as A / (x − r₁) + B / (x − r₂) or in repeated-root form when r₁ = r₂.

How to use the inputs

Near the form, you can think of the underlying function as (ax + b) / ((x − r₁)(x − r₂)):

Once you enter these values and click the button, the calculator computes and displays the corresponding A and B together with the decomposed expression.

Interpreting the results

The output has one of two standard forms:

In an integration context, these forms map directly to standard antiderivatives such as ∫(1 / (x − r)) dx = ln|x − r| and ∫(1 / (x − r)²) dx = −1 / (x − r) + C. In a Laplace-transform context, the coefficients tell you how to express a transfer function as a sum of simpler transform pairs.

Worked example (distinct roots)

Suppose you want to decompose (3x + 5) / ((x − 1)(x − 2)). Here

The identity is

3x + 5 = A(x − 2) + B(x − 1).

Expanding the right-hand side gives

A(x − 2) + B(x − 1) = (A + B)x + (−2A − B).

Equating coefficients of x and the constant term produces the system

Solving this system yields A = −8 and B = 11. Therefore,

(3x + 5) / ((x − 1)(x − 2)) = −8 / (x − 1) + 11 / (x − 2).

In the calculator, entering a = 3, b = 5, r₁ = 1, and r₂ = 2 will return the same decomposition automatically.

Worked example (repeated root)

Next, consider a repeated root example: (2x + 3) / (x − 4)². Here the denominator has a single root r = 4 of multiplicity 2, so

We seek A and B such that

(2x + 3) / (x − 4)² = A / (x − 4) + B / (x − 4)².

Multiplying by (x − 4)² yields

2x + 3 = A(x − 4) + B.

Expanding and collecting terms:

A(x − 4) + B = Ax − 4A + B.

Matching coefficients gives

Substituting A = 2 into the second equation yields −8 + B = 3, so B = 11. Thus,

(2x + 3) / (x − 4)² = 2 / (x − 4) + 11 / (x − 4)².

Setting r₁ = r₂ = 4 in the calculator reproduces this result and clearly labels the repeated-root case.

Comparison: manual work vs this calculator

Approach Best for Effort Scope
Manual algebra Learning the method; exam practice with a small number of simple fractions Requires expanding, collecting terms, and solving a 2×2 system Any suitable expression, but becomes tedious with many terms or more complicated denominators
This calculator Quick checks, homework verification, and routine problems of the form (ax + b) / ((x − r₁)(x − r₂)) Instant; you only enter a, b, r₁, and r₂ Limited to factored quadratic denominators with linear numerator
General CAS tools Large or complex expressions, higher-degree polynomials, and symbolic workflows Often more setup and a steeper learning curve than this focused tool Very broad; can handle unfactored denominators, complex roots, and higher degrees

When this calculator is most useful

You will typically use this partial fraction decomposition calculator in the following situations:

Assumptions and limitations

To keep the interface simple and fast, this calculator makes several intentional assumptions:

For expressions outside these bounds—such as higher-degree denominators, unfactored polynomials, or complex coefficients—you will generally need a more general computer algebra system or a more advanced partial fractions tool.

Typical follow-up steps

After obtaining the partial fraction decomposition, common next steps are:

Enter coefficients and roots.

Embed this calculator

Copy and paste the HTML below to add the Partial Fraction Decomposition Calculator - Split Rational Functions to your website.