Cubic Equation Solver

All three roots of ax³ + bx² + cx + d = 0, real and complex, with a graph.

About this tool

Enter the four coefficients a, b, c and d. The solver lists all three roots, including complex pairs written as p ± qi, along with the discriminant and what it means, the turning points and the inflection point. A graph marks the real roots. Set a to 0 to solve a quadratic instead.

How cubic equations are solved

Every cubic equation has exactly three roots when you count complex and repeated ones, and at least one of them is real. The discriminant, Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d², tells you which case you have before you solve. A positive Δ means three different real roots, a negative Δ means one real root and a complex-conjugate pair, and zero means at least two roots are equal. x³ − 6x² + 11x − 6 = 0 has Δ = 4 and factors as (x − 1)(x − 2)(x − 3), so its roots are 1, 2 and 3. x³ − 1 = 0 has Δ = −27, the real root 1 and the pair −0.5 ± 0.866i. x³ − 3x² + 3x − 1 = (x − 1)³ has the triple root 1. To solve a general cubic, the solver first substitutes x = t − b/3a to remove the x² term. The resulting "depressed" cubic t³ + pt + q = 0 is solved with Cardano's formula when there's one real root. When there are three real roots, it uses the trigonometric (cosine) method, which avoids the complex cube roots Cardano would need. Each real root is then refined with Newton's method. Turning points come from setting the derivative 3ax² + 2bx + c to zero. Honest limits: answers are decimals accurate to about 10 significant figures, not exact surds, and coefficients are read as ordinary decimals. The quadratic solver, the simultaneous equations solver and the graphing calculator are related.

Frequently asked questions

How many roots does a cubic equation have?

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

What does the discriminant of a cubic tell you?

Positive means three distinct real roots, negative means one real root and two complex ones, and zero means a repeated root.

Is there a cubic formula?

Yes, Cardano's formula, though it's long. This solver uses it alongside the trigonometric method and shows the results as decimals.

Is my equation stored?

No. The solver runs in your browser and nothing is stored or sent.