Skip to content
AZ Tools

Polynomial Root Finder (Cubic, Quartic & Beyond)

Find all real and complex roots of a polynomial up to degree 30 — cubic, quartic or higher — with multiplicities, the factored form and a residual check.

Coefficients: [1, -6, 11, -6] · degree 3 · 3 real, 0 complex (counted with multiplicity)

Roots

RootReal partImaginary partMultiplicityResidual
11010.0e+0
22010.0e+0
33010.0e+0
Factored over the reals
(x − 1)(x − 2)(x − 3)

Vieta check: sum of roots 6 (should be 6) · product 6 (should be 6)

Checked against sympy's parser and exact roots and mpmath's 50-digit polyroots. Runs in your browser.

How to use

  1. Type the polynomial in x, using ^ for powers and implicit multiplication (2x, 3(x+1), (x-1)(x+2)), or list the coefficients from the highest power down.
  2. Check the parsed coefficients and degree shown under the box.
  3. Read the roots with their multiplicity and residual, the factored form, and the Vieta check.

About this tool

Show

Type a polynomial as you would write it — x^3 - 6x^2 + 11x - 6, (x-1)^2(x+3), 3(x+0.5)^2 - 12 — or as a list of coefficients from the highest power down, and this finds every root, real and complex, for any degree up to 30. Beyond the quadratic formula there are closed forms for cubics and quartics, but they are unwieldy and numerically fragile, and from degree five there are none at all (Abel–Ruffini), so this uses the Aberth–Ehrlich method: all roots are refined together from a circle of starting points until none of them moves by more than a few units in the last place. Each root is listed with its residual — |p(z)| relative to the size of the terms, so a value near 10⁻¹⁶ means the root is as exact as double precision allows — and the polynomial is written back in factored form over the reals, with a quadratic factor for each pair of complex conjugate roots. Sum and product of the roots are compared with the coefficients (Vieta's formulas) as a further check. Repeated roots deserve a warning. A double root can only be located to about 10⁻⁸ and a triple root to about 10⁻⁵ in floating point, because the polynomial is flat there; the tool recognises roots that coincide to within that accuracy, reports them once with their multiplicity, and recovers nearly full precision by refining the value as a simple root of the (m − 1)th derivative. Some polynomials are simply ill-conditioned: in Wilkinson's famous example, the product of (x − k) for k = 1 to 20, changing the x¹⁹ coefficient from −210 by just 2⁻²³ — about one part in two billion — turns ten of its real roots into five complex pairs, some with imaginary parts near 3. Coefficients are real numbers; complex coefficients are not supported.

Frequently asked questions

Is there a formula for the roots of a quintic?

No. The Abel–Ruffini theorem shows there is no general formula in radicals for degree five or higher, which is why the tool finds roots numerically. For cubics and quartics formulas exist but lose accuracy in floating point; the numerical method is both simpler and more accurate.

Why does a repeated root come out slightly different?

Near a double root the polynomial is flat, so rounding errors of 10⁻¹⁶ in its value shift the root by about 10⁻⁸; for a triple root by about 10⁻⁵. The tool groups roots that coincide to within that accuracy, shows their multiplicity, and then refines the value as a simple root of the (m − 1)th derivative, which restores nearly full precision.

What does the residual column mean?

It is |p(z)| divided by the sum of the magnitudes of the terms at z — the relative size of what is left over. Values around 10⁻¹⁶ to 10⁻¹⁴ mean the root is correct to working precision; a larger value flags a root that could not be pinned down, usually because the polynomial is ill-conditioned.

How do I enter a polynomial?

Either as an expression in x — powers with ^ or **, implicit multiplication such as 2x or (x-1)(x+2), and brackets raised to powers — or as coefficients from the highest degree down separated by commas or spaces: 1, -6, 11, -6 is x³ − 6x² + 11x − 6. Missing powers need a 0 in the list.

Why are complex roots in pairs?

Because the coefficients are real, complex roots always come as conjugate pairs a ± bi. Each pair multiplies out to the real quadratic x² − 2ax + (a² + b²), which is how they appear in the factored form.

Related tools