How it’s calculated
A cubic equation ax³ + bx² + cx + d = 0 always has three roots (counting repeats), which may be real or complex. The discriminant tells you which case you are in:
- Δ > 0: three distinct real roots.
- Δ = 0: a repeated root (a double root, or a triple root when b² = 3ac as well).
- Δ < 0: one real root and a pair of complex conjugate roots.
The solver substitutes x = t − b/(3a) to get the depressed cubic t³ + pt + q = 0 with p = (3ac − b²)/(3a²) and q = (2b³ − 9abc + 27a²d)/(27a³). With one real root it uses Cardano's formula; with three real roots it uses the trigonometric form. Each real root is then refined by Newton's method on your original cubic, and the complex pair is found from the leftover quadratic.
Example: x³ − 6x² + 11x − 6 = 0. Δ = 4 > 0, so there are three real roots, and the polynomial factors as (x − 1)(x − 2)(x − 3): x = 1, 2, 3. By contrast x³ − 1 = 0 has Δ = −27, so one real root x = 1 and two complex roots −0.5 ± 0.866i.
Whole-number coefficients and decimals with up to 6 decimal places are converted to exact integers, so Δ and the nature of the roots are exact: (x − 100)(x − 101)(x − 102) is correctly three distinct roots, and (x − 0.1)²(x − 0.3) is correctly a double root. Coefficients with more decimal places already carry rounding, so two roots that agree to about one part in a million are then reported as a repeated root.
Frequently asked questions
What happens if a = 0?
The equation is no longer cubic. It is the quadratic bx² + cx + d = 0, so the calculator asks you to use the quadratic equation calculator instead.
Can a cubic have no real roots?
No. A cubic with real coefficients always has at least one real root, because its graph goes from −∞ to +∞ (or the reverse). The other two are real or a complex pair.
What does the discriminant tell me?
Its sign sorts the roots: positive for three distinct real roots, zero for a repeated root, negative for one real and two complex roots.
How do I check an answer?
Substitute the root back into ax³ + bx² + cx + d. For a real root the result should be 0 (up to rounding). For three roots, their sum is −b/a and their product is −d/a.
Embed this calculator
Add this free calculator to your own website. Copy the code below into your page’s HTML:
Need this calculator branded, changed or built around your own prices?See custom business solutions →
Sources
- NIST Digital Library of Mathematical Functions, §1.11(iii) Cubic Polynomials (discriminant and solution formula) — NIST
- College Algebra 2e, §5.5 Zeros of Polynomial Functions — OpenStax
Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.
Added · Last updated · How we check our calculators
Spotted a mistake or missing option? Report a problem· Suggest a calculator