Cubic Equation Calculator — Solve ax³ + bx² + cx + d = 0 Step by Step
All three roots, real and complex

Cubic Equation Calculator

Solve ax³ + bx² + cx + d = 0 — with the discriminant, the working, and a check on every root.

Put the equation in standard form first

Collect every term on the left so the equation reads ax³ + bx² + cx + d = 0, then enter the four coefficients. A missing term is a coefficient of 0, and the leading coefficient a cannot be zero.

Output options

Integer and simple fractional roots are shown exactly; irrational ones are rounded.

Method used: chosen from the discriminant

Solve the equation to see which route the working takes.

Entry tip: rearrange before you type. 2x³ = 5x − 1 becomes 2x³ + 0x² − 5x + 1 = 0, and x³ = 8 becomes 1, 0, 0, −8.

Coefficients

Equation as written

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

Whole numbers, decimals and fractions such as 3/4 are all accepted. Integer coefficients give the cleanest working.

How the cubic equation calculator works

A cubic equation calculator solves equations in the form ax³ + bx² + cx + d = 0, where a ≠ 0. Enter the coefficients a, b, c, and d to calculate up to three real or complex roots. The calculator applies algebraic methods to determine the values of x that satisfy the equation.

Every cubic with real coefficients has at least one real root, so the answer is never empty. The route to it is always the same: removing the x² term turns the equation into a depressed cubic in one variable, the discriminant classifies it, and the matching formula produces the three values, which are then shifted back to the original variable.

1. Depress

Substitute x = t − b/3a to remove the squared term.

2. Classify

The sign of the discriminant fixes how many roots are real.

3. Solve and shift

Apply the matching formula, then undo the substitution.

The cubic formulas

Depressed cubic

t³ + pt + q = 0

With p = (3ac − b²)/3a² and q = (2b³ − 9abc + 27a²d)/27a³, reached by setting x = t − b/3a.

Discriminant

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

Positive gives three distinct real roots, zero gives a repeated root, negative gives one real root and a complex pair.

Three real roots — trigonometric

tₖ = 2√(−p/3)·cos[⅓·arccos(3q/(2p)·√(−3/p)) − 2πk/3]

Used when Δ > 0, where the radical form would otherwise require complex arithmetic to reach real answers.

One real root — Cardano

t = ∛(−q/2 + √(q²/4 + p³/27)) + ∛(−q/2 − √(q²/4 + p³/27))

Used when Δ < 0. The two complex roots follow from the same pair of cube roots.

Repeated-root shortcut: when Δ = 0 and p ≠ 0, the double root is t = −3q/2p and the simple root is t = 3q/p. When p and q are both zero the equation has a single triple root at x = −b/3a.

Method reference: OpenStax covers the rational zero theorem, the factor theorem, and the conjugate-pair rule this calculator relies on in Zeros of Polynomial Functions.

Case selection guide

Which case is your cubic in?

Solve my equation

The discriminant answers the question before any root is computed, and each case has a matching picture on the graph. Reading the sign first tells you whether to expect decimals, a repeated value, or a complex pair.

How the discriminant of a cubic equation classifies its roots
DiscriminantRootsOn the graphMethod used
Δ > 0Three distinct real rootsCrosses the x-axis three timesTrigonometric form, which avoids complex intermediates.
Δ = 0, p ≠ 0A double root and a simple rootTouches the axis once, crosses onceDirect formulas from p and q; no radicals needed.
Δ = 0, p = 0One triple rootFlattens onto the axis at a single pointRead straight off as x = −b/3a.
Δ < 0One real root, two complex conjugatesCrosses the axis exactly onceCardano's formula with real cube roots.

If you are working by hand: try the rational root theorem before any of this. One rational root reduces the cubic to a quadratic, and the quadratic formula finishes the job in a single line.

Worked examples

Cubic equation examples with roots

Each row is one of the presets above. Load it in the calculator to see the discriminant, the depressed cubic, and the full working behind the answer.

Worked cubic equation examples with discriminant and roots
EquationΔCaseRoots
x³ − 6x² + 11x − 6 = 04Three real, distinct1, 2, 3
x³ − 3x + 1 = 081Three real, irrational−1.879385, 0.347296, 1.532089
x³ − 3x + 2 = 00Double root and simple root1 (twice), −2
x³ + x + 1 = 0−31One real, complex pair−0.682328, 0.341164 ± 1.161541i

Faster by hand

What to try before the cubic formula

The general formula is the last resort, not the first move. Three cheap checks solve most textbook cubics in a fraction of the time, and they leave working that is far easier to mark.

1. Look for a common factor

If d = 0, then x is a factor and one root is 0 immediately, leaving a quadratic behind.

2. Test the rational candidates

Any rational root is a divisor of d over a divisor of a. For integer coefficients that is a short list worth testing.

3. Divide out the factor you find

Synthetic division by (x − r) leaves a quadratic, and the quadratic formula finishes the remaining two roots.

Standard form matters: the calculator reads coefficients, not equations. 4x³ + 2x = 3x² − 9 must be collected into 4x³ − 3x² + 2x + 9 = 0 before entry, and any term that is missing is entered as 0 rather than skipped.

Historical reference: MacTutor traces the general solution of the cubic, and the priority dispute behind it, in Quadratic, cubic and quartic equations.

Reading the discriminant

One number decides the shape of the answer

The discriminant is built from the coefficients alone, so it is available before any root is found. Its sign tells you what kind of answer to expect — and, just as usefully, what a wrong-looking answer should have been.

Δ is positive

Three separate real roots. The curve has two turning points and passes through the axis between them.

Δ is zero

At least two roots have collided. The graph touches the axis without crossing at the repeated value.

Δ is negative

One real root and a conjugate pair. Two complex answers are correct here, not a sign of an error.

Interesting fact

Cubics are why complex numbers exist

Complex numbers did not arrive through quadratics. A quadratic with no real solution could simply be declared unsolvable and set aside. Cubics offered no such escape: when all three roots are plainly real, Cardano's formula still routes through square roots of negative numbers to reach them. Rafael Bombelli worked out in the 1570s how to handle those impossible quantities so that they cancelled at the end, leaving the real answers everyone could already see. Mathematicians had to accept the imaginary in order to keep the real — the awkward case still known as casus irreducibilis, and the reason this calculator switches to a trigonometric formula when the discriminant is positive.

Source: MacTutor History of Mathematics, Rafael Bombelli.

Showing your work

What to record alongside the roots

A list of three decimals is hard to check and easy to mistype. Recording how you got there makes an error traceable and usually carries most of the marks.

Minimum working to show

  • The equation in standard form, with all four coefficients
  • Any factor found by inspection, and the division that follows
  • The discriminant, or the quadratic you reduced to
  • Each root substituted back, with the residual you got

When a root needs interpreting

Cubics from real models — volumes, break-even points, beam deflections, chemical equilibria — often admit only one meaningful root. A negative length or a concentration above the total available is mathematically valid and physically meaningless, so state which root you keep and why before using it.

Example line: x³ − 6x² + 11x − 6 = 0 · try x = 1 → 0, so (x − 1) is a factor · divide → x² − 5x + 6 · factor → (x − 2)(x − 3) · roots 1, 2, 3 · check: each gives 0 ✓.

Common mistakes to avoid

Skipping a missing term. In x³ − 8 = 0 the coefficients are 1, 0, 0, −8. Leaving b and c out shifts every later value.

Stopping at one root. A cubic has three. Finding the obvious one and moving on loses the other two, real or complex.

Rounding before dividing. Using a rounded root in the synthetic division corrupts the quadratic and both remaining answers with it.

Reading Δ = 0 as an error. A repeated root is a legitimate answer; the curve touches the axis there rather than crossing it.

Frequently Asked Questions

What is a cubic equation, and what does a cubic equation calculator do?

A cubic equation is a polynomial equation of degree three, written in standard form as ax³ + bx² + cx + d = 0 with a leading coefficient a that is not zero. The highest exponent on the variable is 3, which is what makes the expression a cubic polynomial rather than a quadratic one. A cubic equation calculator takes those four coefficients and returns the three roots of the polynomial, real or complex, together with the discriminant that classifies them. Because the degree is three, there are always exactly three roots when repeated ones are counted with their multiplicity.

How do you solve x³ − 6x² + 11x − 6 = 0 by hand?

Start with the rational root theorem: any rational root divides the constant term 6, so test ±1, ±2, ±3 and ±6. Substituting x = 1 gives 1 − 6 + 11 − 6 = 0, so x = 1 is a root and (x − 1) is a factor. Dividing the polynomial by that factor leaves the quadratic equation x² − 5x + 6 = 0, which factors as (x − 2)(x − 3). The solution set is x = 1, 2 and 3, and the complete factorization is (x − 1)(x − 2)(x − 3) = 0 — a few lines of algebra that beat any general formula for speed.

What does the discriminant of a cubic equation tell you?

The discriminant Δ = 18abcd − 4b³d + b²c² − 4ac³ − 27a²d² sorts the roots into three cases without solving anything. A positive discriminant means three distinct real roots, so the cubic function has three x-intercepts and two turning points, which the derivative locates. A negative value means one real root and a conjugate pair of complex roots, and the graph crosses the axis once. A discriminant of exactly zero means a repeated root, where the curve touches the axis instead of cutting through it.

Can a cubic equation have no real roots?

No. Every cubic with real coefficients has at least one real root, because the graph of the function runs from negative infinity to positive infinity and must cross the x-axis somewhere along the way. Complex roots of a real polynomial always arrive in conjugate pairs, so an imaginary number never turns up alone in the answer and a cubic can carry two of them at most. That is why the possible outcomes are three real roots, or one real root plus a pair of complex numbers, and never zero real roots.

When should you use the rational root theorem instead of the cubic formula?

Use the rational root theorem first whenever the coefficients are integers, since testing the divisors of the constant term over the divisors of the leading coefficient is far quicker than the general formula. One rational root reduces the cubic to a quadratic, which the quadratic formula finishes in a line. Reach for Cardano's method only when no rational root exists: his formula opens with a substitution that strips out the x² term to leave a depressed cubic, then extracts the answer from nested radicals. That is the situation for most equations with irrational answers.

Why are the roots shown as decimals instead of exact radicals?

Exact radical forms for a cubic are often far less readable than the decimal values they represent, and in the three-real-root case they cannot be written without complex numbers at all — a historical oddity known as casus irreducibilis. This calculator reports an exact integer or fraction whenever a root has one, and falls back to a rounded approximation at your chosen precision otherwise. The residuals in the check panel show how close each calculation sits to a true zero of the polynomial.

Before you submit the answer

  • The equation is collected into ax³ + bx² + cx + d = 0
  • Missing terms were entered as 0, not skipped
  • All three roots are reported, not just the obvious one
  • Repeated roots are stated with their multiplicity
  • Complex roots are written as a conjugate pair
  • Each root was substituted back into the original equation

Other useful calculators

Disclaimer

This calculator solves cubic equations with real coefficients in standard form. Equations of a different degree, or with complex coefficients, variables in a denominator, or terms under a root, are outside its scope.

Roots are computed in floating-point arithmetic and are accurate to the precision shown, not to infinite precision. Coefficients that differ by many orders of magnitude, or discriminants extremely close to zero, can make the classification between a repeated root and two nearly equal roots sensitive; the residuals in the check panel indicate how much to trust a given answer.

The working shown is one valid route to the solution. Where a class, textbook, or marking scheme prescribes factoring, synthetic division, or a particular formula, follow that convention rather than this one.

Last updated

Formulas, worked examples, and references checked on this date.