Polynomial Root Solver

Find every real and complex root of a polynomial from an expanded expression or coefficient list, with residuals and convergence checks.

Polynomial

Enter the polynomial as
Use one variable and non-negative whole-number powers, already expanded. Terms may appear on either side of =.

Valid range: degree 1–20, |coefficient| ≤ 1e100, fractions allowed, and 4–12 displayed decimal places.

More places tighten the stopping test; they cannot recover precision lost in the coefficients.
Try a polynomial

Root set

Your roots will appear here

Enter an expanded polynomial or its coefficients, then find all roots.

Enter a polynomial to begin.

Your polynomial and every calculation stay in this browser and are never uploaded.

FAQ

How are higher-degree roots found?

The solver starts from several deterministic sets of complex guesses and improves every guess at once with the Ehrlich–Aberth update. Horner’s method evaluates the polynomial and its derivative efficiently, and each returned root is substituted back into the original polynomial for a scale-independent residual check.

Are these exact roots?

No. Except for a linear equation, the displayed roots are numerical approximations. Degrees above 4 have no general formula in radicals, and even lower-degree formulas can lose accuracy on difficult coefficients. Use the residual and sensitivity warning to judge the approximation; use the quadratic calculator when you need exact fractions or radicals for a degree-2 equation.

Why are repeated roots less stable?

At a repeated root, both the polynomial and its derivative are zero. That weakens the correction step, so tiny coefficient changes can split one repeated root into several nearby roots. The solver groups roots only when their numerical values coincide closely and keeps the multiplicity visible.

What can I enter?

Use real, dimensionless coefficients and one variable with whole-number powers up to 20. The expression must already be expanded, but terms can be out of order or appear on both sides of an equals sign. The coefficient list runs from the highest power to the constant and must include zeros for missing powers.

Finding the roots of a polynomial equation is a fundamental task in algebra, engineering, and scientific computing. While low-degree polynomials can be solved using exact algebraic formulas, higher-degree polynomials require numerical approximation methods. The Polynomial Root Solver is designed to find all real, complex, and repeated roots of a polynomial of degree 1 to 20.

By utilizing advanced numerical algorithms, the solver calculates roots, performs residuals and convergence checks, and maps the results visually. All calculations and polynomial inputs stay entirely within the user's browser and are never uploaded to any external server.

Input Methods and Configuration

The solver accommodates different workflows by offering two distinct input modes under the label "Enter the polynomial as":

  • Expanded expression: This mode accepts an expanded single-variable equation or expression. Terms can appear on either side of an equals sign, such as x^5 - x = 0.
  • Coefficient list: This mode accepts a list of dimensionless real numbers separated by commas, spaces, or newlines. The coefficients must be ordered from the highest power down to the constant term, and users must include 0 for every missing power.

Input Constraints and Rules

To ensure mathematical stability and successful execution, the input must adhere to the following rules:

  • Degree Limits: The polynomial must have an effective degree from 1 to 20.
  • Coefficient Limits: Coefficients must be dimensionless real numbers with an absolute value less than or equal to 1e100 (|coefficient| ≤ 1e100). Fractions (such as 3/4) are allowed, but a fraction cannot have 0 in the denominator.
  • Formatting: The input text must be under 600 characters. Parentheses are not supported; users must expand all parentheses first so every power has an explicit coefficient. Only one variable can be used.
  • Precision Control: The "Displayed decimal places" input accepts values from 4 to 12. Higher decimal settings tighten the mathematical stopping test during iteration, though they cannot recover precision lost in the initial coefficients.

For a quick start, the tool provides pre-set examples under "Try a polynomial", including "Five roots", "Four complex roots", and "Repeated root".

Numerical Methodology and Algorithms

The solver selects its mathematical approach based on the degree of the input polynomial.

Direct Linear Solution

For a degree-1 equation, the solver bypasses iterative approximation and applies a direct linear solution to find the single root.

Ehrlich–Aberth Iteration

For polynomials of degree 2 through 20, the solver employs the Ehrlich–Aberth iteration. This is an iterative root-finding method that updates all root guesses simultaneously.

  1. Standard Form: The solver collects the terms into standard form.
  2. Normalization: Every coefficient is divided by the leading coefficient to normalize the polynomial.
  3. Scaling: The root search is scaled by a factor R so that the initial guesses stay within a stable numerical range.
  4. Simultaneous Update: Starting from deterministic sets of complex guesses, the algorithm updates all guesses together. It utilizes Horner's method to evaluate both the polynomial and its derivative efficiently at each step. Iteration continues until the correction step falls below the tolerance dictated by the display precision.

Verification and Residuals

Once the iteration terminates, the solver substitutes every calculated root back into the polynomial to perform a numerical check. It calculates a scale-independent, normalized residual for each root to verify the accuracy of the approximation.

Understanding Solver Outputs

The results are organized into several diagnostic and visual panels:

  • Root set: Displays the polynomial in its standard form, the total root count (counting multiplicity), and the list of calculated roots. If a root is repeated, its specific multiplicity is displayed. Each root is accompanied by its individual normalized residual. A "Copy roots" button allows users to copy the results.
  • Roots on the complex plane: A visual plot that maps the real and complex roots geometrically, helping users analyze root behavior and symmetry.
  • Numerical check: A diagnostics panel showing the effective degree, the method used, the display precision, the number of iterations, the starting sets tried, and the largest normalized residual.
  • Algorithm and substitution: A step-by-step breakdown detailing the standard form, the leading coefficient used for normalization, the scaling factor R, the final iteration count, and the verification residuals.

Special Cases and Warnings

  • Zero Polynomial: If the input represents a zero polynomial, the tool displays: "Every complex number is a root of the zero polynomial."
  • Non-Zero Constant: If the input is a non-zero constant, the tool displays: "A non-zero constant never equals 0, so this polynomial has no roots."
  • Sensitivity Warning: When roots are closely spaced or repeated, the numerical system becomes highly sensitive. In such cases, the solver displays a warning: "Roots were found, but repeated or closely spaced roots make some displayed digits sensitive to small coefficient changes."

Frequently Asked Questions

How are higher-degree roots found?

The solver starts from several deterministic sets of complex guesses and improves every guess at once with the Ehrlich–Aberth update. Horner’s method evaluates the polynomial and its derivative efficiently, and each returned root is substituted back into the original polynomial for a scale-independent residual check.

Are these exact roots?

No. Except for a linear equation, the displayed roots are numerical approximations. Degrees above 4 have no general formula in radicals, and even lower-degree formulas can lose accuracy on difficult coefficients. Use the residual and sensitivity warning to judge the approximation; use the quadratic calculator when you need exact fractions or radicals for a degree-2 equation.

Why are repeated roots less stable?

At a repeated root, both the polynomial and its derivative are zero. That weakens the correction step, so tiny coefficient changes can split one repeated root into several nearby roots. The solver groups roots only when their numerical values coincide closely and keeps the multiplicity visible.

What can I enter?

Use real, dimensionless coefficients and one variable with whole-number powers up to 20. The expression must already be expanded, but terms can be out of order or appear on both sides of an equals sign. The coefficient list runs from the highest power to the constant and must include zeros for missing powers.