Partial Fractions Calculator

This partial fractions calculator decomposes a rational function such as (x + 5)/(x² + x − 2) into simple fractions: 2/(x − 1) − 1/(x + 2). It handles distinct, repeated and irreducible quadratic factors, does polynomial long division first when the fraction is improper, and checks the answer by recombining it.

Result

Enter values and press Calculate to see the result.

Formula

P(x)(x−a)(x−b)=Ax−a+Bx−b\frac{P(x)}{(x - a)(x - b)} = \frac{A}{x - a} + \frac{B}{x - b}

Distinct linear factors: one constant over each factor.

P(x)(x−a)2=Ax−a+B(x−a)2\frac{P(x)}{(x - a)^2} = \frac{A}{x - a} + \frac{B}{(x - a)^2}

A repeated factor gets one term for each power.

P(x)(x−a)(x2+px+q)=Ax−a+Bx+Cx2+px+q\frac{P(x)}{(x - a)(x^2 + px + q)} = \frac{A}{x - a} + \frac{Bx + C}{x^2 + px + q}

An irreducible quadratic factor gets a linear numerator Bx + C.

How to use this calculator

  1. Type the numerator and the denominator as polynomials, e.g. x + 5 and x^2 + x - 2.
  2. Press Calculate. The calculator divides first if the numerator’s degree is not smaller, factors the denominator, and solves for the unknown numerators.
  3. Read the decomposition and the steps; the check multiplies everything back together.

Worked examples

Easy: two distinct linear factors

Factor the denominator: x² + x − 2 = (x + 2)(x − 1).

Write (x + 5)/((x + 2)(x − 1)) = A/(x + 2) + B/(x − 1), so x + 5 = A(x − 1) + B(x + 2).

x = 1 gives 6 = 3B, so B = 2; x = −2 gives 3 = −3A, so A = −1.

Answer: −1/(x + 2) + 2/(x − 1).

Medium: a repeated factor

The denominator is (x + 1)², so use A/(x + 1) + B/(x + 1)².

3x + 5 = A(x + 1) + B. Comparing x terms: A = 3; constants: 3 + B = 5, so B = 2.

Answer: 3/(x + 1) + 2/(x + 1)².

Hard: a quadratic factor

Factor: x³ + x = x(x² + 1), and x² + 1 has no real roots, so it gets a numerator Bx + C.

2x² + 3 = A(x² + 1) + (Bx + C)x. x = 0 gives A = 3.

Then 2x² + 3 = (3 + B)x² + Cx + 3, so B = −1 and C = 0.

Answer: 3/x − x/(x² + 1).

Improper fraction: divide first

The numerator’s degree is not smaller, so divide: x³ = x(x² − 1) + x, giving x + x/(x² − 1).

x/((x + 1)(x − 1)) = A/(x + 1) + B/(x − 1): x = 1 gives B = 1/2 and x = −1 gives A = 1/2.

Answer: x + 1/(2(x + 1)) + 1/(2(x − 1)).

Common mistakes

  • Skipping long division: if the numerator’s degree is not smaller than the denominator’s, divide first.
  • Using only one term for a repeated factor: (x + 1)² needs both A/(x + 1) and B/(x + 1)².
  • Giving a quadratic factor a constant numerator: it needs Bx + C.
  • Not factoring the denominator completely before setting up the terms.

Frequently asked questions

What is partial fraction decomposition?

Rewriting one rational function as a sum of simpler fractions whose denominators are the factors of the original denominator. It is used to integrate rational functions and in Laplace transforms.

How do I find the constants A and B?

Multiply both sides by the denominator, then either substitute the roots of each factor (the cover-up method) or compare coefficients. The calculator solves the coefficient equations exactly.

Which denominators can this calculator handle?

Any polynomial up to degree 6 that factors into linear factors with rational roots (repeated or not) and at most one irreducible quadratic factor. It says so when a denominator falls outside that.

How is the answer checked?

All the fractions are multiplied back over the common denominator, and the new numerator must equal yours exactly.

Learn more