Cubic Equation Solver

A cubic equation has the form ax³ + bx² + cx + d = 0 and always has at least one real root. This solver looks for rational roots using the rational root theorem, divides out the factor, and solves the remaining quadratic exactly. If no rational root exists, it finds the real roots numerically.

Try:

How to use the cubic equation solver

  1. Rearrange the equation to ax³ + bx² + cx + d = 0.
  2. Enter a, b, c and d.
  3. Press Calculate to see the roots, the factorisation and the graph.

Formula

f(r)=0  ⟺  (x−r) is a factor of f(x)f(r) = 0 \iff (x - r) \text{ is a factor of } f(x)

Worked example: x³ − 6x² + 11x − 6 = 0

  • a (x³): 1
  • b (x²): -6
  • c (x): 11
  • d (constant): -6

✓ Answer checked

x1=1,x2=2,x3=3x_1 = 1,\quad x_2 = 2,\quad x_3 = 3
Real roots (decimal)
1,  2,  31,\; 2,\; 3
−112345−20−101020x = 1x = 2x = 3y = f(x)
The real roots are where the curve crosses the x-axis (3 real roots).
Step-by-step working (4 steps)
  1. Write the equation

    Make sure it is in the form ax³ + bx² + cx + d = 0.

    x3−6x2+11x−6=0x^{3} - 6x^{2} + 11x - 6 = 0
  2. Find a rational root Rational root theorem

    Try ± (factors of the constant) ÷ (factors of the leading coefficient).

    f(1)=0f(1) = 0
  3. Divide out the factor Factor theorem

    Divide by (x − 1) using synthetic division.

    x3−6x2+11x−6=(x−1)(x2−5x+6)x^{3} - 6x^{2} + 11x - 6 = \left(x - 1\right)\left(x^{2} - 5x + 6\right)
  4. Solve the quadratic Quadratic formula

    Use the quadratic formula on the remaining factor.

    x2=2,x3=3x_2 = 2,\quad x_3 = 3
Formulas used
If f(r)=0 then (x−r) is a factor\text{If } f(r) = 0 \text{ then } (x - r) \text{ is a factor}
How this was checked
  • ✓ Substituting each real root into the cubic gives 0.

Frequently asked questions

How many roots does a cubic have?

Exactly three, counting repeated and complex roots. At least one is always real.

What is the rational root theorem?

Any rational root p/q has p dividing the constant term and q dividing the leading coefficient, so there is a short list of candidates to test.

Why are some answers decimals?

If no rational root exists, the exact roots involve complicated cube roots. The calculator gives accurate decimals instead and labels them as partly checked.

Related calculators

Related guides