Cubic Equation Calculator - Real, Complex, Repeated Roots
Use the cubic equation calculator to enter coefficients a, b, c, d and solve ax^3+bx^2+cx+d=0 with real, complex, and repeated roots using Cardano's formula.
Cubic Equation Calculator
Results
What Is a Cubic Equation Calculator?
A cubic equation calculator solves any polynomial equation of the form ax³+bx²+cx+d=0 and returns all three roots—real, repeated, or complex conjugate—along with the cubic discriminant and a plain-language solution type. This solver handles every case that the Cardano closed-form formula can describe, including repeated roots, three distinct real roots, and the casus irreducibilis where intermediate cube roots go through the complex numbers even though the final answers are real.
- • Algebra and precalculus homework: Verify the roots of ax³+bx²+cx+d=0 quickly while learning Cardano formula in class.
- • Engineering root-finding: Find the volume or load roots that drive a cubic design equation in mechanical, civil, or chemical engineering.
- • Curve sketching: Locate the x-intercepts of a cubic polynomial to sketch or analyze its graph.
- • Numerical-method benchmarking: Compare Newton's method, Vieta substitution, and direct Cardano method against a closed-form reference.
A cubic equation is a degree-3 polynomial, and the fundamental theorem of algebra means there are exactly three roots counting multiplicity, but those roots can be real, repeated, or appear as a complex conjugate pair. The solver applies Cardano formula so you do not need to memorize the depressed-cubic substitution or the trigonometric form needed for the casus irreducibilis. The tool also reports the cubic discriminant, which is the cleanest single number that tells you whether to expect three real roots, one real root plus two complex ones, or a repeated root.
Use this solver any time you have ax³+bx²+cx+d=0 with real coefficients and want every root without doing the algebra by hand. The default sample values (1, -6, 11, -6) are the canonical (x-1)(x-2)(x-3) example, so the result panel shows x = 1, 2, 3 the first time the page loads.
For the lower-degree cousin of this problem, the Quadratic Formula Calculator covers the discriminant and vertex for ax squared plus bx plus c equals 0 in the same result-panel format.
How the Cubic Equation Calculator Works
The solver normalizes the equation so the leading coefficient is 1, applies the depressed-cubic substitution t = x + b/(3a) to remove the x² term, and then solves the resulting t³+Pt+Q=0 with Cardano formula. The trigonometric branch is used when the depressed-cubic discriminant is positive and the casus irreducibilis would otherwise force complex intermediate arithmetic.
- a: Leading coefficient of x cubed. Must be non-zero; the solver rejects a = 0 with a validation error.
- b: Coefficient of x squared. After normalization it sets the shift used in the depressed-cubic substitution.
- c: Coefficient of x. Combined with the normalized b and d to build the depressed-cubic coefficient P.
- d: Constant term. Combined with the normalized b and c to build the depressed-cubic coefficient Q.
The depressed-cubic substitution eliminates the x squared term and turns the problem into a simpler equation with only t and t cubed terms. Once the calculator recovers the three t-roots, it subtracts the shift p/3 to map them back to the original x-variable. According to Wolfram MathWorld, this depressed-then-solve pipeline is exactly the procedure Gerolamo Cardano published in Ars Magna in 1545, and it is the fastest closed-form way to get all three roots at once.
Worked Example: x³ - 6x² + 11x - 6 = 0
a = 1, b = -6, c = 11, d = -6
Normalize: p = -6, q = 11, r = -6. P = 11 - 36/3 = -1, Q = 2(-216)/27 - (-6)(11)/3 + (-6) = 0. Discriminant = -4(-1)³ - 27(0)² = 4 > 0, so the trigonometric branch fires with m = 2√(1/3) and θ = (1/3)arccos(0) = π/6.
x₁ = 1, x₂ = 2, x₃ = 3 (sorted ascending), discriminant = 4, solution type = Three Real Roots.
The three real roots match the factor (x-1)(x-2)(x-3), confirming that the solver is correctly applying Cardano formula and recovering every x-intercept.
According to Wolfram MathWorld, a general cubic ax^3+bx^2+cx+d=0 is reduced to the depressed cubic t^3+Pt+Q=0 by substituting x = t - b/(3a) and is then solved with Cardano's closed-form expression involving cube roots of Q/2 plus or minus the square root of the discriminant.
When you already know one root r of the cubic, divide ax cubed plus bx squared plus cx plus d by (x minus r) on the Polynomial Division Calculator to reduce the problem to a quadratic you can finish by inspection.
Key Concepts Explained
Four ideas drive this solver: Cardano formula, the depressed-cubic substitution, the cubic discriminant, and the casus irreducibilis. Mastering these terms makes the result panel easy to interpret.
Cardano Formula
A closed-form expression that recovers the three roots of a depressed cubic t³+Pt+Q=0 by combining two real cube roots. The solver uses it as the primary solver for the one-real-root case.
Depressed Cubic
A cubic with no t squared term, written t³+Pt+Q=0. The substitution t = x + b/(3a) converts any general cubic into this cleaner form and is the algebraic backbone of Cardano method.
Cubic Discriminant
The quantity Δ = -4P³-27Q² in the depressed form, equivalent to 18abcd-4b³d+b²c²-4ac³-27a²d² in the original coefficients. Its sign classifies the root structure: positive for three real roots, zero for repeated roots, and negative for one real plus a complex conjugate pair.
Casus Irreducibilis
The historical name for the situation where the cubic has three real roots but the direct cube-root expression forces complex intermediate values. The solver avoids the issue by switching to the trigonometric (Viete) form whenever the discriminant is positive.
If the cubic equation calculator returns a+bi and a-bi roots, the Complex Number Calculator is the right follow-up for arithmetic with those complex conjugates.
How to Use the Cubic Equation Calculator
Enter the four coefficients, watch the result panel update, and copy the formatted roots into your homework or design notes. The default sample is the canonical (x-1)(x-2)(x-3) cubic so you can see a finished result immediately.
- 1 Enter the coefficient of x cubed: Type the value of a into the first field. The solver rejects a = 0 with an inline error because a degree-3 equation needs a non-zero leading coefficient.
- 2 Enter the coefficient of x squared: Type the value of b. This is the term the depressed-cubic substitution will eliminate with the shift p/3.
- 3 Enter the coefficient of x: Type the value of c. The calculator uses it to build the depressed-cubic coefficient P and the cubic discriminant.
- 4 Enter the constant term: Type the value of d. The product of the three roots is -d/a, so the solver will recover values that match this identity to four decimal places.
- 5 Read the roots and discriminant: The result panel shows x₁, x₂, x₃, the cubic discriminant, and a plain-language solution type. Complex roots appear as a+bi / a-bi strings.
- 6 Use Reset to start over: Press Reset to restore the (1, -6, 11, -6) defaults or to clear a faulty input before trying a new equation.
Practical usage: a student verifying x³ - 6x² + 11x - 6 = 0 types 1, -6, 11, -6, sees 1, 2, 3 in the result panel, and confirms the discriminant of 4 against their textbook entry. An engineer solving 2x³ - 12x² + 22x - 12 = 0 leaves the same numbers with a = 2 and the solver still reports 1, 2, 3, demonstrating that scaling the polynomial does not change the roots.
After you have the three real roots, plot the cubic on the Polynomial Graphing Calculator to see each root land on the x-axis and confirm the result visually.
Benefits of Using This Cubic Equation Calculator
This tool saves time on the algebra, surfaces the discriminant and solution type, and makes the casus irreducibilis case just as easy to read as the ordinary three-real-root case.
- • All three roots in one pass: Cardano formula returns every root at once, so this tool saves you from doing long division, synthetic division, or repeated guess-and-check by hand.
- • Discriminant built in: The cubic discriminant is reported as a numeric field, so you do not have to remember the 18abcd-4b³d+b²c²-4ac³-27a²d² formula to know whether to expect real or complex answers.
- • Casus irreducibilis handled automatically: When the depressed-cubic discriminant is positive and the trigonometric form is more stable, the calculator switches branches so the result panel never returns complex garbage for a real problem.
- • Repeated-root detection: A near-zero discriminant triggers the double/triple-root branch, so the solver reports the multiplicity of each root instead of silently merging them.
- • Mobile-friendly output: The result panel is two-column on tablet and desktop, one-column on phones, and the Submit button scrolls the mobile view to the results.
- • Verifiable by hand: Every value comes from Cardano formula and Vieta formulas, so this tool is a reliable reference for textbook problems and engineering design checks.
When the cubic is part of a larger system where one equation is linear in x, the System of Equations Calculator can solve the linear piece while the cubic equation calculator handles the nonlinear one.
Factors That Affect Your Results
This tool is built on Cardano closed-form formula, so the results depend on the leading coefficient being non-zero, on the discriminant sign, and on the precision used for the trigonometric branch.
Leading coefficient a
When a = 0 the equation is no longer cubic. The solver surfaces a validation error so you know to switch to a quadratic solver for the same coefficients.
Cubic discriminant sign
Positive discriminant triggers the trigonometric (Viete) form and yields three real roots; negative discriminant yields one real root plus a complex conjugate pair; zero discriminant yields a double or triple root.
Magnitude of the coefficients
Large coefficients can make the depressed-cubic P and Q very large, which can magnify floating-point error. The solver rounds to 4 decimal places so the panel stays readable even when the underlying values are large.
Floating-point precision
The trigonometric branch uses an arccos call whose argument is clamped to [-1, 1] to avoid NaN values, but rounding to 4 decimal places is the most reliable way to read the result panel at a glance.
Real vs. complex output
When the discriminant is negative the calculator reports the complex roots as a+bi and a-bi strings; the real root is still a number you can plug into the original polynomial to check.
- • This tool handles real coefficients only. If you need a cubic with complex coefficients you will need a more general polynomial solver.
- • Results are rounded to 4 decimal places. If your work demands more precision, recompute Cardano formula with higher-precision arithmetic and compare against the panel.
According to Wikipedia, the cubic discriminant Delta = 18abcd - 4b^3d + b^2c^2 - 4ac^3 - 27a^2d^2 is positive when three distinct real roots exist, zero when there is a multiple root, and negative when exactly one real root and two non-real complex conjugate roots exist.
Frequently Asked Questions
Q: How do you solve a cubic equation?
A: Normalize ax³+bx²+cx+d=0 by dividing by a, then substitute x = t - b/(3a) to remove the x² term and obtain the depressed cubic t³+Pt+Q=0. Apply Cardano formula to get the three t-roots, and finally add back the shift b/(3a) to recover the original x-roots.
Q: What is Cardano formula?
A: Cardano formula is a closed-form expression that solves the depressed cubic t³+Pt+Q=0 by combining two cube roots, u = ∛(-Q/2 + √((Q/2)²+(P/3)³)) and v = ∛(-Q/2 - √((Q/2)²+(P/3)³)), and reports the real root as u+v. The full set of three roots is recovered using the cubic roots of unity.
Q: Can a cubic equation have three real roots?
A: Yes. Whenever the cubic discriminant Δ = 18abcd-4b³d+b²c²-4ac³-27a²d² is positive, the equation has three distinct real roots. For example, x³-6x²+11x-6=0 factors as (x-1)(x-2)(x-3) and the solver confirms roots 1, 2, 3 with discriminant 4.
Q: How do you find the discriminant of a cubic equation?
A: Use the formula Δ = 18abcd-4b³d+b²c²-4ac³-27a²d². Plug in the four coefficients a, b, c, d. A positive value means three real roots, zero means at least one repeated root, and a negative value means one real root plus a complex conjugate pair.
Q: What does a negative discriminant mean for a cubic?
A: A negative cubic discriminant means the equation has exactly one real root and two non-real complex conjugate roots. The cubic equation calculator still finds the real root as a number and reports the complex pair as a+bi and a-bi strings in the result panel.
Q: Why does a cubic always have at least one real root?
A: Every real polynomial of odd degree crosses the x-axis at least once, so ax³+bx²+cx+d=0 with non-zero a must have at least one real root. The other two roots may be real or form a complex conjugate pair, which is why this solver always reports a real value for x₁.