A simple yet useful trick, partial fraction decomposition can simplify a complex rational expression by converting it into a sum of simple fractions. In that way, integration, inverse Laplace transforms, and simplification of algebra are much easier.
The calculator operates as explained below; a comprehensive worked example with your input is shown, there are special cases (repeated factors, improper fractions, irreducible quadratics) and hints on understanding the Fraction and Decimal output forms.
🔢 Partial Fraction Decomposition Calculator
Enter a rational function to decompose it into partial fractions.
What the calculator expects (input format)
-
Numerator (N(x)) — a polynomial, e.g.
x^2 + 3x + 2. -
Denominator (D(x)) — another polynomial, e.g.
x^3 - x^2 - 4x + 4. -
Output format — choose Fraction (exact symbolic decomposition) or Decimal (numeric values for coefficients).
Make sure to enter polynomials in standard algebraic form. The calculator will:
-
Numerator Check degree numerator less than degree denominator.
-
Otherwise, do a long division of the polynomials.
-
Factor and then attempt to set up the appropriate partial-fraction template and solve equations to get coefficients, provided that these factors are over the reals (when possible).
-
Output fraction form (symbolic), or rounded off decimal form (coefficients).
Quick refresher: When and why use partial fractions
Partial fraction decomposition rewrites
N(x)D(x)\frac{N(x)}{D(x)}
as a combination of other simpler terms such as Ax−a,distribution of Ax/x-a,x−aA, B(x−a)2,distribution of B/x-a, B(x-a)2, B or Cx+Dx2,bx+c,distribution of Cx+D. This is handy as every simple term can be readily incorporated/inverted in transforms.
Use it when you:
-
Need to integrate rational functions ∫N(x)D(x) dx\int \frac{N(x)}{D(x)}\,dx.
-
Want to perform inverse Laplace transforms.
-
Need a simplified symbolic form for algebra or partial simplification.
Worked example (your exact input)
Input
-
Numerator N(x)=x2+3x+2N(x) = x^2 + 3x + 2
-
Denominator D(x)=x3−x2−4x+4D(x) = x^3 – x^2 – 4x + 4
-
Output format: Fraction (and we’ll also show Decimal)
Step 1 — Check properness
Degree of numerator = 2, degree of denominator = 3 → already a proper rational function. No polynomial division required.
Step 2 — Factor the denominator
Factor x3−x2−4x+4x^3 – x^2 – 4x + 4.
Group terms:
x2(x−1)−4(x−1)=(x−1)(x2−4)=(x−1)(x−2)(x+2).x^2(x-1)-4(x-1)=(x-1)(x^2-4)=(x-1)(x-2)(x+2).
So the denominator factors into three distinct linear factors: (x−1)(x−2)(x+2)(x-1)(x-2)(x+2).
Step 3 — Set up partial fraction form
Because these are distinct linear factors, the decomposition has this form:
x2+3x+2(x−1)(x−2)(x+2)=Ax−1+Bx−2+Cx+2.\frac{x^2+3x+2}{(x-1)(x-2)(x+2)}=\frac{A}{x-1}+\frac{B}{x-2}+\frac{C}{x+2}.
Step 4 — Solve for coefficients
Divide both sides by the denominator: x2+3x+2 = A(x12-2)(x+2) + B(x12-1)(x+2) + C(x12-1)(x12-2).x2+3x+ 2= A(x-2)X +2 + B(x-1)X +2 + C(x-1)X +2.
Plug in convenient xx-values (the roots) to solve quickly:
-
x=1: 1+3+2=6=A(1−2)(1+2)=A(−1)(3)=−3A⇒A=−2.x=1:\; 1+3+2=6 = A(1-2)(1+2)=A(-1)(3)=-3A \Rightarrow A=-2.
-
x=2: 4+6+2=12=B(2−1)(2+2)=4B⇒B=3.x=2:\; 4+6+2=12 = B(2-1)(2+2)=4B \Rightarrow B=3.
-
x=−2: 4−6+2=0=C(−2−1)(−2−2)=12C⇒C=0.x=-2:\; 4-6+2=0 = C(-2-1)(-2-2)=12C \Rightarrow C=0.
So the decomposition is
x2+3x+2×3−x2−4x+4=−2x−1+3x−2+0x+2\boxed{\frac{x^2+3x+2}{x^3-x^2-4x+4}=-\frac{2}{x-1}+\frac{3}{x-2}+\frac{0}{x+2}}
The term with CC vanishes, so in simplified form:
−2x−1+3x−2.-\frac{2}{x-1}+\frac{3}{x-2}.
Fraction output (exact):
−2x−1+3x−2.-\dfrac{2}{x-1}+\dfrac{3}{x-2}.
Decimal output (coefficients as decimals):
A=−2.0, B=3.0, C=0.0A=-2.0,\; B=3.0,\; C=0.0, so the same expression numerically:
−2.0x−1+3.0x−2.-\frac{2.0}{x-1} + \frac{3.0}{x-2}.
Integration example (bonus)
One common use is integration:
∫x2+3x+2×3−x2−4x+4 dx=∫(−2x−1+3x−2) dx=−2ln∣x−1∣+3ln∣x−2∣+C.\int \frac{x^2+3x+2}{x^3-x^2-4x+4}\,dx = \int\left(-\frac{2}{x-1}+\frac{3}{x-2}\right)\,dx = -2\ln|x-1| + 3\ln|x-2| + C.
Special cases the calculator handles
-
Improper fractions (degree numerator ≥ degree denominator)
-
The calculator first performs polynomial long division:
N(x)D(x)=Q(x)+R(x)D(x),\frac{N(x)}{D(x)} = Q(x) + \frac{R(x)}{D(x)},
then decomposes the proper remainder R(x)D(x)\frac{R(x)}{D(x)}.
-
-
Repeated linear factors (e.g. (x−a)2(x-a)^2)
-
Template becomes:
Ax−a+B(x−a)2+⋯\frac{A}{x-a} + \frac{B}{(x-a)^2} + \cdots
with terms up to the repeated power.
-
-
Irreducible quadratic factors (e.g. x2+1x^2+1 that doesn’t factor over reals)
-
Template uses linear numerators:
Cx+Dx2+1.\frac{Cx+D}{x^2+1}.
-
-
Complex roots / nonreal factorization
-
For real-valued outputs the calculator keeps irreducible quadratic blocks with linear numerators (real partial fractions). If asked, a complex decomposition can be done but most users want real partial fractions.
-
-
Symbolic vs numeric
-
Fraction mode yields coefficient ratios that are precise fractions (e.g. −2-2−2, 333, 12\tfrac1221).
-
Decimal mode gives floating-points approximations (e.g. -2.0000-2.0000-2.0000, 3.00003.00003.0000) as rounded off.
-
Tips for entering polynomials
-
Use
xas the variable, no spaces required but they’re fine:x^3-x^2-4x+4. -
For coefficients:
-2x^2or-2*x^2both work (calculator accepts standard algebraic notation). -
If the numerator is improper, don’t worry — you can still paste it; the tool will divide automatically.
-
If the denominator doesn’t factor nicely over reals, choose Fraction mode to get symbolic linear-over-quadratic pieces, or Decimal to see numeric coefficients.
Applications in calculus, ODEs, and engineering
-
Integration. Once decomposed, each term integrates to a simple logarithm or arctan form.
-
Inverse Laplace transforms. The transform of rational functions is handled using partial fractions to match transform tables.
-
Control theory / signal processing. Transfer functions often decompose into simple poles for stability analysis.
-
Algebraic simplification. Rewriting rational functions as a sum of simpler terms clarifies behavior near poles.
Common pitfalls and how the calculator avoids them
-
Forgetting to divide when numerator degree ≥ denominator degree. The calculator does this automatically.
-
Assuming distinct linear factors when there are repeats. The correct form is inferred from factor multiplicity.
-
Rounding too aggressively in Decimal mode. Use Fraction mode for exactness; use higher precision if you need numeric approximations.
Frequently asked questions (short)
Q: What if my denominator won’t factor nicely?
A: The tool leaves irreducible quadratics as linear numerators over those quadratics (real decomposition). For complex roots you can request complex coefficients.
Q: Can the calculator show step-by-step work?
A: Some implementations show factoring, substitution, and solving steps. If you need step-by-step, choose the verbose or steps option (if available).
Q: How accurate is Decimal output?
A: Decimal output is as accurate as the chosen rounding precision—use Fraction mode for exact symbolic results.
Q: Will the calculator integrate the result for me?
A: Many calculators offer integration of the decomposed terms. If present, you’ll get ∫\int results like −2ln∣x−1∣+3ln∣x−2∣+C-2\ln|x-1|+3\ln|x-2|+C.
Closing thoughts
Partial fraction decomposition transforms a single complicated rational expression into a handful of tidy terms you can integrate, invert, or analyze easily. Your provided example,
x2+3x+2×3−x2−4x+4,\frac{x^2+3x+2}{x^3-x^2-4x+4},
decomposes cleanly to
−2x−1+3x−2,-\frac{2}{x-1}+\frac{3}{x-2},
which is about as elegant and useful as partial fractions get.
If you want, I can also:
-
Produce a step-by-step printable PDF of the decomposition for that example, or
-
Provide code snippets (Python / SymPy) that reproduce the calculator’s logic, or
-
Generate a short video script showing how to enter the polynomials and interpret Fraction vs Decimal output.
Check out more: Blox Fruit Calculator – EXP, Level & Time Estimator Tool
