Fraction Decomposition Calculator
Enter any rational function P(x)/Q(x) and get the complete partial fraction decomposition — factored denominator, classified roots, residue-solved constants, and full step-by-step working for all three cases: distinct roots, repeated roots, and irreducible quadratic factors.
⚠️ Use * for multiplication, ^ for powers, parentheses for grouping.
Denominator must have degree ≥ 1. For improper fractions the calculator performs long division automatically.
Partial Fraction Decomposition
Use This Result in Inverse Laplace Transforms
Partial fraction decomposition is the core step in computing inverse Laplace transforms. Once decomposed into simple fractions, each term maps directly to a known Laplace table entry — e^(at), sin(ωt), cos(ωt).
Inverse Laplace Transform Calculator →Integrate This Result
Partial fractions are essential for integrating rational functions. Each simple fraction integrates directly: A/(x−r) → A·ln|x−r|, A/(x−r)ⁿ → closed form, (Ax+B)/(x²+bx+c) → arctan form.
Antiderivative Calculator →When Q(x) has n distinct (non-repeating) real roots r₁, r₂, …, rₙ — that is, Q(x) = (x−r₁)(x−r₂)···(x−rₙ) — the decomposition takes one term per root:
Residue formula (fastest method): Aₖ = P(rₖ) / Q'(rₖ) — multiply both sides by (x−rₖ) and substitute x = rₖ.
Example: 1/(x²−1) = 1/[(x−1)(x+1)]
A = lim(x→1) [(x−1)·1/(x−1)(x+1)] = 1/2 | B = lim(x→−1) [(x+1)·1/(x−1)(x+1)] = −1/2
Result: 1/(2(x−1)) − 1/(2(x+1))
When (x−r) appears with multiplicity n in Q(x), you need n separate terms — one for each power from 1 to n:
Find Aₙ first (the highest power): multiply both sides by (x−r)ⁿ and set x = r. Then differentiate both sides and substitute x = r to find Aₙ₋₁, and so on.
Example: x/(x+2)² = x/(x²+4x+4)
Multiply by (x+2)²: x = A(x+2) + B → B = −2 (x=−2), A = 1 (coeff of x)
Result: 1/(x+2) − 2/(x+2)²
When Q(x) contains a factor x²+bx+c with discriminant b²−4c < 0 (no real roots), you cannot factor further over the reals. Use a linear numerator Ax+B for that term:
Find A by residue at x = r. Then clear denominators and equate coefficients to find B and C.
Integration: ∫(Bx+C)/(x²+bx+c) dx → complete the square → arctan form.
Laplace connection: (Bx+C)/(s²+ω²) ↔ B·cos(ωt) + (C/ω)·sin(ωt)
If deg(P) ≥ deg(Q), the fraction is improper. First perform polynomial long division:
The remainder has lower degree than Q(x), so it can be decomposed normally. The quotient integrates as a polynomial directly.
Example: x³/(x²−1) = x + x/(x²−1) = x + 1/(2(x−1)) − 1/(2(x+1))
Mixed denominators: When Q(x) has distinct roots, repeated roots AND an irreducible quadratic, apply all three cases simultaneously. Equate coefficients to solve the full linear system.
What Is Partial Fraction Decomposition?
This fraction decomposition calculator computes the complete partial fraction decomposition of any rational function P(x)/Q(x), showing the factored denominator, classified roots, solved constants via the residue method, and verified final result.
Partial fraction decomposition (also called fraction decomposition or partial fraction expansion) is an algebraic technique that rewrites a complex rational function as a sum of simpler fractions — each with a linear or irreducible quadratic denominator. It is the algebraic inverse of adding fractions with different denominators.
The technique is fundamental to two major areas of mathematics:
- Integration of rational functions: Every rational function can be integrated once decomposed — each partial fraction integrates to a logarithm, power, or arctangent.
- Inverse Laplace transforms: Nearly every inverse Laplace transform uses partial fractions to break F(s) into table-lookup entries. See our Inverse Laplace Transform Calculator which uses this exact engine.
Key prerequisite — proper fraction: Partial fractions only work directly when deg(P) < deg(Q). If deg(P) ≥ deg(Q), divide first using polynomial long division to get a polynomial remainder, then decompose the remainder.
Step-by-Step Method for Partial Fraction Decomposition
Follow these five steps systematically to decompose any rational function:
- Check the degree: If deg(P) ≥ deg(Q), perform long division first. Work with the remainder only.
- Factor the denominator Q(x): Factor completely into linear factors (x−r) and irreducible quadratic factors (x²+bx+c with b²−4c < 0).
- Write the decomposition template: Assign A/(x−r) for each distinct linear factor, A₁/(x−r)+A₂/(x−r)² for repeated factors, and (Ax+B)/(x²+bx+c) for irreducible quadratics.
- Solve for the constants: Clear the denominators (multiply both sides by Q(x)), then either substitute roots (residue method) or expand and equate coefficients.
- Verify: Recombine the partial fractions by adding them back. The result must equal the original P(x)/Q(x).
Complete Worked Example: (2x+3)/(x²−1)
- Check degree: deg(2x+3) = 1 < deg(x²−1) = 2 ✓ (proper — no long division needed)
- Factor denominator: x²−1 = (x−1)(x+1), roots: r₁ = 1 (distinct), r₂ = −1 (distinct)
- Template: (2x+3)/[(x−1)(x+1)] = A/(x−1) + B/(x+1)
- Residues:
A = lim(x→1) [(x−1)·(2x+3)/((x−1)(x+1))] = (2+3)/(1+1) = 5/2
B = lim(x→−1) [(x+1)·(2x+3)/((x−1)(x+1))] = (−2+3)/(−1−1) = −1/2 - Result: (5/2)/(x−1) + (−1/2)/(x+1)
- Verify: (5/2)(x+1) + (−1/2)(x−1) = (5x/2+5/2) + (−x/2+1/2) = 4x/2 + 6/2 = 2x+3 ✓
The Three Cases — Distinct, Repeated, and Irreducible Quadratic Factors
Case 1: Distinct Linear Factors
This is the simplest and most common case. Every root of Q(x) is different, and all roots are real. The residue formula gives each constant directly without any system of equations.
Example: (2x+1)/((x−1)(x+2)(x−3))
- Three distinct roots: r₁=1, r₂=−2, r₃=3
- A = (2·1+1)/((1+2)(1−3)) = 3/(3·(−2)) = −1/2
- B = (2·(−2)+1)/((−2−1)(−2−3)) = −3/((−3)(−5)) = −1/5
- C = (2·3+1)/((3−1)(3+2)) = 7/(2·5) = 7/10
- Result:
−1/(2(x−1)) − 1/(5(x+2)) + 7/(10(x−3))
Case 2: Repeated Linear Factors
A root r of multiplicity n requires n terms. The "cover-up" residue method gives the coefficient of the highest power 1/(x−r)ⁿ directly. Lower-power coefficients require differentiation or equating coefficients.
Example: 3/(x(x+1)²)
- Roots: r₁=0 (multiplicity 1), r₂=−1 (multiplicity 2)
- Template: A/x + B/(x+1) + C/(x+1)²
- Multiply by x(x+1)²: 3 = A(x+1)² + Bx(x+1) + Cx
- x=0: 3 = A(1)² → A = 3
- x=−1: 3 = C(−1) → C = −3
- Equate x² coefficients: 0 = A+B → B = −3
- Result:
3/x − 3/(x+1) − 3/(x+1)²
Case 3: Irreducible Quadratic Factors
An irreducible quadratic x²+bx+c (where b²−4c < 0) contributes a linear numerator Ax+B, not just a constant. This is where the "completing the square" technique is needed for subsequent integration, and where Laplace transforms yield sine and cosine terms.
Example: (x²+1)/(x³−x) = (x²+1)/(x(x−1)(x+1))
- All roots distinct and real: r₁=0, r₂=1, r₃=−1
- A = (0+1)/(0−1)(0+1) = 1/(−1) = −1
- B = (1+1)/(1·(1+1)) = 2/2 = 1
- C = (1+1)/((−1)(−1−1)) = 2/(−1·−2) = 1
- Result:
−1/x + 1/(x−1) + 1/(x+1)
Example with True Irreducible Quadratic: 1/((x−1)(x²+1))
- x²+1 has discriminant 0−4 = −4 < 0 — irreducible over reals
- Template: A/(x−1) + (Bx+C)/(x²+1)
- A = 1/(1²+1) = 1/2 (residue at x=1)
- Clear denominators: 1 = A(x²+1) + (Bx+C)(x−1)
- Equate x² coeff: 0 = A+B → B = −1/2
- Equate x⁰ coeff: 1 = A−C → C = A−1 = −1/2
- Result:
1/(2(x−1)) + (−x/2 − 1/2)/(x²+1) - Integration: ∫result dx = (1/2)ln|x−1| − (1/4)ln(x²+1) − (1/2)arctan(x) + C
Partial Fraction Decomposition and Integration
Once a rational function is decomposed, each term integrates using one of these standard forms. This is why partial fractions are the gateway to integrating all rational functions — use our Antiderivative Calculator to verify each integral term.
| Partial Fraction Term | ∫ (term) dx | Condition |
|---|---|---|
| A/(x−r) | A·ln|x−r| + C | Distinct linear |
| A/(x−r)² | −A/(x−r) + C | Repeated (n=2) |
| A/(x−r)ⁿ | −A/((n−1)(x−r)ⁿ⁻¹) + C | Repeated (n≥2) |
| (Ax+B)/(x²+k²) | (A/2)ln(x²+k²) + (B/k)arctan(x/k) + C | Irred. quadratic |
| 1/(x²+bx+c) | Complete the square → arctan form | Irred. quadratic |
Partial Fraction Decomposition and Inverse Laplace Transforms
Partial fraction decomposition is the most important computational technique in Laplace transform theory. When solving differential equations via Laplace transforms, the solution appears as a rational function of s. Decomposing it exposes individual table-lookup entries.
Key Laplace table entries after partial fraction decomposition:
A/(s−a) → A·eᵃᵗ | A/(s−a)² → A·t·eᵃᵗ | ω/(s²+ω²) → sin(ωt) | s/(s²+ω²) → cos(ωt)
Inverse Laplace Example: F(s) = (2s+3)/(s²−1)
- Decompose: (2s+3)/((s−1)(s+1)) = (5/2)/(s−1) + (−1/2)/(s+1)
- Laplace table: (5/2)/(s−1) → (5/2)eᵗ and (−1/2)/(s+1) → (−1/2)e⁻ᵗ
- Result: f(t) = (5/2)eᵗ − (1/2)e⁻ᵗ
→ Try this in our Inverse Laplace Transform Calculator
Common Mistakes in Fraction Decomposition
Mistake 1 — Using a Constant for an Irreducible Quadratic
- ❌ Wrong: 1/((x−1)(x²+1)) = A/(x−1) + B/(x²+1)
- ✅ Correct: A/(x−1) + (Bx+C)/(x²+1) — linear numerator required
Mistake 2 — Missing Terms for Repeated Roots
- ❌ Wrong: 1/(x(x+1)²) = A/x + B/(x+1)²
- ✅ Correct: A/x + B/(x+1) + C/(x+1)² — need ALL powers from 1 to n
Mistake 3 — Not Checking Degree First
- ❌ Wrong: directly decomposing x³/(x²−1)
- ✅ Correct: divide first → x + x/(x²−1) → then decompose x/(x²−1)
Mistake 4 — Arithmetic Error in Residue Calculation
- Always substitute the root into P(x)/[Q(x)/(x−r)], not into Q(x) alone
- Double-check by recombining the partial fractions at the end
Mistake 5 — Treating a Factorable Quadratic as Irreducible
- ❌ Wrong: treating (x²−1) as irreducible → writing (Ax+B)/(x²−1)
- ✅ Correct: b²−4c = 0−(−4) = 4 > 0, so x²−1 = (x−1)(x+1) — distinct real roots
- Always check the discriminant: b²−4c. If < 0 → irreducible. If ≥ 0 → factor further.
Worked Examples — Full Decomposition Solutions
1. 1/(x(x+1)) — Two distinct roots
- Roots: r₁=0, r₂=−1
- A = 1/(0+1) = 1 | B = 1/(−1) = −1
- Answer: 1/x − 1/(x+1)
- Check: (x+1−x)/(x(x+1)) = 1/(x(x+1)) ✓
2. 1/(x²(x+1)) — Repeated root at 0
- Template: A/x + B/x² + C/(x+1)
- Multiply by x²(x+1): 1 = Ax(x+1) + B(x+1) + Cx²
- x=0: B=1 | x=−1: C=1
- x² coeff: 0 = A+C → A=−1
- Answer: −1/x + 1/x² + 1/(x+1)
3. (x+1)/(x²+x+1) — Pure irreducible quadratic
- Discriminant: 1−4 = −3 < 0 → irreducible, no real roots
- Template: (Ax+B)/(x²+x+1)
- This IS already a partial fraction — degree 1 over degree 2, cannot factor further
- For integration: complete the square → x²+x+1 = (x+1/2)²+3/4 → arctan form
- Answer: Already in simplest form — (x+1)/(x²+x+1)
4. (x²+1)/(x³−x) = (x²+1)/(x(x−1)(x+1))
- A = (0+1)/(0)(something) — use residue properly: multiply by x, set x=0: A = (0+1)/((0−1)(0+1)) = 1/(−1) = −1
- B = (1+1)/((1)(1+1)) = 2/2 = 1
- C = (1+1)/((−1)(−1−1)) = 2/2 = 1
- Answer: −1/x + 1/(x−1) + 1/(x+1)
Frequently Asked Questions
Related Calculators
ℒ⁻¹
Inverse Laplace Transforms
Partial fraction decomposition is the core step. Decompose F(s), then look up each term in the Laplace table.
Open Calculator∫
Integrate the Result
Use partial fractions to split, then integrate each term with our Antiderivative Calculator.
Antiderivative CalcShare This Tool
Share the Fraction Decomposition Calculator!