Category

Cubic Equation Calculator — Solve ax³ + bx² + cx + d = 0 (Real & Complex Roots)

Find all three roots of any cubic equation ax³ + bx² + cx + d = 0 — real and complex. Shows the discriminant, the depressed cubic, Vieta's formulas, and a substitution check, with worked examples.

0 calculations

Calculation Parameters

Enter the coefficients of ax³ + bx² + cx + d = 0

x³
+
x²
+
x
+
= 0

Enter Parameters

Fill in the form on the left and click "Calculate"

Welcome to the cubic equation calculator! Whenever you need to determine the roots of a cubic equation or find the equation of a cubic graph, don't hesitate to use this cubic equation solver. It finds all three roots — real and complex — of any equation of the form ax³ + bx² + cx + d = 0, shows the discriminant, Vieta's formulas, and a substitution check.

Need to learn what a cubic equation is? Looking for the cubic equation formula? Wondering how to solve cubic equations by hand? Scroll down for a concise, precise explanation of what the solution of a cubic equation looks like and how to factorize one — with plenty of worked examples.

What is a cubic equation?

Recall that a polynomial is an algebraic expression of the form

aₙxⁿ + aₙ₋₁xⁿ⁻¹ + … + a₂x² + a₁x + a₀

where aₙ, …, a₀ are called coefficients. We assume the coefficients are real numbers. Examples of polynomials are:

  • 3x + 5;
  • x² + 5x − 2;
  • 2x³ + x² − x + 3.

The largest number n such that aₙ ≠ 0 is called the degree of the polynomial. The degrees of the examples above are 1, 2, and 3, respectively.

A polynomial of degree 3 is called a cubic polynomial, and a cubic equation is the equation saying that a cubic polynomial is equal to zero:

a₃x³ + a₂x² + a₁x + a₀ = 0

or, using the notation from our cubic equation calculator:

ax³ + bx² + cx + d = 0

Cubic equations appear in many areas of maths and science. For instance, the characteristic polynomial of a 3×3 matrix is a cubic polynomial, and cubic regression is a statistical model that uses a cubic polynomial to describe relationships in data sets.

What are the roots of a cubic equation?

A root of a cubic equation is any argument x that satisfies the equation. For instance, 2 is a root of x³ − 8 = 0 because 2³ − 8 = 8 − 8 = 0.

It follows from the fundamental theorem of algebra that every cubic equation has exactly three complex roots. Some of these roots, however, may be equal. For instance, the equation x³ = 0 has the root 0 with multiplicity three.

A cubic equation always has at least one real root. The other two roots might be real or complex. In the latter case they form a pair of conjugate numbers — their real parts are equal and their imaginary parts have opposite signs. For instance, the other two roots of x³ − 8 = 0 are −1 + 1.73205i and −1 − 1.73205i.

How to use this cubic equation calculator

  1. Enter the coefficients a, b, c, and d of your equation ax³ + bx² + cx + d = 0. You may type decimals (like 0.5), negatives (like -3), or simple fractions (like 3/4).
  2. The leading coefficient a must be non-zero for a true cubic — if it is zero, the tool automatically solves the lower-degree (quadratic or linear) equation instead.
  3. Read the three roots. Real roots are shown as plain numbers, complex roots in the form p + qi.
  4. The calculator also displays the discriminant, the reduced (depressed) form, Vieta's formulas, and a substitution check for each real root.
  5. Optionally choose a measurement unit (metric — meters, kilograms, liters; or US customary — feet, pounds, gallons) to label the real roots in the units of your problem.

How to solve a cubic equation by hand?

The most reliable by-hand method is to reduce the cubic to its depressed form and apply Cardano's formula:

  1. Divide through by a so the leading coefficient is 1.
  2. Substitute x = t − b/(3a). This removes the square term and gives a depressed cubic t³ + pt + q = 0, where p = (3ac − b²)/(3a²) and q = (2b³ − 9abc + 27a²d)/(27a³).
  3. Compute D = (q/2)² + (p/3)³. If D > 0, there is one real root (from Cardano's formula) and two complex conjugates. If D = 0, the roots are all real with at least two equal. If D < 0, there are three distinct real roots, best found with the trigonometric method.
  4. Finally, undo the substitution with x = t − b/(3a).

A handy shortcut: if the coefficients are integers, try the rational root theorem — test simple candidates like ±1, ±2, ± factors of d over factors of a. Once one root is found, divide out the linear factor and solve the remaining quadratic.

What is the cubic equation formula?

For the depressed cubic t³ + pt + q = 0 with D > 0, Cardano's formula gives the real root as

t = ∛(−q/2 + √D) + ∛(−q/2 − √D)

and then x = t − b/(3a). The two complex roots are obtained from the same cube roots using the complex cube-roots of unity. When D < 0, the three real roots are given by the trigonometric form tₖ = 2·√(−p/3)·cos[(θ + 2πk)/3] for k = 0, 1, 2, where θ = arccos(−q/2 / √(−(p/3)³)).

Discriminant of a cubic equation

The discriminant of ax³ + bx² + cx + d = 0 is

Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d²

It tells you the nature of the roots at a glance:

  • Δ > 0 — three distinct real roots.
  • Δ = 0 — a multiple (repeated) real root; all roots are real.
  • Δ < 0 — one real root and two complex-conjugate roots.

Cubic equation — examples

  • x³ − 6x² + 11x − 6 = 0 factors as (x − 1)(x − 2)(x − 3), so the roots are 1, 2, and 3 (Δ > 0).
  • x³ − 3x + 2 = 0 factors as (x − 1)²(x + 2), so x = 1 is a double root and x = −2 is single (Δ = 0).
  • x³ − 8 = 0 has one real root x = 2 and the conjugate pair −1 ± 1.73205i (Δ < 0).

Frequently Asked Questions

Does a cubic equation always have a real root?

Yes. Because a cubic polynomial tends to −∞ on one side and +∞ on the other, its graph must cross the x-axis at least once, guaranteeing at least one real root.

Can a cubic equation have three complex roots?

No. Complex roots of a real-coefficient polynomial come in conjugate pairs, so a cubic can have zero or two complex roots — never three. The remaining root (or all three) is always real.

What if I enter 0 for the leading coefficient a?

Then the equation is no longer cubic. Our calculator automatically solves the resulting quadratic (bx² + cx + d = 0) or linear equation instead, so you still get the correct roots.

What are Vieta's formulas for a cubic?

For ax³ + bx² + cx + d = 0 with roots x₁, x₂, x₃: their sum is −b/a, the sum of pairwise products is c/a, and their product is −d/a. The calculator shows these so you can verify the result.

Can I enter fractions or decimals?

Yes. Any coefficient field accepts decimals like 0.25, negative numbers like -7, or simple fractions like 3/4.

Calculation History

Loading...