Cubic Equation Calculator

Solve third-degree polynomial equations and find all real and complex roots with Cardano's method.

Solve a cubic equation
Enter all four coefficients. The leading coefficient must not be zero.

ax cubed + bx squared + cx + d = 0

About cubic equations

A cubic equation is a polynomial equation whose highest power is three. Its standard form has coefficients a, b, c, and d, with a nonzero leading coefficient. Every cubic has exactly three roots when repeated and complex roots are counted. Depending on its coefficients, those roots may be three distinct real values, a mix of repeated real values, or one real value accompanied by a complex-conjugate pair. This calculator uses the classical ideas behind Cardano's formula. It first divides all coefficients by the leading coefficient to make the polynomial monic. A substitution then removes the squared term and creates a depressed cubic. Two derived quantities, conventionally called p and q, determine a discriminant. A positive discriminant gives one real root and two complex conjugates. A negative discriminant gives three distinct real roots, calculated with a trigonometric form that avoids unnecessary complex intermediate values. A zero discriminant indicates repeated roots. Complex roots are displayed with a real part and an imaginary part followed by i. Because the original coefficients are real, any nonreal roots occur as conjugates: their real parts match and their imaginary parts have opposite signs. Results are rounded for display, so substituting a rounded irrational root back into the polynomial can leave a tiny residual. Exact integer roots appear without trailing decimal zeros. Cubic equations model volume, motion, optimization, intersections, fluid behavior, and many other scientific or engineering relationships. They also arise when factoring higher-degree polynomials and finding eigenvalues of three-dimensional systems. To use the solver correctly, arrange every term on one side of the equality and combine like powers before entering coefficients. Include zero for any missing term. For example, x cubed plus 1 has a equal to 1, b and c equal to 0, and d equal to 1. Multiplying every coefficient by the same nonzero constant does not change the roots. The calculator returns all three solutions so you can factor the polynomial, inspect repeated values, or continue with numerical analysis.

Cubic equation examples

The root pattern changes with the coefficients and discriminant.

EquationRootsRoot pattern
x cubed - 6x squared + 11x - 6 = 01, 2, 3Three distinct real roots.
x cubed + 1 = 0-1, 0.5 plus or minus 0.8660254iOne real root and a complex-conjugate pair.
x cubed - 3x + 2 = 0-2, 1, 1One simple root and one repeated root.

How to solve a cubic equation

  1. Move all terms to one side and arrange them from the third power down to the constant.
  2. Enter coefficients a, b, c, and d, using zero for every missing power.
  3. Select Solve Cubic Equation to apply the discriminant and Cardano branches.
  4. Read all three real or complex roots and account for any repeated values.

Frequently asked questions

How many roots does a cubic equation have?

A cubic has three roots when complex values and multiplicity are counted. The number of distinct real roots depends on its discriminant.

Why can cubic roots be complex?

A real cubic always has at least one real root, but the other two may not lie on the real number line. With real coefficients, those two nonreal roots form a conjugate pair.

What if a coefficient is missing?

Enter zero for the coefficient of that missing power. Skipping its position would attach the remaining values to the wrong terms.

Can coefficient a be zero?

No, a zero leading coefficient makes the equation quadratic or lower degree rather than cubic. Use a solver designed for that lower degree instead.

What does a repeated root mean?

A repeated root appears more than once in the polynomial's factorization. On a graph, it often marks a point where the curve touches the horizontal axis without crossing it.

Are the displayed roots exact?

Integer and simple decimal roots can display exactly, while irrational and complex components are rounded. The underlying calculation uses standard floating-point precision.