Algebra

Partial Fractions Calculator

Enter a rational expression P(x)/Q(x) where Q is a quadratic. The calculator finds the roots of the denominator and uses them to split the fraction into the sum of two simpler fractions. The discriminant decides whether the result is two real ln-style fractions, a repeated-root fraction, or an already-irreducible quadratic denominator.

Partial Fractions Calculator

Decompose a rational expression P(x)/Q(x) into simpler fractions.

Try:
Answer1 / (x² − 5x + 6) = 1 / (x − 3) − 1 / (x − 2)
  1. Numerator1
  2. Denominatorx² − 5x + 6
  3. Discriminant of denominatorΔ = 1
  4. Roots of denominatorx₁ = 3, x₂ = 2
  5. CoefficientsA = P(3)/(a·(x₁−x₂)) = 1, B = P(2)/(a·(x₂−x₁)) = -1
  6. Decomposition1 / (x² − 5x + 6) = 1 / (x − 3) − 1 / (x − 2)

Splitting for the sake of what comes next

Adding two simple fractions produces one complicated one, and the process is easy to run forwards. Partial-fraction decomposition runs it backwards: given the combined fraction, recover the simple ones it came from.

The reason to bother is that the pieces are tractable where the whole is not. This calculator decomposes a rational expression whose denominator is a quadratic, splitting it according to what the roots of that denominator turn out to be.

A fraction with a quadratic denominator resists most of the operations you might want to apply to it. Broken into two pieces with linear denominators, each becomes something standard — an integral anyone can do, a term with an obvious inverse transform, a series that expands term by term.

The discriminant decides the shape of the answer before any coefficients are computed, so the tool reports it as its own step. Two distinct real roots give two separate fractions, a repeated root gives one squared denominator, and no real roots mean there is nothing to split at all.

How to use this calculator

  1. Enter the numerator A polynomial in x, which may be a constant. Its degree must be lower than the denominator's.
  2. Enter the denominator It must be a quadratic. Higher degrees are rejected explicitly rather than partially handled.
  3. Read the discriminant line It is computed before anything else and determines which of the three cases applies. The shape of the answer follows from its sign alone.
  4. Read the decomposition Given as an equation, with the original fraction on the left and the split form on the right, so the claim can be checked by recombining.

How the split is computed

Both inputs are parsed and expanded into coefficient lists first, so a denominator written as a product of brackets is multiplied out before anything else happens. Two conditions are then checked: the denominator must be exactly of degree two, and the numerator's degree must be strictly lower.

The discriminant of the denominator is computed from those coefficients and its sign selects the route. When it is positive, the two real roots are found by the quadratic formula and each coefficient is obtained by evaluating the numerator at one root and dividing by the leading coefficient times the gap between the roots. That is the cover-up method carried out arithmetically rather than by hand.

When the discriminant is zero the denominator is a perfect square with a repeated root, and the decomposition is a single fraction over that squared factor. This branch is taken only when the numerator is constant; a non-constant numerator over a repeated root needs a two-term form the tool does not yet produce, and it says so rather than returning something incomplete.

When the discriminant is negative the denominator has no real roots and cannot be factored over the reals. There is nothing to split, and the fraction is reported as already being in decomposed form — which is a result rather than a refusal.

What each input means

P(x) Numerator — form field “Numerator P(x)”
A polynomial in x of degree lower than the denominator's. A constant is the most common case and the one every branch handles.
Q(x) Denominator — form field “Denominator Q(x)”
A quadratic. It may be entered factored or expanded, since it is multiplied out before use.
Δ Discriminant
Computed from the denominator's coefficients. Its sign selects between two distinct roots, a repeated root, and no real roots.

Worked examples

Every number below is produced by the same calculation engine the tool above runs. Nothing here is typed by hand, so the walkthrough cannot drift from what you get when you enter the same values yourself.

Two distinct real roots

A constant numerator over a quadratic that factors into two different linear terms — the standard case the method was designed for.

Inputs Numerator P(x) = 1, Denominator Q(x) = x^2 - 5x + 6

  1. Numerator 1
  2. Denominator x² − 5x + 6
  3. Discriminant of denominator Δ = 1
  4. Roots of denominator x₁ = 3, x₂ = 2
  5. Coefficients A = P(3)/(a·(x₁−x₂)) = 1, B = P(2)/(a·(x₂−x₁)) = -1
  6. Decomposition 1 / (x² − 5x + 6) = 1 / (x − 3) − 1 / (x − 2)

Result 1 / (x² − 5x + 6) = 1 / (x − 3) − 1 / (x − 2)

The denominator's roots are 2 and 3, and the two coefficients come out equal in size and opposite in sign. That happens whenever the numerator is constant, because the two evaluations differ only by the sign of the gap between the roots.

Recombining the two fractions over a common denominator returns the original, which is the check worth running once. The middle terms cancel, leaving only the constant numerator.

A linear numerator

The numerator is x rather than a constant, over a difference of squares. The two coefficients are no longer mirror images.

Inputs Numerator P(x) = x, Denominator Q(x) = x^2 - 1

  1. Numerator x
  2. Denominator x² − 1
  3. Discriminant of denominator Δ = 4
  4. Roots of denominator x₁ = 1, x₂ = -1
  5. Coefficients A = P(1)/(a·(x₁−x₂)) = 0.5, B = P(-1)/(a·(x₂−x₁)) = 0.5
  6. Decomposition x / (x² − 1) = 0.5 / (x − 1) + 0.5 / (x + 1)

Result x / (x² − 1) = 0.5 / (x − 1) + 0.5 / (x + 1)

The roots are 1 and −1, and evaluating the numerator at each gives different values, so the two coefficients now differ in magnitude as well as arrangement. Both come out as halves.

The numerator's degree is one and the denominator's is two, which satisfies the requirement. Had the numerator been quadratic, long division would be needed first to extract a polynomial part.

An irreducible denominator

A constant over a quadratic with no real roots. The discriminant is negative, so no factorisation over the reals exists.

Inputs Numerator P(x) = 1, Denominator Q(x) = x^2 + 1

  1. Numerator 1
  2. Denominator x² + 1
  3. Discriminant of denominator Δ = -4
  4. Irreducible over the reals Δ < 0 — the denominator has no real roots, so the fraction is already in decomposed form.

Result 1 / (x² + 1)

Nothing is split, and the tool says the fraction is already decomposed. That is the correct answer: the denominator has no real linear factors to separate it into.

Such a term is still perfectly usable — it integrates to an arctangent, for instance. Being irreducible removes the need for decomposition rather than blocking further work.

Reading the result

The discriminant announces the answer's shape

Positive gives two fractions with distinct linear denominators, zero gives one with a squared denominator, negative gives the original unchanged. Reading that line first tells you what to expect before the coefficients appear.

Verify by recombining

Putting the pieces back over a common denominator must reproduce the input exactly. That check is quick, needs nothing beyond ordinary algebra, and settles any disagreement with hand-working.

Why the degree condition matters

A numerator whose degree reaches the denominator's contains a polynomial part that no sum of proper fractions can represent. Long division extracts it first, leaving a proper remainder that this tool can then handle.

When you would use this

Preparing a rational function for integration

A fraction with a linear denominator integrates to a logarithm and one with a squared linear denominator to a reciprocal. Splitting first turns an awkward integral into two standard ones.

Inverting a transform

Rational expressions in engineering transforms are inverted term by term against a table of standard forms. Decomposition is what produces the terms the table actually lists.

Assumptions and limitations

What this calculator assumes

  • The denominator is a polynomial of degree exactly two.
  • The numerator is a polynomial of strictly lower degree.
  • Both inputs are expanded before the discriminant is computed, so factored input is accepted.
  • Roots are found numerically, so coefficients are reported as decimals rather than exact fractions.

Where it stops being the right tool

  • Degree-2 denominators only. Cubic and higher denominators need a factoring step that is not implemented here.
  • A repeated root is handled only when the numerator is constant; a linear numerator over a squared factor is refused.
  • Improper fractions are rejected rather than divided out automatically.
  • Complex decomposition is not offered for an irreducible quadratic, which is reported as already decomposed instead.

Common mistakes

Starting with an improper fraction

Why it happens. The expression looks like an ordinary rational function, and nothing about it signals that a polynomial part is hiding inside.

How to avoid it. Compare the two degrees before entering. If the numerator's is at least the denominator's, run polynomial long division first and decompose the remainder.

Assuming every quadratic denominator can be split

Why it happens. Most textbook examples factor cleanly, which builds the expectation that decomposition always produces two pieces.

How to avoid it. Check the discriminant. A negative value means no real factorisation exists, and the fraction is already as simple as it gets over the reals.

Using the wrong form for a repeated root

Why it happens. A squared denominator looks like it should split into two fractions the way distinct roots do, so a two-term attempt is natural.

How to avoid it. A repeated root needs a term over the linear factor and another over its square, not two copies of the same denominator. With a constant numerator only the squared term survives.

Frequently asked questions

What range of denominators is supported?

Quadratics — degree exactly two. Higher-degree denominators would first need factoring into linear and irreducible quadratic pieces, which is a separate step not implemented in this version.

What if the numerator's degree is at least the denominator's?

The fraction is improper and is rejected. Use polynomial long division to extract the polynomial quotient first, then decompose the proper remainder that is left over the same denominator.

What is the connection to integration?

Decomposition is one of the standard techniques for integrating rational functions: each linear denominator integrates to a logarithm and each squared one to a reciprocal. The integral calculator performs this same split internally when it meets a degree-2 denominator.

Why does an irreducible quadratic return unchanged?

Because a negative discriminant means the denominator has no real roots and therefore no real linear factors. There is nothing to separate, so the fraction is already in its decomposed form over the reals.