HomeCalculatorsMathAlgebra & EquationsCubic Equation Calculator
Math calculator

Cubic Equation Calculator

Cardano / trigonometric closed form for a real cubic. Same engine as Polynomial Roots. Three real roots or one real plus a conjugate pair. Not Ferrari. Not a second cubic engine. Runs locally.

Instant result
Result

Enter values to calculate.

Inputs
Mode
Formula
Trust summary Engine tested · Specification checked · 21/21 tests · Production surface contract 1/1 · v1.2.0
Input interpretation
Enter values to calculate.
Result
Model
All three roots of a real cubic ax³+bx²+cx+d = 0 by Cardano / trigonometric closed form.
Scope
Real coefficients
Verification
Engine tested · 21/21 tests · Production surface contract 1/1 · Specification checked · v1.2.0
Named expert review
Optional · Not performed
Specification basis
  • ISO 80000-2:2019 Quantities and units — Mathematics
Specification basis
Evidence
7 golden · 6 boundary · 8 property · Production surface contract 1/1 · Artifact integrity PASS
Production
Embedded snapshot: unpublished · Build schema 1.2.0 ready · Semantic contract ✓ · Attestation report not published on origin · Live production status STALE (2 capabilities; 162 remain CURRENT) @ 2026-09-20T09:01:12.147Z
Semantic contract
PASS

Formulas

Core equations used by this calculator.

Depressed cubicx = t − b/(3a), t³ + p t + q = 0
Three real (Δ < 0)t_k = 2√(−p/3) cos(θ/3 − 2πk/3)
One real (Δ > 0)t = u + v, u³ + v³ = −q, 3uv = −p
iSquare-free cubics on real coefficients. Same engine as /polynomial-roots. Not /quadratic (discriminant/vertex). Not Ferrari quartic. Not CAS factoring. Float64.

How to use

1

Enter a, b, c, d

From ax³ + bx² + cx + d = 0 with a ≠ 0. All-roots of a general polynomial stays at /polynomial-roots.

2

Read every root

Three real roots when the depressed discriminant is negative. Otherwise one real root and a complex conjugate pair.

Example calculations

Common configurations with formula and result.

ϟ

Three real roots

(x−1)(x−2)(x−3) = 0

a=1, b=−6, c=11, d=−6
1, 2, 3
ϟ

One real root

x³ − 1 = 0

a=1, d=−1
1, −1/2 ± i√3/2

Cubic Equation calculator specification

Version 1.2.0 · Engine tested

Calculation status

Review policy · Evidence

Definition
ax³ + bx² + cx + d = 0 has three roots in the complex plane. This page is method=cardano on math.polynomial.roots. Depress to t³ + p t + q = 0, then Cardano or the trigonometric form. Not a second engine. Not Ferrari.
What it calculates
All three roots of a real cubic ax³+bx²+cx+d = 0 by Cardano / trigonometric closed form.
Inputs
  • a
  • b
  • c
  • d
Outputs
  • roots
  • degree
  • solver
  • cubic_case
  • residual_max
Formula
t³ + p t + q = 0 after x = t − b/(3a)
Assumptions
  • Real coefficients
  • a ≠ 0
  • Float64
  • Not a CAS
  • Not Ferrari as a product
Units
  • dimensionless
Boundary conditions
  • a = 0 → INVALID_INPUT
  • degree ≠ 3 with method=cardano → INVALID_INPUT
  • unknown method (including ferrari, quadratic, cas) → INVALID_MODE
Example
a=1 b=-6 c=11 d=-6 → 1, 2, 3
Validation cases

2 published on this page · 21/21 tests · Production surface contract 1/1 · View evidence

  • a=1 b=-6 c=11 d=-6 → 1, 2, 3
  • method=ferrari a=1 b=0 c=0 d=-1 → INVALID_MODE
Specification basis
  • ISO 80000-2:2019 Quantities and units — Mathematics
Calculation version
1.2.0
}

Frequently asked questions

Key distinctions behind the calculation.

Is this a second polynomial engine?

No. It is method=cardano on math.polynomial.roots, the same engine as /calc/math/polynomial-roots. Degree 4–8 still uses Durand–Kerner on that page.

Is this the quadratic formula page?

No. /calc/math/quadratic is ax²+bx+c with discriminant, vertex, and a parabola. This page is the cubic closed form.

Do you ship Ferrari’s quartic formula?

No. Quartic and higher stay Durand–Kerner on /polynomial-roots. Ferrari is INVALID_MODE.