Cubic Equation Calculator

Smallest real root1
Root 22
Root 33
Discriminant4
How this was calculated
  1. Divide through by a = 1 to make the cubic monic: x^3 + (-6)x^2 + (11)x + (-6) = 0.
  2. Depress the cubic with the substitution x = y - A/3 to remove the quadratic term, giving y^3 + py + q with p = -1 and q = 0.
  3. The discriminant is Delta = 18abcd - 4b^3 d + b^2 c^2 - 4ac^3 - 27a^2 d^2 = 4. A positive discriminant means three distinct real roots.
  4. With p negative, the trigonometric method gives the roots directly: y = 2 sqrt(-p/3) cos((1/3) arccos((3q/2p) sqrt(-3/p)) - 2 pi k/3) for k = 0, 1, 2.
  5. Shifting each root back by -A/3 = 2 and sorting, the three real roots are 1, 2 and 3.

This cubic equation calculator solves equations of the form ax^3 + bx^2 + cx + d = 0 and reports every root, real and complex. Every cubic has at least one real root, and the discriminant Delta tells you which case you are in: three distinct real roots, one real root with a complex pair, or a repeated root. For example, x^3 - 6x^2 + 11x - 6 = 0 has discriminant 4 and the three roots 1, 2 and 3. x^3 - 7x + 6 = 0 has discriminant 400 and the three roots -3, 1 and 2. And x^3 - 8 = 0 has discriminant -1,728, one real root x = 2, and the complex pair -1 + 1.73i and -1 - 1.73i.

The method behind the calculator is the closed-form solution published by Gerolamo Cardano in Ars Magna in 1545, building on work by Tartaglia and del Ferro. Depressing the cubic removes the quadratic term before Cardano's formula is applied, which is why this approach is the accepted standard for solving cubics exactly rather than approximately. This page shows the formula, the step-by-step workings, worked examples and the sources behind the method, so you can follow each stage of the calculation and check the result yourself.

Worked examples

Roots 1, 2 and 3

Primary result: 1. Full step-by-step working is shown with the result. (1 · -6 · 11 · -6)

Smallest real root1
Root 22
Root 33
Discriminant4

Roots -3, 1 and 2

Primary result: -3. Try it with your own numbers in the calculator above. (1 · 0 · -7 · 6)

Smallest real root-3
Root 21
Root 32
Discriminant400

One real root: x = 2

Primary result: 2. Every intermediate value is printed in the worked steps. (1 · 0 · 0 · -8)

Real root2
Complex root 1-1.00 + 1.73i
Complex root 2-1.00 - 1.73i
Discriminant-1,728

The shape of a cubic's roots

Before you reach for any formula, it helps to know what kind of answer a cubic equation calculator will hand back. Every cubic ax^3 + bx^2 + cx + d = 0 has at least one real root, so the question is never whether a real solution exists but how many there are and whether complex numbers enter the picture. The discriminant, written Delta, settles this. Its sign sorts every cubic into one of three cases: three distinct real roots, one real root paired with a complex conjugate pair, or a repeated root.

When Delta is positive, the cubic crosses the x-axis three separate times, giving three distinct real roots. Two examples show the pattern. The equation x^3 - 6x^2 + 11x - 6 = 0 has discriminant 4 and the three roots 1, 2 and 3. The equation x^3 - 7x + 6 = 0 has discriminant 400 and the three roots -3, 1 and 2. In both, the positive sign of Delta matches the count of three real solutions, and each root is different from the others.

When Delta is negative, only one root is real and the other two form a complex conjugate pair. The equation x^3 - 8 = 0 shows this clearly. Its discriminant is -1,728, it has one real root x = 2, and the complex pair is -1 + 1.73i and -1 - 1.73i. On a graph you would see a single crossing of the x-axis, while the two complex roots sit off the real number line as mirror images of each other.

The third case is the repeated root, where Delta equals zero. Here at least two of the roots coincide, so the cubic touches the x-axis rather than passing cleanly through it at that point. A repeated root still counts as a real solution, but it is not distinct from its twin, which is why the count of separate real roots drops.

The discriminant is therefore a quick diagnostic: its sign tells you the shape of the answer set before any root is computed. That matters because the closed-form solution is not simple. The method was published by Gerolamo Cardano in Ars Magna (1545), building on work by Tartaglia and del Ferro, and it begins by depressing the cubic to remove the quadratic term before Cardano's formula is applied. Knowing the discriminant's sign first tells you what to expect from that process, whether the results will all be real or whether a complex pair will appear alongside the single real root.

  • Delta > 0: three distinct real roots, as in x^3 - 6x^2 + 11x - 6 = 0 (discriminant 4, roots 1, 2, 3) and x^3 - 7x + 6 = 0 (discriminant 400, roots -3, 1, 2).
  • Delta < 0: one real root plus a complex conjugate pair, as in x^3 - 8 = 0 (discriminant -1,728, real root 2, complex pair -1 + 1.73i and -1 - 1.73i).
  • Delta = 0: a repeated root, where at least two roots coincide.
Every cubic has at least one real root. The sign of the discriminant Delta tells you whether the other roots are two more real numbers, a complex pair, or a repeat of a root you already have.

Solving step by step

A cubic equation calculator follows a fixed sequence of steps, and knowing that sequence makes the output far easier to trust. The first step is normalization: divide the entire equation ax^3 + bx^2 + cx + d = 0 by a, so the leading coefficient becomes 1. This does not change the roots, but it puts every cubic into the same standard shape before any further work. The second step is depressing the cubic. Substitute x = y - A/3, where A is the new coefficient of the squared term. This shift removes the quadratic term entirely, leaving a simpler depressed cubic in y. That removal matters because Cardano's formula was designed for a cubic without a quadratic term, so depressing first is what makes the closed form applicable. The closed-form solution itself was published by Gerolamo Cardano in Ars Magna (1545), building on work by Tartaglia and del Ferro.

The third step is to compute the discriminant Delta, which decides the character of the roots. Every cubic ax^3 + bx^2 + cx + d = 0 has at least one real root, and Delta tells you which of three cases you are in: three distinct real roots, one real root with a complex pair, or a repeated root. When Delta indicates three distinct real roots, the trigonometric method is the practical route, since it avoids complex intermediate values. When Delta indicates one real root plus a complex pair, Cardano's formula gives the real root directly. The calculator applies whichever branch matches the discriminant, so you never have to choose by hand.

The first worked example is x^3 - 6x^2 + 11x - 6 = 0. Its discriminant is 4, a positive value pointing to three distinct real roots, and indeed the three roots are 1, 2 and 3. Because all three are real, this is the trigonometric-method case. The second example, x^3 - 7x + 6 = 0, has discriminant 400 and the three roots -3, 1 and 2. It already lacks a quadratic term, so depressing it is trivial, but the same trigonometric branch applies because the discriminant again signals three distinct real roots.

The third example is x^3 - 8 = 0. Its discriminant is -1,728, which signals one real root together with a complex pair. The single real root is x = 2, and the complex pair is -1 + 1.73i and -1 - 1.73i. This is the Cardano branch: the formula returns the real root, and the complex pair follows from the same calculation. Seeing the three examples side by side shows why the discriminant check comes before any formula is applied, and why a cubic equation calculator reports the root type alongside the values.

In practice, the steps run in order every time: normalize, depress, compute Delta, then pick the trigonometric method or Cardano's formula. The worked examples above show each branch in action, so you can match your own equation to the closest case before reading the result.

Delta decides the branch: positive means three distinct real roots (trigonometric method); negative means one real root plus a complex pair (Cardano's formula); a repeated root is its own case.

The discriminant

Before you reach for a formula, a cubic equation calculator can tell you a lot about a cubic just by evaluating one expression. Every cubic ax^3 + bx^2 + cx + d = 0 has at least one real root. The discriminant, written Delta, decides which of three situations you are in: three distinct real roots, one real root with a complex pair, or a repeated root. For a cubic, Delta is defined as 18abcd - 4b^3 d + b^2 c^2 - 4ac^3 - 27a^2 d^2. Each term uses the coefficients exactly as they appear in the equation, including their signs, so a negative coefficient changes the result.

The three worked examples show how different the numbers can be. The equation x^3 - 6x^2 + 11x - 6 = 0 has discriminant 4, a small positive value, and its three roots are 1, 2 and 3. The equation x^3 - 7x + 6 = 0 has discriminant 400, and its three roots are -3, 1 and 2. Both are positive, and both have three distinct real roots. The third example, x^3 - 8 = 0, has discriminant -1,728. There the picture changes: the equation has one real root, x = 2, and a complex pair, -1 + 1.73i and -1 - 1.73i.

A positive discriminant, as in the 4 and 400 cases, means three distinct real roots. A negative discriminant, as in the -1,728 case, means one real root and a complex conjugate pair. The remaining possibility is a discriminant of zero, which signals a repeated root. The sign alone does not tell you the root values, but it does tell you what kind of roots to expect before any solving begins.

The discriminant is also a useful checkpoint for the closed-form route. The closed-form solution was published by Gerolamo Cardano in Ars Magna (1545), building on work by Tartaglia and del Ferro. Depressing the cubic removes the quadratic term before Cardano's formula is applied. Because that method involves intermediate quantities that can behave awkwardly when roots repeat or when only one root is real, knowing Delta first helps you interpret what the formula returns. A cubic equation calculator can compute Delta and the roots together, so you can compare the sign of the discriminant with the roots it reports.

  • Delta = 18abcd - 4b^3 d + b^2 c^2 - 4ac^3 - 27a^2 d^2
  • x^3 - 6x^2 + 11x - 6 = 0: Delta = 4, roots 1, 2 and 3
  • x^3 - 7x + 6 = 0: Delta = 400, roots -3, 1 and 2
  • x^3 - 8 = 0: Delta = -1,728, real root x = 2, complex pair -1 + 1.73i and -1 - 1.73i
Positive Delta: three distinct real roots. Negative Delta: one real root plus a complex pair. Delta = 0: a repeated root.

A short history

The cubic equation has a claim to being the most dramatic problem in the history of algebra. The general quadratic was solved long before, but for centuries the cubic resisted every attack. The breakthrough came in Italy in the early sixteenth century, and it arrived wrapped in secrecy, rivalry and a promise that was broken.

Scipione del Ferro, a professor at Bologna, found a method for solving one important type of cubic around 1515 but kept it to himself, as was the custom of the day. On his deathbed he passed the secret to his student Antonio Fior. Meanwhile Niccolò Tartaglia, a self-taught mathematician from Brescia, discovered his own method and, in a famous public contest in 1535, defeated Fior. Word reached Gerolamo Cardano in Milan, who pressed Tartaglia for the method. Tartaglia eventually revealed it, according to the traditional account on the condition that Cardano keep it secret and never publish it.

Cardano did not keep that promise. In Ars Magna, published in 1545, he laid out the closed-form solution for the cubic, crediting both Tartaglia and del Ferro. Tartaglia was furious, and the resulting priority dispute became the first great controversy in algebra. Cardano's student Lodovico Ferrari defended his teacher and went further, solving the quartic. The episode is remembered less for the quarrel than for what it produced: a general method, in print, that anyone could learn and apply.

The technique behind Cardano's formula begins with depressing the cubic, which removes the quadratic term and leaves a simpler equation to work with. That step is still the first move in any careful treatment of the problem, and it is the step a good cubic equation calculator performs before it reports its answers. The method also forced mathematicians to confront something new. In some cases the formula required taking the square root of a negative number even though the equation plainly had real solutions. Complex numbers, at first dismissed as impossible, became an unavoidable part of the subject.

The discriminant, usually written Delta, makes the same distinctions today. It tells you whether a cubic has three distinct real roots, one real root together with a complex pair, or a repeated root. The examples are worth keeping in mind. x^3 - 6x^2 + 11x - 6 = 0 has discriminant 4 and roots 1, 2 and 3. x^3 - 7x + 6 = 0 has discriminant 400 and roots -3, 1 and 2. x^3 - 8 = 0 has discriminant -1,728, one real root x = 2, and the complex pair -1 + 1.73i and -1 - 1.73i. Every cubic ax^3 + bx^2 + cx + d = 0 has at least one real root, so there is always somewhere to start.

Cardano published the closed-form cubic solution in Ars Magna (1545) against Tartaglia's wishes, turning a guarded secret into public mathematics.

FAQs

How do you solve a cubic equation?

First normalise the equation, then depress the cubic to remove the quadratic term. After that, apply Cardano's formula. When the cubic has three real roots, the trigonometric method is often used instead. Both routes lead to the same roots; the choice depends on the discriminant and on which form is easier to work with.

How many real roots can a cubic have?

A cubic has either three real roots, counting repeats, or one real root plus a complex-conjugate pair. The sign of the discriminant tells you which case applies, so you can predict the nature of the roots before solving. Every real cubic has at least one real root.

What is the discriminant of a cubic?

For a cubic written as ax^3 + bx^2 + cx + d, the discriminant is Delta = 18abcd - 4b^3 d + b^2 c^2 - 4ac^3 - 27a^2 d^2. A positive value means three distinct real roots, a negative value means one real root, and zero means a repeated root.

What are the roots of x^3 - 6x^2 + 11x - 6?

The roots are 1, 2 and 3. The cubic factors as (x - 1)(x - 2)(x - 3). Multiplying those factors back out returns the original expression, so you can check the answer directly. This is a simple example of a cubic with three distinct real roots.

Who first solved the cubic?

Scipione del Ferro found the first solution to the cubic. Tartaglia later rediscovered it independently. Cardano published the method in Ars Magna in 1545, which is why the formula carries his name. The history involves several mathematicians across the sixteenth century.

Can a cubic have no real roots?

No. Every real cubic crosses the x-axis at least once, so there is always at least one real root. The other two roots may be real or may form a complex-conjugate pair. This guarantees that solving a cubic always yields at least one real value.

Sources

Related calculators

Quadratic Equation Calculator
Solve ax² + bx + c = 0 with the quadratic formula: both roots, the discriminant, the vertex and the axis of symmetry — with a substitution check.
Factorial Calculator
Exact factorials up to 170! computed with arbitrary-precision integers — no scientific-notation rounding — with the digit count and trailing zeros (Legendre's formula) explained.
Log Calculator
Logarithms in any base — 10, 2, e or your own — with the change-of-base working shown and the inverse check that proves the answer.
Shannon Entropy Calculator
Shannon entropy of a probability distribution in bits, with the maximum entropy for the outcome count, efficiency and perplexity.