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
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.
- Enter the leading coefficient a, which must be non-zero.
- Enter the quadratic coefficient b.
- Enter the linear coefficient c.
- Enter the constant term d.
- Verify that a is non-zero; the calculator rejects a = 0.
- Review the real roots displayed, ordered from largest to smallest.
- Check the cubic discriminant and number of distinct real roots to understand the solution structure.
The formula.
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.
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.
Frequently asked questions.
Why do cubic equations always have at least one real root?
What is the casus irreducibilis?
Can I factor a cubic without using Cardano's formula?
What does the cubic discriminant tell me?
How are the roots ordered in the output?
Why must a be non-zero?
Are there exact formulas for quartic and quintic equations?
What numerical issues should I watch for?
How do cubic equations appear in physics and engineering?
References& sources.
- [1]NIST Digital Library of Mathematical Functions (2024). "Elementary Algebra." §1.11. https://dlmf.nist.gov/1.11
- [2]Burden, R.L. and Faires, J.D. (2011). Numerical Analysis, 9th ed. Cengage. ISBN 978-0538733519.
- [3]Cardano, G. (1545). Ars Magna. (English translation: The Rules of Algebra, Witmer, T.R., 1968, Dover).
- [4]Stewart, I. (2004). Galois Theory, 3rd ed. Chapman & Hall/CRC. ISBN 978-1584883937.
- [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