About this tool
Solve any cubic equation ax³ + bx² + cx + d = 0 (with a ≠ 0). Enter the four coefficients and the solver returns all three roots, real and complex, along with the discriminant and how many roots are real. It runs entirely in your browser and recalculates as you type.
The cubic is first depressed with the substitution x = t - b/(3a) into t³ + pt + q = 0, and the discriminant Δ = (q/2)² + (p/3)³ decides the case. When Δ > 0 there is one real root by Cardano's formula plus a complex-conjugate pair. When Δ = 0 the roots are real with a repeated value. When Δ < 0 there are three distinct real roots found with the trigonometric method, tₖ = 2√(-p/3)·cos((1/3)·acos((3q/2p)·√(-3/p)) - 2πk/3). Each t is shifted back by -b/(3a) to give x.
Complex roots are shown in a ± bi form. For example x³ - 6x² + 11x - 6 = 0 returns the roots 1, 2 and 3. Coefficient a must not be zero, or the equation is not cubic.