Cubic Equation Solver & Factoriser

Enter the four coefficients and get all three roots, real or complex, together with the sum and product of the roots and the factorised form of the polynomial.

For ax³ + bx² + cx + d = 0

Roots
Sum of roots  −b/a
Sum of products in pairs  c/a
Product of roots  −d/a
Discriminant
Factorised form

Vieta's relations — the roots without solving

You very often do not need the roots themselves. For ax³ + bx² + cx + d = 0 with roots α, β, γ:

α + β + γ = −b/a
αβ + βγ + γα = c/a
αβγ = −d/a

These hold whether the roots are real or complex, rational or irrational. A question asking for the sum or product of the roots of a cubic is asking you to read off a coefficient ratio, not to factorise anything — which is why those questions are worth doing first in an exam.

Building a cubic from its roots

Run the relations backwards. If you know the three roots, the polynomial is

x³ − (α+β+γ)x² + (αβ+βγ+γα)x − αβγ

So roots 1, 2 and 3 give x³ − 6x² + 11x − 6, which is the example loaded above. Multiply through by any non-zero constant and the roots are unchanged.

How to factorise a cubic by hand

The method that works in an exam is the rational root theorem followed by division.

  1. List the factors of the constant term d and the factors of the leading coefficient a. Every rational root has the form ±(factor of d)/(factor of a).
  2. Test those candidates in the polynomial. For x³ − 6x² + 11x − 6 the candidates are ±1, ±2, ±3, ±6, and x = 1 gives zero straight away.
  3. That makes (x − 1) a factor. Divide, by long division or synthetic division, to get a quadratic.
  4. Factorise or apply the quadratic formula to the quadratic. Here x² − 5x + 6 = (x − 2)(x − 3).

If no rational candidate works, the cubic has no rational root and hand factorisation stops there; the calculator above falls back to Cardano's closed form, which always works.

What the discriminant tells you

Before solving, the discriminant Δ says what kind of answer to expect:

A cubic with real coefficients always has at least one real root, because the curve runs from minus infinity to plus infinity and must cross the axis somewhere. Complex roots can only arrive in pairs.

Worked example

Solve x³ − 6x² + 11x − 6 = 0

  1. Candidates from the rational root theorem: ±1, ±2, ±3, ±6
  2. x = 1: 1 − 6 + 11 − 6 = 0, so (x − 1) is a factor
  3. Divide: x³ − 6x² + 11x − 6 = (x − 1)(x² − 5x + 6)
  4. x² − 5x + 6 = (x − 2)(x − 3)
  5. Roots: x = 1, 2, 3
  6. Check: sum = 6 = −(−6)/1  ·  product = 6 = −(−6)/1 ✓

Frequently asked questions

What is the sum of roots of a cubic equation?

For a x cubed plus b x squared plus c x plus d equals zero, the sum of the roots is minus b over a. This holds whether the roots are real or complex, so you can read it straight off the coefficients without solving.

What is the product of roots of a cubic equation?

The product of the roots is minus d over a. Note the minus sign, which comes from the odd degree; for a quadratic the product is plus c over a with no sign change.

How do you factorise a cubic equation?

Use the rational root theorem to list candidate roots as plus or minus factors of d divided by factors of a, test them until one gives zero, divide the cubic by that linear factor to get a quadratic, then factorise the quadratic.

What is the formula for finding a cubic polynomial from its roots?

The polynomial is x cubed minus the sum of roots times x squared plus the sum of pairwise products times x minus the product of roots. Any non-zero multiple of it has the same roots.

Can a cubic equation have no real roots?

No. A cubic with real coefficients always has at least one real root, because the graph runs from minus infinity to plus infinity and must cross the x axis. Complex roots occur only in conjugate pairs, so a cubic has either one or three real roots.

What does the discriminant of a cubic tell you?

A positive discriminant means three distinct real roots, zero means there is a repeated root with all roots real, and a negative discriminant means one real root and a pair of complex conjugates.

Related calculators

Inverse TrigonometryFunction GrapherHCF & LCMBoolean Function