Cubic Equation Solver

This calculator solves any cubic equation of the form ax³ + bx² + cx + d = 0, finding all three roots exactly rather than leaving you to guess or plot the curve by hand. Cubic equations turn up throughout engineering, economics and pure maths whenever a variable is cubed, and while some factorise neatly, most do not, which is where a general method such as Cardano's method becomes useful. You enter the four coefficients a, b, c and d (a cannot be zero, or the equation becomes quadratic), and the tool normalises the equation, converts it to a depressed cubic, and works out the discriminant to determine what kind of roots to expect. The results panel shows all three roots, labelled real or complex, alongside the discriminant, the root type, and the depressed cubic values p and q. A verification panel substitutes each real root back into the original equation to confirm it evaluates to zero, and checks the roots sum to minus b over a as Vieta's formulas require. A working steps panel spells out each stage of the method so you can follow the algebra by hand, and a plain language verdict states whether you have three real roots, a repeated root, or one real root with a complex conjugate pair. Large coefficients may show tiny rounding noise in the last decimal place.

Calculate.co.nz is proud to be partnered with realtor.co.nz, a trusted resource for navigating the New Zealand property market. Their Helpful Articles section offers clear, well-structured insights across buying, selling, and building, making complex real estate topics more accessible. With a focus on up-to-date guidance and practical knowledge, they empower Kiwis to move forward with clarity and confidence in a constantly evolving property landscape.
Calculate.co.nz partner: realtor.co.nz
Verified method  Cardano's formula (Ars Magna, 1545) via the depressed cubic substitution. Results verified against standard algebraic factoring.

Enter Coefficients

The equation has the form ax³ + bx² + cx + d = 0. Enter each coefficient below. Fractions and decimals are accepted. Coefficient a must not be zero.

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

Roots of the Cubic Equation

Root 1 (x₁)
-
Root 2 (x₂)
-
Root 3 (x₃)
-

Discriminant and Root Type

Discriminant (Δ)-
Root type-
Depressed cubic (p)-
Depressed cubic (q)-

Verification (substitution check)

f(x₁)-
f(x₂)-
f(x₃)-
Sum of roots (= -b/a)-

Working Steps

Enter coefficients above to see working.
Result: Enter coefficients above.

How to Solve a Cubic Equation

A cubic equation has the general form ax³ + bx² + cx + d = 0 where a is not zero. Every cubic with real coefficients has exactly three roots (counting multiplicity) over the complex numbers, and at least one root is always real.

The most systematic analytical method is Cardano's formula, developed by Gerolamo Cardano and published in Ars Magna in 1545. It converts the general cubic to a simpler form called the depressed cubic (which has no x² term), then solves that using a substitution that reduces the problem to solving a quadratic.

Step-by-Step Method

  1. Divide by a to get a monic cubic: x³ + (b/a)x² + (c/a)x + (d/a) = 0. Call these new coefficients B, C, D.
  2. Substitute x = t - B/3 to eliminate the x² term. This gives the depressed cubic: t³ + pt + q = 0, where p = C - B²/3 and q = D + 2B³/27 - BC/3.
  3. Compute the discriminant of the depressed cubic: Δ = -4p³ - 27q².
  4. Apply Cardano's formula:
    • If Δ > 0: three distinct real roots (use the trigonometric method with arccos).
    • If Δ = 0: repeated root(s); at least two roots are equal.
    • If Δ < 0: one real root and two complex conjugate roots.
  5. Shift back: add -B/3 to each root t to recover x.

The Discriminant

Discriminant (Δ)Root typesDescription
Δ > 0Three distinct real rootsThe cubic crosses the x-axis three times
Δ = 0Repeated real root(s)The cubic touches the x-axis at a double or triple root
Δ < 0One real root, two complex conjugate rootsThe cubic crosses the x-axis once

Worked Example

Solve x³ - 6x² + 11x - 6 = 0 (coefficients a=1, b=-6, c=11, d=-6).

  1. Already monic. B = -6, C = 11, D = -6.
  2. Substitute x = t - B/3 = t + 2. Compute p = 11 - 36/3 = 11 - 12 = -1 and q = -6 + 2(-216)/27 - (-6)(11)/3 = -6 - 16 + 22 = 0.
  3. Discriminant: Δ = -4(-1)³ - 27(0)² = 4 - 0 = 4 > 0. Three distinct real roots.
  4. Because q = 0, the depressed cubic t³ - t = 0 factors as t(t² - 1) = 0, giving t = 0, t = 1, t = -1.
  5. Shift back: x = t + 2. The solver reports the roots in the order x₁ = 3, x₂ = 2, x₃ = 1 (the same set {1, 2, 3}).

Verification: (x-1)(x-2)(x-3) = x³ - 6x² + 11x - 6. Confirmed.

Vieta's Formulas (Sum and Product of Roots)

For ax³ + bx² + cx + d = 0 with roots x₁, x₂, x₃:

These relationships can be used to verify roots without substituting back into the equation.

Related Calculators

Sources and method: Cardano, G. Ars Magna (1545). Nickalls, R.W.D. "A new approach to solving the cubic: Cardano's solution revealed." The Mathematical Gazette, 77(480), 354-359 (1993). Abramowitz and Stegun, Handbook of Mathematical Functions (1972), Section 3.8.2. Complex root computation uses trigonometric form when Δ > 0 (three real roots, casus irreducibilis avoided).

This solver uses double-precision floating-point arithmetic. For coefficients with very large magnitudes, round-off error may affect the last few decimal places. The verification column shows f(x) evaluated at each root as a check; values very close to zero (e.g. 1e-13) confirm a correct root.

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-07-19 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.