Cubic Equation Calculator
Solve any cubic equation ax³ + bx² + cx + d = 0. Get all three roots — real and complex — with steps, plus a Vieta's formulas check.
The cubic equation
A cubic equation has the form , where , , , are numbers and . Unlike a quadratic, there is no single simple formula most people memorize — instead, this calculator finds a root first, then reduces the problem to a quadratic. Every cubic has exactly three roots (counting multiplicity): three real numbers, or one real number and a complex conjugate pair.
Two solving strategies
This calculator picks its strategy from the constant term :
| Case | Strategy |
|---|---|
| Factor out . Every term has an , so is a root immediately: . What remains is a quadratic. | |
| Rational Root Theorem + deflation. Test candidate roots (divisors of over divisors of ) until one works, then divide it out by synthetic division to leave a quadratic factor. |
Either way, the last step is solving a quadratic — the same one behind the Quadratic Formula calculator.
Both strategies rely on finding one rational root first, so this calculator handles cubics that have at least one rational root; a cubic that is irreducible over the rationals (no integer or simple-fraction root) needs Cardano's formula or a numerical method, which is beyond this tool's scope.
Worked example — three rational roots
Solve , so , , , .
- Test rational roots: since , try divisors of over divisors of : gives . Found.
- Deflate: dividing by leaves .
- Solve the quadratic: , so the discriminant is , giving roots and .
- Three roots: , , — the factorization is .
- Vieta check: , and . Both match.
Worked example — d = 0 (factor out x)
Solve , so , , , .
- Factor out x: since , is a root: .
- Solve the quadratic: , discriminant , roots and .
- Three roots: , , .
- Vieta check: , and . Both match — the product is exactly because is one of the roots.
Worked example — a real root and a complex pair
Solve , so , , , .
- Test rational roots: try divisors of : gives . Found.
- Deflate: dividing by leaves .
- Solve the quadratic: discriminant , so the remaining two roots are complex conjugates: .
- Three roots: (real), , (a complex conjugate pair).
- Vieta check: (the imaginary parts cancel), and . Both match, even with complex roots in the mix.
Vieta's formulas as a built-in check
For any cubic with roots , Vieta's formulas relate the roots directly to the coefficients — no solving required:
This calculator shows both identities computed straight from , , , alongside the three roots it found. Because the identities hold for real and complex roots alike, they double as a correctness check: if the sum and product of the roots you calculated by hand don't match and , a root was mis-copied somewhere.
Where cubic equations show up
Cubic equations model volume problems (a box's dimensions related by one variable), cubic growth and decay curves, and the inflection points of higher-degree curves. Once you have one root of a cubic — by inspection, a graph, or the Rational Root Theorem — the quadratic formula or completing the square finishes the job on what's left.
Frequently asked questions
- What is a cubic equation?
- A cubic equation has the form , where , , , are numbers and . Every cubic has exactly three roots (counted with multiplicity): either three real roots, or one real root plus a pair of complex conjugate roots.
- How does this calculator solve a cubic?
- Two ways, depending on . If , then is automatically a root — factor out , leaving a quadratic to solve. If , the calculator searches for a rational root using the Rational Root Theorem, then deflates the cubic by synthetic division into a quadratic factor, which is solved with the quadratic formula.
- What is the Rational Root Theorem?
- For with integer-like coefficients, any rational root must equal , where divides the constant term and divides the leading coefficient . Testing every such candidate finds a root quickly without guessing.
- Why do complex roots show up?
- Once a real root is found and factored out, the remaining quadratic factor can have a negative discriminant — which means its two roots are complex conjugates. Every cubic still has at least one real root (a cubic curve always crosses the x-axis at least once), but the other two can be complex.
- What are Vieta's formulas, and what does the check verify?
- For with roots : the sum , and the product (there is also a sum-of-pairs identity, ). This calculator recomputes and straight from the coefficients as a sanity check against the three roots it found — real and complex together.
- What happens when a = 0?
- If the term disappears and the equation is at most quadratic, not cubic. This calculator reports that case as "not cubic"; enter a nonzero .