PARTIAL FRACTIONS CALCULATOR

Partial fractions calculator

Type a numerator and a denominator: get the decomposition, the system for the constants and an exact check.

Use one letter, ^ for powers and write products as 2x or (x+1)(x−2)^2. Both boxes take polynomials with whole-number or decimal coefficients. The denominator must factor into linear and quadratic factors with rational coefficients.

What is partial fraction decomposition?

It rewrites a rational function P(x) ÷ Q(x) as a sum of simpler fractions whose denominators are the factors of Q(x). It undoes the addition of fractions: 2 ÷ (x − 3) − 1 ÷ (x + 2) adds up to (x + 7) ÷ (x² − x − 6), and decomposing (x + 7) ÷ (x² − x − 6) brings back the two pieces (OpenStax Algebra and Trigonometry 2e, section 11.4). The main use is integration: each simple piece has a known antiderivative, while the original fraction does not (OpenStax Calculus Volume 2, section 3.4). The method applies only when the degree of P is lower than the degree of Q; otherwise you divide first, as described below.

What form does each kind of factor take?

The form depends on the factorization of Q(x) (OpenStax Calculus Volume 2, section 3.4). A distinct linear factor (ax + b) gets one term A ÷ (ax + b). A repeated linear factor (ax + b)ⁿ gets n terms, A₁ ÷ (ax + b) + A₂ ÷ (ax + b)² + … + Aₙ ÷ (ax + b)ⁿ, with every power from 1 to n. An irreducible quadratic ax² + bx + c, one with no real zeros (b² − 4ac < 0), gets a linear numerator, (Ax + B) ÷ (ax² + bx + c), and a repeated one gets (A₁x + B₁) ÷ (…) + … + (Aₙx + Bₙ) ÷ (…)ⁿ. The calculator prints this form with letters before it solves for them, so you can compare it with your own setup.

Worked example: distinct linear factors

OpenStax Calculus Volume 2, Example 3.29: decompose (3x + 2) ÷ (x³ − x² − 2x). The denominator factors as x(x + 1)(x − 2), so the form is A/x + B/(x + 1) + C/(x − 2). Multiplying through by the denominator and comparing the coefficients of each power of x gives 3 equations: A + B + C = 0; −A − 2B + C = 3; −2A = 2. Solving them exactly gives A = −1, B = −1/3, C = 4/3, so the fraction equals −1/x − 1/(3(x + 1)) + 4/(3(x − 2)). The book finds the same three numbers, −1, 4/3 and −1/3, for the factors x, (x − 2) and (x + 1), and then integrates term by term to get −ln|x| + (4/3)ln|x − 2| − (1/3)ln|x + 1| + C.

What if the numerator is as big as the denominator?

Then the fraction is improper and polynomial long division comes first: P ÷ Q = A(x) + R(x) ÷ Q(x) with deg R < deg Q, and only R ÷ Q is decomposed (OpenStax Calculus Volume 2, Examples 3.28 and 3.30). For (x² + 3x + 1) ÷ (x² − 4), division gives quotient 1 and remainder 3x + 5, and the remainder fraction splits further, so the whole thing equals 1 + 11/(4(x − 2)) + 1/(4(x + 2)). The calculator shows the polynomial part separately and only then sets up the unknown constants. Common factors of numerator and denominator are cancelled before anything else: they do not change the value of the fraction and would only add terms whose constants are 0.

How are repeated and quadratic factors handled?

For a repeated linear factor every power appears. In Example 3.32, (x − 2) ÷ ((2x − 1)²(x − 1)) becomes 2/(2x − 1) + 3/(2x − 1)² − 1/(x − 1): the factor (2x − 1) has both the first and the second power. For an irreducible quadratic the numerator is linear: (2x − 3) ÷ (x³ + x) = −3/x + (3x + 2)/(x² + 1) (Example 3.33). A numerator constant of 0 is allowed, and zero terms are left out: x³ ÷ (x² + 1)² equals x/(x² + 1) − x/(x² + 1)² (Example 3.35, where the second numerator constants are 0 and −1). Algebra and Trigonometry 2e, Example 4, has both kinds at once: (x⁴ + x³ + x² − x + 1) ÷ (x(x² + 1)²) = 1/x + 1/(x² + 1) − (x + 2)/(x² + 1)². The calculator reproduces all of these.

Which denominators can the calculator factor?

It needs Q(x) to factor over the rational numbers into linear and quadratic factors, which is what textbook exercises assume. It first splits Q into factors without repeats, then finds every rational root with the rational root theorem, and then looks for quadratic factors with whole-number coefficients that remain. A quadratic with no rational root is irreducible over the rationals; if its discriminant is negative it also has no real roots, and if it is positive but not a perfect square its roots are irrational, as for x² − 2, which stays as one factor. Some quartics split into quadratics: x⁴ + 4 becomes (x² − 2x + 2)(x² + 2x + 2), and its decomposition is −(x − 2)/(8(x² − 2x + 2)) + (x + 2)/(8(x² + 2x + 2)). A factor such as x³ − 2 or x⁴ + 1 (the second only factors with irrational coefficients) is refused with an explanation, and the denominator’s degree may not exceed 10.

How can I check that the answer is right?

Recombine the fractions, as OpenStax advises: put the pieces over a common denominator and compare with the original numerator. This calculator does it for you with exact fractions, no rounding, at three rational values of x, and prints both sides; it refuses to show a decomposition whose two sides differ. For the example above, the original fraction −52/15 at x = 3/2 equals the sum of the pieces −52/15. You can also pick any value of x that is not a root of the denominator and test it by hand.

Common mistakes

Forgetting the long division when the degree of the numerator is not below the degree of the denominator. Leaving out the lower powers of a repeated factor: (x − 2)² needs both A ÷ (x − 2) and B ÷ (x − 2)². Putting a constant over an irreducible quadratic instead of Ax + B. Not factoring the denominator completely, for example leaving x² − 4 or x³ − x as one block. Treating a quadratic as irreducible when it has real roots (check the discriminant). And sign slips when equating coefficients, which is why an exact solver and a check at test points help. Once you have the pieces, the integral calculator can integrate them.

Sources: OpenStax, Calculus Volume 2, section 3.4 “Partial Fractions” (Examples 3.28–3.35 and the problem-solving strategy); OpenStax, Algebra and Trigonometry 2e, section 11.4 “Partial Fractions” (Examples 1–4). Related: polynomial calculator (long division), equation solver (roots of the denominator), integral calculator, synthetic division calculator and derivative calculator.