Skip to content
FiftyCalc Free calculators for all 50 states

Cubic Equation Calculator

Test cases replayed : 4 of 4 match · Methodology · No outside source listed

Enter the four coefficients of ax³ + bx² + cx + d = 0 to get its three roots.

Result

Sample figures

Root x₁ (real)—

Depressed cubic t³ + pt + q: p —

  • Depressed cubic: q—
  • Discriminant test (q/2)² + (p/3)³—
  • Type of roots—
  • Root x₂ (real part if complex)—
  • Root x₃ (real part if complex)—
  • Imaginary part ± of x₂ and x₃ (0 if real)—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Cubic Equation Calculator

a (coefficient of x³, not 0): enter a number. Prefilled example: 1.

b (coefficient of x²): enter a number. Prefilled example: -6.

c (coefficient of x): enter a number. Prefilled example: 11.

d (constant term): enter a number. Prefilled example: -6.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. a (coefficient of x³, not 0): enter a number.
  2. b (coefficient of x²): enter a number.
  3. c (coefficient of x): enter a number.
  4. d (constant term): enter a number.
  5. Read the result: Root x₁ (real); the panel also shows Depressed cubic t³ + pt + q: p, Depressed cubic: q, Discriminant test (q/2)² + (p/3)³, Type of roots, Root x₂ (real part if complex), Root x₃ (real part if complex) and Imaginary part ± of x₂ and x₃ (0 if real).

How this calculator works

Substituting x = t − b ÷ 3a gives the depressed cubic t³ + pt + q = 0 with p = (3ac − b²) ÷ 3a² and q = (2b³ − 9abc + 27a²d) ÷ 27a³.

If (q/2)² + (p/3)³ > 0 there is one real root, given by Cardano's formula t = ∛(−q/2 + √Δ) + ∛(−q/2 − √Δ), and two complex conjugate roots.

Otherwise the three roots are real and the trigonometric method (Viète) gives them: t_k = 2√(−p/3) cos(⅓ arccos((3q ÷ 2p)√(−3/p)) − 2πk/3), k = 0, 1, 2. Results are rounded to 9 decimal places.

Worked example

a (coefficient of x³, not 0)1
b (coefficient of x²)-6
c (coefficient of x)11
d (constant term)-6
Depressed cubic t³ + pt + q: p-1
Depressed cubic: q0
Discriminant test (q/2)² + (p/3)³-0.037
Type of rootsThree real roots (some may be repeated)
Root x₁ (real)3
Root x₂ (real part if complex)2
Root x₃ (real part if complex)1
Imaginary part ± of x₂ and x₃ (0 if real)0

Frequently asked questions

How many roots does a cubic equation have?

Exactly three, counted with multiplicity, of which at least one is real. The other two are either both real or a pair of complex conjugates.

What are the roots of x³ − 6x² + 11x − 6 = 0?

3, 2 and 1, since it factors as (x − 1)(x − 2)(x − 3).

What does a repeated root look like?

The graph touches the x-axis without crossing it. x³ − 3x + 2 = (x − 1)²(x + 2) has the double root 1 and the root −2.

Related calculators