Cubic Equation Calculator

Enter the coefficients of ax³ + bx² + cx + d = 0 to find all three roots — real or complex — using Cardano's formula.

Quick Facts

Method
Cardano's formula via the depressed cubic
Substituting x = t − b/(3a) removes the x² term, giving t³ + pt + q = 0.
Discriminant
Δ = (q/2)² + (p/3)³
Δ > 0: one real root plus two complex; Δ = 0: repeated real roots; Δ < 0: three distinct real roots.
Requirement
a ≠ 0
If a = 0 the x³ term vanishes and the equation is no longer cubic.

Your Results

Calculated
Root 1 (x₁)
-
First solution
Root 2 (x₂)
-
Second solution
Root 3 (x₃)
-
Third solution
Root nature
-
Based on discriminant Δ

Ready

Enter coefficients a, b, c, d and press Calculate to solve for the roots.

How the Cubic Equation Calculator works

A cubic equation has the general form ax³ + bx² + cx + d = 0, where a is nonzero. This calculator solves it exactly using Cardano's formula, the classical closed-form method for cubics, rather than an iterative approximation.

What the calculator does step by step

  • Divides through by a and substitutes x = t − b/(3a) to eliminate the x² term, producing the depressed cubic t³ + pt + q = 0, with p = (3ac − b²)/(3a²) and q = (2b³ − 9abc + 27a²d)/(27a³).
  • Computes the discriminant Δ = (q/2)² + (p/3)³ to determine how many roots are real.
  • Applies Cardano's radical formula (Δ > 0 or Δ = 0) or the equivalent trigonometric form (Δ < 0, three real roots) to solve for t, then converts back to x.

Understanding the output

  • Three roots, always: every cubic has exactly three roots counting multiplicity — the mix of real and complex depends only on the sign of Δ.
  • Δ > 0: one real root and a complex-conjugate pair (a + bi and a − bi). The cubic's graph crosses the x-axis exactly once.
  • Δ = 0: all roots are real and at least two coincide (a repeated root) — the graph is tangent to the x-axis at that point.
  • Δ < 0: three distinct real roots — the graph crosses the x-axis three times.
  • Checking your answer: substitute each root back into ax³+bx²+cx+d and confirm it evaluates to (approximately) zero.

Common uses

Cubic equations show up whenever a relationship involves a variable raised to the third power — volume problems, polynomial curve fitting, engineering stress-strain models, and as a step inside more advanced algebra and calculus work.

Frequently Asked Questions

What method does this calculator use to solve a cubic?
It uses Cardano's formula. The general cubic ax³+bx²+cx+d=0 is first reduced to a depressed cubic t³+pt+q=0 by substituting x = t − b/(3a), then solved in closed form using the discriminant Δ = (q/2)² + (p/3)³.
How many roots does a cubic equation have?
Every cubic has exactly three roots by the Fundamental Theorem of Algebra, counted with multiplicity. Depending on the discriminant, that can mean three distinct real roots (Δ < 0), a repeated real root with all roots real (Δ = 0), or one real root plus a complex-conjugate pair (Δ > 0).
What does it mean if two roots are complex?
Complex roots always come in conjugate pairs for equations with real coefficients, so if one root is a + bi the other is a − bi. This happens whenever the discriminant Δ is positive, meaning the cubic curve only crosses the x-axis once.
Why must coefficient a be nonzero?
The leading coefficient a multiplies the x³ term. If a = 0, the x³ term disappears and the equation becomes a quadratic (or simpler), which this calculator does not solve.