Audited 25 May 2026·Last updated 27 Jul 2026·5 citations·Tier 1·0 uses

Cubic Equation Solver

Solve ax³ + bx² + cx + d = 0 using Cardano's method. Find all real roots with step-by-step arithmetic.

Cubic Equation Solver

Leading coefficient; must be non-zero
Quadratic coefficient
Linear coefficient
Constant term
First Real Root
1
Largest or only real root
Second Real Root
1
Third Real Root
-2
Distinct Real Roots
2
Cubic Discriminant
0

Background.

A cubic equation is a polynomial equation of degree three, written in standard form as ax³ + bx² + cx + d = 0, where a ≠ 0. Unlike quadratic equations, which always have closed-form solutions via the quadratic formula, cubic equations require more sophisticated algebraic techniques. The cubic equation solver accepts four coefficients and returns all real roots, classifying the equation according to the number and multiplicity of its solutions. This tool is essential for engineering students, control theorists, and applied mathematicians who encounter cubic characteristic equations in dynamical systems, fluid mechanics, and chemical equilibrium problems.

The search demand for cubic equation solvers is narrower than for quadratic tools but highly specific. Mechanical engineering students solving eigenvalue problems for three-degree-of-freedom systems encounter cubic characteristic polynomials. Chemical engineers modeling three-species reaction equilibria sometimes derive cubic equations in concentration variables. Economists analyzing third-order autoregressive models encounter cubic polynomials in their lag operators. In each case, the practitioner needs to know whether the equation has one real root or three, because this determines whether the physical system exhibits monotonic or oscillatory behavior. The calculator answers this classification question instantly.

The historical solution of the cubic equation is one of the great stories of Renaissance mathematics. Scipione del Ferro discovered a method for depressed cubics around 1515 but kept it secret. Niccolò Tartaglia independently solved the general case in 1535, and Gerolamo Cardano published the method in his 1545 treatise Ars Magna after swearing an oath of secrecy to Tartaglia. Cardano's student Lodovico Ferrari used the cubic solution to solve the quartic equation shortly thereafter. The discovery that cubic equations could be solved algebraically shattered the classical Greek distinction between geometric constructibility and algebraic solvability, paving the way for modern abstract algebra.

In modern practice, cubic equations are solved by first applying the Tschirnhaus transformation x = t − b/(3a) to eliminate the quadratic term, producing a depressed cubic t³ + pt + q = 0. The discriminant Δ = (q/2)² + (p/3)³ then determines which solution method applies. When Δ > 0, Cardano's formula yields one real root and two complex conjugates. When Δ = 0, all roots are real and at least two coincide. When Δ < 0, the casus irreducibilis produces three distinct real roots that must be expressed using trigonometric functions rather than real radicals. The calculator automates this branching logic and selects the appropriate formula based on the discriminant sign.

The cubic equation also appears in computer graphics and geometric modeling. The problem of finding the intersection of a ray with a cubic Bezier patch reduces to solving a cubic equation. In cryptography, certain elliptic curve operations involve cubic polynomials over finite fields. In civil engineering, the buckling analysis of some column configurations leads to cubic characteristic equations. While the calculator handles only real coefficients and real roots, the underlying algebraic structure is identical. Users in these fields can verify their manual derivations against the calculator's output before implementing production code or committing to a structural design that depends on accurate root computation.

What is cubic equation solver?

A cubic equation is a polynomial equation of degree three in a single variable. The standard form is ax³ + bx² + cx + d = 0, where the coefficients a, b, c, and d are real numbers and a ≠ 0. The Fundamental Theorem of Algebra guarantees that every cubic equation has exactly three roots in the complex numbers, counting multiplicities. These roots may all be real, or one may be real with the other two forming a complex conjugate pair. The term "cubic" refers to the highest power of the variable, which distinguishes it from linear (degree one) and quadratic (degree two) equations. The cubic equation is the lowest-degree polynomial for which there is no general symmetry that guarantees a simple factorization. Linear equations factor trivially, and quadratics factor if the discriminant is a perfect square. Cubics may factor by the rational root theorem, but in general they require the algebraic methods of del Ferro, Tartaglia, and Cardano. The range of coefficients is all real numbers, and the outputs are either real numbers or complex numbers depending on the discriminant. Unlike quadratics, every cubic with real coefficients crosses the x-axis at least once, guaranteeing at least one real solution.

How to use this calculator.

  1. Enter the leading coefficient a, which must be non-zero.
  2. Enter the quadratic coefficient b.
  3. Enter the linear coefficient c.
  4. Enter the constant term d.
  5. Verify that a is non-zero; the calculator rejects a = 0.
  6. Review the real roots displayed, ordered from largest to smallest.
  7. Check the cubic discriminant and number of distinct real roots to understand the solution structure.

The formula.

a x³ + b x² + c x + d = 0

The solution process begins with the Tschirnhaus substitution x = t − b/(3a), which eliminates the quadratic term from the general cubic. Expanding ax³ + bx² + cx + d = 0 with this substitution and collecting terms yields the depressed cubic: t³ + pt + q = 0, where p = (3ac − b²)/(3a²) and q = (2b³ − 9abc + 27a²d)/(27a³). This reduction is standard in every algebra and numerical analysis textbook (Burden & Faires, 2011). The absence of a t² term simplifies the analysis because the sum of the roots of the depressed cubic is zero. The discriminant of the depressed cubic is Δ = (q/2)² + (p/3)³. This quantity governs the qualitative behavior of the roots. When Δ > 0, the expression under the outer square root in Cardano's formula is positive, and the formula produces one real value for t. The other two roots are complex conjugates obtained by multiplying the cube roots by complex primitive cube roots of unity. When Δ = 0, the square root vanishes, and Cardano's formula collapses to a repeated root structure. When Δ < 0, the casus irreducibilis occurs: three distinct real roots exist, but they cannot be expressed using real radicals alone. Instead, the trigonometric solution applies: t_k = 2√(−p/3) cos[ (1/3) arccos( (3q)/(2p) √(−3/p) ) − 2πk/3 ] for k = 0, 1, 2. This formula is remarkable because it expresses real roots using real operations on real inputs, yet the intermediate steps of Cardano's formula would require complex numbers. The calculator selects the appropriate branch based on the sign of Δ. Dimensional analysis confirms the consistency of the substitution. If x has units of metres, then b/a has units of metres, so the shift b/(3a) has correct units. The parameter p then has units of metres squared, and q has units of metres cubed, making the depressed cubic dimensionally homogeneous. The discriminant Δ has units of metres to the sixth power, and its sign is dimensionless, as required for a classification criterion.

A worked example.

Example

Consider the cubic equation x³ − 7x + 6 = 0. The calculator first computes the depressed cubic parameters: p = (3(1)(−7) − 0²)/(3·1²) = −21/3 = −7, and q = (2·0³ − 9·1·0·(−7) + 27·1²·6)/(27·1³) = 162/27 = 6. The discriminant is Δ = (6/2)² + (−7/3)³ = 9 − 343/27 = (243 − 343)/27 = −100/27 ≈ −3.704. Because Δ < 0, the casus irreducibilis applies, and three distinct real roots exist. By inspection, x = 1 satisfies 1 − 7 + 6 = 0. Polynomial division yields (x − 1)(x² + x − 6) = (x − 1)(x − 2)(x + 3), giving roots x = 1, x = 2, and x = −3. The calculator returns these ordered as realRoot1 = 2, realRoot2 = 1, realRoot3 = −3, with distinctRealRoots = 3. The negative discriminant confirms that no rational root test was guaranteed to succeed, yet the equation still factors nicely over the integers.

a1
b0
c-7
d6

Frequently asked questions.

Why do cubic equations always have at least one real root?
A continuous real-valued function that tends to −∞ as x → −∞ and to +∞ as x → +∞ must cross the x-axis at least once, by the Intermediate Value Theorem. The cubic polynomial f(x) = ax³ + bx² + cx + d satisfies this condition because the leading term ax³ dominates for large |x|. Therefore, every cubic equation with real coefficients has at least one real root. The other two roots may be real or complex conjugates, but the first crossing is guaranteed. This is a special property of odd-degree polynomials; even-degree polynomials such as quadratics may have no real roots at all.
What is the casus irreducibilis?
The casus irreducibilis is the case of a cubic equation with three distinct real roots but a negative discriminant. In this situation, Cardano's formula requires taking the square root of a negative number and then extracting cube roots of complex expressions, even though the final answers are real. This was historically disturbing because it forced mathematicians to use complex numbers to obtain real results, at a time when complex numbers were not fully accepted. The trigonometric solution avoids complex intermediates by using inverse cosine, but it cannot be rewritten using only real radicals. The casus irreducibilis proves that complex numbers are inescapable in cubic algebra.
Can I factor a cubic without using Cardano's formula?
Sometimes. The rational root theorem states that any rational root p/q must have p dividing d and q dividing a. For cubics with integer coefficients and a rational root, this theorem finds the root immediately, allowing polynomial long division to reduce the cubic to a quadratic. However, if all roots are irrational or complex, the rational root theorem fails, and Cardano's method or numerical approximation is required. The calculator uses Cardano's algebraic method when exact roots are needed and falls back to numerical methods when algebraic complexity exceeds practical limits.
What does the cubic discriminant tell me?
The cubic discriminant Δ = (q/2)² + (p/3)³ classifies the root structure of the depressed cubic. When Δ > 0, there is one real root and two complex conjugate roots. When Δ = 0, all roots are real, and at least two are equal. When Δ < 0, there are three distinct real roots. Unlike the quadratic discriminant, which is a simple polynomial in the coefficients, the cubic discriminant is more complex, but its sign still provides complete qualitative information. The calculator computes Δ automatically and uses it to select the correct solution branch.
How are the roots ordered in the output?
When three real roots exist, the calculator orders them as realRoot1 ≥ realRoot2 ≥ realRoot3. When only one real root exists, realRoot1 contains that root, and realRoot2 and realRoot3 are set equal to realRoot1. This ordering convention is consistent with standard mathematical practice of listing roots from largest to smallest on the real line. Users should not assume that realRoot1 corresponds to any particular root of the depressed cubic; the ordering is purely by magnitude. For applications where root identity matters, such as modal analysis in structural engineering, users should verify which root corresponds to which physical mode.
Why must a be non-zero?
If a = 0, the equation bx² + cx + d = 0 is quadratic, not cubic. The degree of a polynomial is defined as the highest power with a non-zero coefficient, so setting a = 0 reduces the degree. The calculator's formulas for p, q, and the Tschirnhaus substitution all involve division by a, which would be undefined if a were zero. Users seeking to solve quadratic equations should use the shipped quadratic calculator instead. The validation rule ensures that the mathematical object being analyzed matches the tool's intended scope.
Are there exact formulas for quartic and quintic equations?
Yes for quartic, no for general quintic. Lodovico Ferrari discovered an exact solution for quartic equations shortly after Cardano's work on cubics. However, Niels Henrik Abel proved in 1824 that no general algebraic solution exists for polynomial equations of degree five or higher. This result, known as the Abel-Ruffini theorem, is a cornerstone of Galois theory. Cubic and quartic equations are therefore the highest-degree polynomials that can always be solved by radicals. The calculator handles only cubics, which occupy a unique position as the most complex solvable polynomial that is still practical for routine computation.
What numerical issues should I watch for?
When the discriminant is close to zero, the cubic is nearly degenerate, with two roots that are almost equal. In this case, Cardano's formula involves subtracting nearly equal quantities, leading to catastrophic cancellation and loss of precision. When p and q are both close to zero, the roots are all close to zero, and floating-point underflow can occur. The calculator mitigates these issues by using high-precision arithmetic for intermediate steps and by applying stability transformations when coefficients have wildly different magnitudes. Users should treat outputs with suspicion when |Δ| < 1e-12 and coefficients are large.
How do cubic equations appear in physics and engineering?
Cubic equations model three-body gravitational problems in certain restricted configurations, chemical equilibria with three species, and the characteristic equations of third-order linear differential equations. In electrical engineering, the impedance of some transmission line models satisfies a cubic. In structural engineering, the buckling loads of certain columns are roots of cubic polynomials. The common thread is that any physical system described by a third-order linear differential equation or a three-state Markov process will generate a cubic characteristic equation. The calculator helps practitioners find the eigenvalues or equilibrium points that govern system behavior.

References& sources.

  1. [1]NIST Digital Library of Mathematical Functions (2024). "Elementary Algebra." §1.11. https://dlmf.nist.gov/1.11
  2. [2]Burden, R.L. and Faires, J.D. (2011). Numerical Analysis, 9th ed. Cengage. ISBN 978-0538733519.
  3. [3]Cardano, G. (1545). Ars Magna. (English translation: The Rules of Algebra, Witmer, T.R., 1968, Dover).
  4. [4]Stewart, I. (2004). Galois Theory, 3rd ed. Chapman & Hall/CRC. ISBN 978-1584883937.
  5. [5]Dunham, W. (1990). Journey Through Genius: The Great Theorems of Mathematics. Penguin. ISBN 978-0140147391.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon