Partial fraction decomposition solver
Type a rational function such as (3x + 2)/(x^3 - x^2 - 2x). The page writes it as a sum of simpler fractions, the form you need to integrate it, and checks the sum equals your fraction.
- Partial fractions
- 4/(3 (x - 2)) - 1/(3 (x + 1)) - 1/x
The partial fraction decomposition of (3x + 2)/(x^3 - x^2 - 2x) is 4/(3 (x - 2)) - 1/(3 (x + 1)) - 1/x.
Partial fractions: 4/(3 (x - 2)) - 1/(3 (x + 1)) - 1/x. The partial fraction decomposition of (3x + 2)/(x^3 - x^2 - 2x) is 4/(3 (x - 2)) - 1/(3 (x + 1)) - 1/x.
How to calculate
Splits a ratio of polynomials into partial fractions, checking their sum.
Example with the default inputs (Rational function (3x + 2)/(x^3 - x^2 - 2x)): The partial fraction decomposition of (3x + 2)/(x^3 - x^2 - 2x) is 4/(3 (x - 2)) - 1/(3 (x + 1)) - 1/x.
Method: A computer algebra system finds the partial fractions; they show only when their sum equals the fraction at 20 points.
- The denominator is factored over the rationals.
- An answer that fails its check is not shown.
Worked examples
Each example is checked against the calculator on every build.
- Rational function (3x + 2)/(x^3 - x^2 - 2x) gives Partial fractions 4/(3 (x - 2)) - 1/(3 (x + 1)) - 1/x.Source: OpenStax Calculus Vol. 2, 3.4, Ex. 3.29. https://openstax.org/books/calculus-volume-2/pages/3-4-partial-fractions
- Rational function (x^2 + 3x + 1)/(x^2 - 4) gives Partial fractions 1 + 1/(4 (x + 2)) + 11/(4 (x - 2)).
- Rational function (2x - 3)/(x (x^2 + 1)) gives Partial fractions (3x + 2)/(x^2 + 1) - 3/x.
How it works
The partial fraction decomposition calculator takes a rational function P(x)/Q(x) and writes it as a polynomial part plus a sum of fractions whose denominators are the factors of Q. A computer algebra system (nerdamer, open source) factors Q over the rational numbers and finds the numerators. The algebra runs after you start typing, in the background.
For each factor of the denominator:
- a linear factor (ax + b) gives A/(ax + b);
- a repeated linear factor (ax + b)ᵏ gives A₁/(ax + b) + A₂/(ax + b)² + … + Aₖ/(ax + b)ᵏ;
- a quadratic factor with no rational root, such as x² + 1, gives (Bx + C)/(x² + 1), and a repeated one a term for each power.
When the degree of P is at least the degree of Q, the polynomial part (the quotient of long division) comes first.
Every answer is checked before it is shown. The sum must equal your function at 20 points where both are real numbers (fixed pseudo-random numbers, mostly between −4 and 4), to 1 part in 10⁹. Then every factor of the denominator gets one fraction: the terms over the same factor q (with any whole-number factor k in front, as in 3x/(4 (x² + 4)) and 3/(x² + 4)) are joined over the least common multiple of their k, so 3x/(4 (x² + 4)) + 3/(x² + 4) becomes (3x + 12)/(4 (x² + 4)). The joined form is checked again at 15 points. A result that fails is never shown; the page says "No verified answer" instead.
What you can type
- A ratio of two polynomials in one lowercase letter, with brackets around the top and the bottom: (3x + 2)/(x^3 - x^2 - 2x). Sums of such fractions are fine too: they are first written as one fraction, so 1/(x² − 1) + 1/(x + 1) gives 1/(2 (x − 1)) + 1/(2 (x + 1)). A polynomial alone is its own decomposition.
- Whole-number powers of the letter, and numeric coefficients (fractions and decimals allowed). The letter e is Euler’s number.
- Not allowed: a fractional power of the letter (sqrt(x)) or a function of it (sin(x), ln(x)). Such input gets no answer, and so does input with two different letters.
How answers are written
- The decomposition is a sum in the syntax you type: the polynomial part first, highest power first, then the fractions in the order the algebra finds them.
- Each numerator is exact: a number, or a linear term such as 3x + 2 over a quadratic factor. A number that divides the whole fraction is written in the denominator:
4/(3 (x - 2))means (4/3)/(x − 2). - Denominators are the factors of Q as the algebra writes them, terms highest power first: (x + 2), (2x − 1)^2, (x^2 + 2x + 4).
- A fraction with nothing to split (1/(x² + 1)) is shown unchanged.
Assumptions
- The denominator is factored over the rational numbers only, by the algebra. A factor of degree 4 or more can be left whole even when it splits further over the rationals: in 1/(x⁶ − 64) the factor x⁴ + 4x² + 16 = (x² − 2x + 4)(x² + 2x + 4) stays whole and gets a numerator of degree up to 3. The sum is still exactly your function.
- An answer that fails its check, finds no decomposition, or takes over 3 seconds is not shown ("No verified answer").
Worked examples by hand
(3x + 2)/(x³ − x² − 2x) (OpenStax Calculus Volume 2, section 3.4, Example 3.29). The denominator is x(x − 2)(x + 1), so write 3x + 2 = A(x − 2)(x + 1) + Bx(x + 1) + Cx(x − 2). At x = 0: 2 = −2A, so A = −1. At x = 2: 8 = 6B, so B = 4/3. At x = −1: −1 = 3C, so C = −1/3. The result is 4/(3(x − 2)) − 1/(3(x + 1)) − 1/x.
(x² + 3x + 1)/(x² − 4) (OpenStax Calculus Volume 2, section 3.4, Example 3.30). The degrees are equal, so divide first: (x² + 3x + 1)/(x² − 4) = 1 + (3x + 5)/((x − 2)(x + 2)). Then 3x + 5 = A(x + 2) + B(x − 2). At x = 2: 11 = 4A; at x = −2: −1 = −4B. So the result is 1 + 1/(4(x + 2)) + 11/(4(x − 2)).
(2x − 3)/(x(x² + 1)) (OpenStax Calculus Volume 2, section 3.4, Example 3.33). Write 2x − 3 = A(x² + 1) + (Bx + C)x. At x = 0: A = −3. Comparing x² terms: 0 = A + B, so B = 3; comparing x terms: 2 = C. The result is (3x + 2)/(x² + 1) − 3/x.
Other questions people ask
What is partial fraction decomposition?
Writing a ratio of polynomials P(x)/Q(x) as a sum of simpler fractions, one for each factor of the denominator Q. For example (3x + 2)/(x³ − x² − 2x) = −1/x + (4/3)/(x − 2) − (1/3)/(x + 1). It reverses adding fractions over a common denominator.
Why is it used?
Mostly to integrate rational functions: each simple fraction has a standard integral. ∫ 1/(x − 2) dx = ln|x − 2| + C, while the original fraction has no obvious antiderivative. It is also used for inverse Laplace transforms and to sum some series.
What if the top has a higher degree than the bottom?
Then the fraction is improper, and a polynomial part comes first, found by long division. (x² + 3x + 1)/(x² − 4) = 1 + (3x + 5)/(x² − 4), and the remainder then splits into 1/(4(x + 2)) + 11/(4(x − 2)).
What happens with a repeated or quadratic factor?
A repeated linear factor (x − a)ᵏ gets one fraction for each power from 1 to k: A/(x − a) + B/(x − a)² + …. A quadratic factor with no real root, such as x² + 1, gets a fraction with a linear top: (Bx + C)/(x² + 1).
Why is x² − 2 in my denominator not split?
The denominator is factored over the rational numbers. x² − 2 = (x − √2)(x + √2) needs √2, so it stays whole and is treated like x² + 1, with a linear numerator.
What does "No verified answer" mean?
The fractions are added back up, in effect: the page compares their sum with your function at 20 points. If they differ, if no decomposition is found, or if the work takes over 3 seconds, the page says "No verified answer" instead.