Cubic Equation Solver
Find all roots of a cubic numerically with Durand-Kerner, printing real roots and complex pairs to a stated tolerance.
Cubic Equation Solver
Find all roots of a cubic numerically with Durand-Kerner, printing real roots and complex pairs to a stated tolerance.
How this page computes
The page normalizes the cubic, runs Durand-Kerner iteration on the complex plane and sorts the roots. It prints numeric roots only; no radical expression is produced, and repeated roots may appear as a cluster.
The calculation runs entirely in this browser tab; nothing is uploaded.
The page finds all three roots of a cubic numerically and prints them, including complex pairs. Worked example: x^3 - 6x^2 + 11x - 6 has roots 1, 2 and 3.
The roots are numeric, computed by Durand-Kerner iteration to a stated tolerance. The page does not print a Cardano radical expression, and it warns that a repeated root may appear as a cluster rather than one exact value.
How to use the Cubic Equation Solver
Enter the four coefficients a, b, c and d of a*x^3 + b*x^2 + c*x + d, highest power first, then press Run.
The output restates the polynomial and lists three roots. A complex root is printed with its imaginary part and its conjugate appears in the list, because real coefficients produce conjugate pairs.
How the numeric roots are found
Durand-Kerner starts from three points on a circle in the complex plane and iterates each estimate toward a root using the polynomial divided by the product of its distances to the other estimates. The iteration stops when every step is below the tolerance.
The result is a numerical root set, not a symbolic factorization. A multiple root slows the iteration and can leave a small cluster, which the page names rather than hiding.
What to Expect
Best for
- Finding all roots of a cubic quickly
- Seeing a complex conjugate pair
- Checking a rational-root guess
Not ideal for
- A symbolic radical expression
- A proof that the roots are exact
- A polynomial of degree five
What this tool keeps
- The four coefficients and all three roots
What may need cleanup
- Roots are numeric to the stated tolerance; round them for display
Common errors
- A zero leading coefficient is refused as not a cubic
- A non-numeric coefficient is refused by name
Example use cases
- Solve x^3 - 6x^2 + 11x - 6
- Solve a cubic with one real and two complex roots
Sample input
1 -6 11 -6
Sample output
cubic x^3 - 6x^2 + 11x - 6 = 0 roots (numeric, tolerance 1e-7; repeated roots may form a cluster): x1 = 1 x2 = 2 x3 = 3
Who this is for
- Students checking cubic roots
- Readers exploring complex roots
Frequently asked questions
Why not use the cubic formula?
The Cardano formula is long, and for three real roots it hides complex intermediate values. Durand-Kerner gives the same root set numerically and states its tolerance, which is easier to check and harder to misread.
Why might a repeated root look like a cluster?
Durand-Kerner converges linearly at a multiple root, so several estimates can sit a small distance apart. The page warns about that pattern instead of printing one value as if it were exact.
Are complex roots included?
Yes. A real cubic always has at least one real root, and the other two are either real or a complex conjugate pair. The page lists all three with their imaginary parts.
Is anything uploaded?
Nothing is uploaded. The iteration runs in this browser tab with JavaScript, and reloading the page discards the coefficients and the roots.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.