HomeCalculatorsMathAlgebra & EquationsCubic Equation Calculator
Math calculator

Cubic Equation Calculator

Solve real cubic equations with Cardano and trigonometric forms. Inspect all three roots, repeated roots, numerical limits, share inputs, and export results.

Instant result
Result
—

Enter values to calculate.

Inputs—
Mode—
Formula—
Trust summary CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · all published methods
Input interpretation
Enter values to calculate.
Result
—
Verified scope
all published methods
Assurance
Core
Declared partition coverage
PASS · 4/4 declared partitions (all-roots, cardano, evaluate, invalid-domain) · Matrix
Numerical scope
67 listed independent full-pack vectors only
Known limitations
  • Core CVP does not include live graph, viewport, or pointer interaction.
Model
All three roots of a real cubic ax³+bx²+cx+d = 0 by Cardano / trigonometric closed form, with an engine-linked figure of p and the real roots.
Scope
The Result Card includes an engine-linked figure of p (markers are published real roots on y=0; complex roots stay off the real plane). Same Horner nesting as REST/MCP. Curve samples are not a REST field.
Verification
Engine tested · Source checked · v1.2.2 · CVP VERIFIED · CVP protocol 1.0.0-proposed · Core assurance · all published methods· View Manifest · CVP overview · Specification
Versions
Calculation 1.2.2 · CVP protocol 1.0.0-proposed · Evidence 2026-10-28.metric-scope-v3
Verification revision
2026-10-28.metric-scope-v3 · 3/3 property · digest eca488fa2ce7
Legacy regression
21/21 tests · Production surface contract 6/6
Trust layers
Verification VERIFIED · Production CURRENT · Overall CVP state: VERIFIED under CVP 1.0.0-proposed
Reference
O1 model · O2 expected_values · O2 numerical_behavior
Interfaces
PASS · UI (SSR) / REST / MCP — ui-ssr is query-result HTML, not a live browser session. Error-path engine·REST·MCP 28/28 (status, code, calculation_version). SSR compared on URL-canonical requested calculations; empty query is idle (not an error) and JSON-typed object/array inputs are REST/MCP-only.
Supplemental domain review
Not performed
Named expert review
Not performed
CVP suite
67/67 golden · 3/3 CVP boundary · 34/34 invalid · 3/3 property · 2/2 metamorphic · 95/95 cross-interface · 1/1 cross-calculator · 6/6 CVP contract · Manifest
Evidence
7 legacy golden · 6 legacy boundary · legacy regression suite · 67/67 oracle-backed golden · 34/34 invalid · Artifact integrity PASS
This calculator CURRENT · Public schema 1.2.2 matches · Semantic contract ✓ · Production attested · Public/cache ✓ · Origin ✓
Semantic contract
PASS
Full verification

Manifest identity, reference classes, interfaces, suite, and production records.

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. The figure shows p and the real roots on y=0.

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.2 · 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, with an engine-linked figure of p and the real roots.
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
  • The Result Card includes an engine-linked figure of p (markers are published real roots on y=0; complex roots stay off the real plane). Same Horner nesting as REST/MCP. Curve samples are not a REST field.
  • 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 6/6 · 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
Sources
Calculation version
1.2.2

Background

Interpretation and common distinctions.

What does this cubic equation calculator compute?

ax³ + bx² + cx + d = 0 has three roots in the complex plane.

The published formula or method is t³ + p t + q = 0 after x = t − b/(3a). The following references support the stated mathematics or method:

  • NIST DLMF §3.8 — Nonlinear Equations: Iterative root finding, convergence considerations, and polynomial-root methods.
  • NumPy — numpy.polynomial.polynomial.polyval: Polynomial evaluation using Horner’s method; NumPy’s documented coefficients are in ascending degree order. CalculatorX’s input order must follow its own specification. Mathematical reference only; not validation or endorsement of this implementation.

Which inputs and limits should you check?

Follow the input domain, units, branch or solve direction, and rounding policy in the specification. Preserve exact outputs and any additional candidates or warnings.

The worked example uses (x−1)(x−2)(x−3) = 0 with a=1, b=−6, c=11, d=−6. Compare it with the Example calculations and the complete result for the same inputs.

How can you verify and cite this result?

CalculatorX is responsible for this page. The mathematical references above explain the model; implementation checks and their scope are documented separately in the math.polynomial.roots v1.2.2 Evidence and capability contract. Read the displayed verification and production state together with the specification's numerical limits.

Use the clean calculator URL to cite the tool. A shared input link identifies a particular calculation. Content updates, numerical verification, and domain reviews have separate dates and scopes.

Numerical scope and interpretation

Coefficients are constant first, finite real binary64 values, with degree 1–8 and a nonzero leading coefficient. Decimal/scientific strings are limited to 512 characters per token and 4608 characters per coefficient list. Arrays contain 2–9 entries. A nonzero textual number that rounds to zero is rejected with NUMERIC_UNDERFLOW; invalid numbers, unknown fields, conflicting aliases, and inapplicable evaluation inputs are rejected. The cubic page locks Cardano; the evaluation page locks Horner.

The accepted binary64 coefficients define the polynomial. Exact rational square-free decomposition preserves its repeated-root multiplicities. Stable closed forms handle degree 1–3; higher degrees use scaled, bounded iteration with exact real-root isolation. Each square-free factor must pass disjoint exact rational Weierstrass/Gershgorin inclusion disks, a relative L1 inclusion-error budget of 2e-10, and normalized residual at most 2e-12. A small residual alone does not establish a complete root set. Overlapping disks or exhausted iteration reject NON_CONVERGENCE; difficult finite inputs need not succeed. Exact arithmetic is bounded to 16384 bits; iteration is limited to two attempts of 2048 steps and real isolation to 512 levels / 4096 steps.

Horner evaluation uses exact rational arithmetic on the accepted binary64 inputs and rounds once to binary64. Unrepresentable nonzero roots or values reject overflow/underflow. residual_max is the largest unscaled Euclidean |p(z)|, or null if its binary64 projection is outside range. normalized_residual uses (|Re p|+|Im p|) / Σ |cᵢ|(|Re z|+|Im z|)ⁱ. The exact depressed cubic discriminant determines cubic_case; delta can be null when projection loses range. Rounded zero residuals do not prove exact roots.

Independent CPython Fraction factor constructions and Decimal250/750 references check 67 complete result packs, root multiplicities and returned-root diagnostics. The fixed-vector root budget is 4e-10 relative L2 plus two subnormal quanta; exact zero roots remain zero and Horner values are checked within one ULP. These tests do not establish accuracy for every possible input or identical results across runtimes. Closely spaced roots can be highly sensitive to coefficient changes.

The real curve uses the same exact Horner evaluator. Complex roots are listed outside the real plane; repeated roots retain multiplicity in the result. The graph is omitted with a text explanation when finite coordinates or labels cannot be distinguished. Scalar results and native CSV/JSON exports retain the full result pack and raw inputs without snapping small nonzero roots to zero.

Typing computes locally. Share URLs and REST/MCP requests transmit inputs and may enter browser, server, or intermediary logs. Avoid confidential values in shared URLs. See NIST DLMF polynomial definitions and evaluation and Neumaier–Polzer polynomial zero enclosures for mathematical background; implementation checks are independent of these references.

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.