Cubic Equation Calculator

This calculator solves a cubic equation of the form ax^3 + bx^2 + cx + d = 0. Enter the four coefficients and it returns all three roots, the discriminant and what that discriminant says about them: one real root with a complex conjugate pair, a repeated real root, or three distinct real roots. It removes the squared term by substituting x = t - b/(3a) and then applies Cardano's formula, switching to the trigonometric form when the discriminant is negative and the radicals would otherwise run through complex numbers. The sum and product of the roots are printed beside the answer so you can check them against -b/a and -d/a.

Enter the four coefficients of ax^3 + bx^2 + cx + d = 0. Coefficient a cannot be zero.

The number in front of x cubed. It cannot be zero, or the equation is not a cubic.
Widget