Cubic Equation Solver

A cubic equation ax³ + bx² + cx + d = 0 always has three roots, counting repeats and complex ones. For x³ − 6x² + 11x − 6 = 0 the roots are x = 1, 2 and 3, because the cubic factors as (x − 1)(x − 2)(x − 3).

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

What Is a Cubic Equation?

A cubic equation is a polynomial equation of degree three, written ax³ + bx² + cx + d = 0 with a ≠ 0. Its graph is an S-shaped curve that always crosses the x-axis at least once, so every cubic has at least one real root. The other two roots are either both real or a pair of complex conjugates.

Cubics appear when a quantity depends on volume or on three-dimensional growth: the dimensions of a box with a given volume, the equilibrium in a chemical reaction, the shape of a beam under load, and the cubic splines used in computer graphics. There is an exact formula for the roots (Cardano’s method), although it is rarely done by hand.

Possible Root Patterns

PatternExampleRoots
Three distinct real rootsx³ − 6x² + 11x − 61, 2, 3
One real root, two complexx³ − 82 and −1 ± 1.732i
A repeated real rootx³ − 3x² + 3x − 11, 1, 1 (triple)

How Cubic Equations Are Solved

The solver first removes the x² term with the substitution x = t − b ÷ 3a, giving the depressed cubic:

t³ + p·t + q = 0 p = (3ac − b²) ÷ (3a²) q = (2b³ − 9abc + 27a²d) ÷ (27a³)
  • The sign of the discriminant Δ = −(4p³ + 27q²) tells the root type: Δ > 0 means three distinct real roots, Δ = 0 means a repeated root and Δ < 0 means one real and two complex roots.
  • Cardano’s formula or a trigonometric method then gives the roots.
  • Vieta’s formulas give a handy check: the sum of the roots is −b ÷ a, the sum of the pair products is c ÷ a and the product of the roots is −d ÷ a.

If a rational root exists, the Rational Root Theorem narrows the candidates. You can then divide it out with synthetic division and finish with the quadratic formula.

How Is It Calculated? Worked Examples

x³ − 6x² + 11x − 6 = 0

  1. Rational-root candidates are the factors of 6: ±1, ±2, ±3, ±6.
  2. Testing x = 1: 1 − 6 + 11 − 6 = 0, so x = 1 is a root.
  3. Dividing by (x − 1) leaves x² − 5x + 6 = (x − 2)(x − 3).
  4. The roots are 1, 2 and 3, with a depressed cubic of p = −1, q = 0 (three distinct real roots).
  5. Vieta check: sum = 6 = −b ÷ a ✓, pair products 2 + 3 + 6 = 11 = c ÷ a ✓, product 6 = −d ÷ a ✓.

Other Cubics

EquationRootsType
x³ − 8 = 02, −1 + 1.732i, −1 − 1.732iOne real, two complex
x³ − 3x² + 3x − 1 = 01, 1, 1Triple root
2x³ − 4x² − 22x + 24 = 0−3, 1, 4Three distinct real

Building a Box

A 20 cm × 30 cm sheet has squares of side x cut from each corner and the sides folded up into an open box. The volume is x(20 − 2x)(30 − 2x). For a volume of 1,000 cm³: 4x³ − 100x² + 600x − 1,000 = 0, with roots x = 2.93, 5 and 17.07. Since the cut must be less than 10 cm, the valid answers are x = 2.93 cm or x = 5 cm. With x = 5, the box measures 5 × 10 × 20 = 1,000 cm³ ✓.

How to Use This Cubic Equation Solver

  1. Write the equation as ax³ + bx² + cx + d = 0 and enter a, b, c and d. Use 0 for any missing term.
  2. Read the roots, the root type, the depressed cubic and a check value showing f at the real root. It should be zero or extremely close to it.
  3. Complex roots are shown as p ± qi.

For a polynomial of any degree, use the polynomial calculator. To approximate a root numerically, try Newton’s method.

Where Cubic Equations Are Used

  • Geometry and design: dimensions of boxes, tanks and containers for a target volume.
  • Physics and engineering: beam deflection, fluid flow and equations of state such as van der Waals.
  • Chemistry: equilibrium concentrations leading to cubic polynomials.
  • Computer graphics: cubic Bézier curves and splines require solving cubics for intersections.
  • Economics: cubic cost functions with a turning point.

What Are the Most Common Mistakes With the Cubic Equation Solver?

  • Setting a = 0. The equation is then quadratic.
  • Forgetting complex roots. A cubic with one real root still has two complex ones.
  • Dropping a zero coefficient. For x³ − 8, b = 0, c = 0 and d = −8. They still have to be entered.
  • Not choosing a physically meaningful root. A negative length or a root outside the allowed range must be rejected.
  • Ignoring rounding. Check values like −5.7 × 10⁻¹⁴ are numerical noise and mean zero.
  • Assuming a formula exists for degree 5 and above. Quintic and higher equations have no general solution by radicals.

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

How many roots does a cubic equation have?

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

How do I solve a cubic equation?

Look for a rational root, divide it out to leave a quadratic, then use the quadratic formula. Otherwise use Cardano’s method or a numerical solver like this one.

What is a depressed cubic?

It is a cubic with no x² term, obtained by substituting x = t − b ÷ 3a. It has the form t³ + pt + q = 0 and is the starting point for Cardano’s formula.

Can a cubic have no real roots?

No. Its graph goes from −∞ to +∞ (or the reverse), so it must cross the x-axis at least once.

What does Vieta’s formula say for cubics?

For roots r₁, r₂, r₃: r₁ + r₂ + r₃ = −b ÷ a, r₁r₂ + r₁r₃ + r₂r₃ = c ÷ a and r₁r₂r₃ = −d ÷ a.

What are complex conjugate roots?

Complex roots of a real polynomial come in pairs p + qi and p − qi, so a cubic with one real root has two such conjugate roots.