Understanding the polynomial root finder — concept and principle
This tool finds all roots, real and complex, of a polynomial of any degree. You enter the coefficients from the highest power down to the constant, and it returns n roots for a degree-n polynomial. Beyond degree 4 there is no general formula in radicals (Abel-Ruffini theorem), so numerical methods are the standard way to solve such equations in engineering, control theory, signal processing and physics.
How it is calculated
- Leading zeros are removed and every coefficient is divided by the leading one, so the polynomial is monic: p(z) = zⁿ + c₁zⁿ⁻¹ + … + cₙ.
- The method starts from n different complex guesses spread around a circle.
- Durand-Kerner (Weierstrass) iteration updates every guess at once: zᵢ ← zᵢ − p(zᵢ) ÷ ∏(zᵢ − zⱼ), the product taken over all j ≠ i. p(zᵢ) is evaluated with Horner's method.
- After 500 rounds the roots are shown to 8 significant digits; an imaginary part below 10⁻⁹ is treated as zero and the root is shown as real.
The principle
A monic polynomial of degree n factors completely as p(z) = (z − r₁)(z − r₂)…(z − rₙ) (fundamental theorem of algebra). If all guesses except zᵢ were already exact roots, then p(zᵢ) ÷ ∏(zᵢ − zⱼ) would equal exactly zᵢ − rᵢ, so one step would land on the root. Applying this correction to all guesses together pulls each one toward a different root, and the denominator keeps them from collapsing onto the same root. Near simple roots convergence is quadratic: the number of correct digits roughly doubles each round.
Worked example
- Input: 1 0 −7 6, meaning p(x) = x³ − 7x + 6 (the x² coefficient is 0).
- The polynomial is already monic, so three starting guesses are iterated.
- The guesses converge to 2, −3 and 1.
- The calculator sorts the roots from smallest to largest. Result: −3, 1, 2.
- Check: p(1) = 1 − 7 + 6 = 0, so (x − 1) is a factor; dividing gives x² + x − 6 = (x − 2)(x + 3).
How to read the result
Roots appear in the order the iteration settles, not sorted. Complex roots of a real polynomial come in conjugate pairs a ± bi. Vieta's formulas give a quick check: the roots sum to −(second coefficient ÷ first), here 2 − 3 + 1 = 0.
Common mistakes
- Leaving out zero coefficients, which shifts every power. x³ − 7x + 6 must be entered as 1 0 −7 6.
- Entering coefficients from the constant upward.
- Expecting exact values such as √2; the output is a decimal approximation.
Frequently asked questions
Why does a degree-n polynomial always have n roots?
By the fundamental theorem of algebra, counted with multiplicity and allowing complex numbers.
Is there a formula for quintic equations?
Not in general. The Abel-Ruffini theorem shows that no formula using only arithmetic and radicals solves every polynomial of degree 5 or higher.
How do I find only the real roots?
Take the roots shown without an i term.
Sources: E. Durand, Solutions numériques des équations algébriques, Masson, 1960 · I. O. Kerner, Ein Gesamtschrittverfahren zur Berechnung der Nullstellen von Polynomen, Numerische Mathematik 8 (1966)