Cubic Equation Solver

This cubic equation solver finds all roots once you enter the coefficients a, b, c and d. For x³ − 6x² + 11x − 6 = 0 it returns the three roots x₁ = 1, x₂ = 2 and x₃ = 3.

Example: a (of x³) 1 · b (of x²) -6 · c (of x) 11 · d (constant) -6 → Roots: x₁ = 1 · x₂ = 2 · x₃ = 3. Source: Wikipedia – Cardanische Formeln. Updated: .

must not be 0
My ToolboxYour inputs are saved in this browser only.

Result

Roots
x₁ = 1 · x₂ = 2 · x₃ = 3
Roots with check
RootValueCheck |f(x)|
x₁10
x₂20
x₃30
Calculation values
ItemValue
Type of rootsthree distinct real roots (Δ > 0)
Discriminant Δ4
Depressed formy³ + p·y + q = 0 with p = −1 and q = 0; x = y − b/(3a)
Linear factors(x − 1) · (x − 2) · (x − 3)

How it is calculated

Every cubic equation ax³ + bx² + cx + d = 0 has three roots if complex numbers are allowed: either three real ones or one real and two complex conjugates. The solver finds all three, shows them as a number or in the form a + bi, and checks each by substitution.

How it is calculated

First the equation is divided by a and the substitution x = y − b/(3a) removes the quadratic term, leaving the depressed cubic y³ + p·y + q = 0. Its discriminant Δ = −4p³ − 27q² decides the case: for Δ > 0 there are three distinct real roots, found trigonometrically; for Δ < 0 one real and two complex roots from Cardano's formula; for Δ = 0 there are repeated roots. Real values are then polished with Newton's method.

Linear factors and check

With the roots the polynomial can be written as a(x − x₁)(x − x₂)(x − x₃). With complex roots a real quadratic factor remains. The “Check” column shows the magnitude of f(x) at the root, which is around 10⁻¹⁴ or smaller.

Frequently asked questions

How do you solve a third-degree equation?

Either guess one root and reduce to a quadratic with polynomial division, or use Cardano's formulas. The solver takes the second route and returns all three roots.

What does the discriminant tell you for a cubic?

Δ > 0: three distinct real roots. Δ = 0: a repeated root. Δ < 0: one real and two complex roots.

How many roots does x³ − 6x² + 11x − 6 = 0 have?

Three real ones: 1, 2 and 3. The equation can be written as (x − 1)(x − 2)(x − 3) = 0.

Sources and legal basis

As of: · Editorial policy

Related tools