How to use the polynomial root finder
- Type the coefficients from the highest power down, separated by commas or spaces. For x^4 - 3x^3 + 3x^2 - 3x + 2 write 1, -3, 3, -3, 2.
- Use 0 for any power that is missing. The degree can be anything from 1 to 10.
- Read the roots table. Real roots show a single number and complex roots appear in pairs such as 1 + 2i and 1 - 2i.
- Check the residual column and the sum and product rows. They show how well the roots fit the polynomial.
Formula
p(x) = a(n) x^n + ... + a(1) x + a(0)
sum of the roots = -a(n-1) / a(n)
product of the roots = (-1)^n a(0) / a(n)
Aberth step: z(k) = z(k) - (p/p') / (1 - (p/p') x sum of 1/(z(k) - z(j)))
The roots are found by the Aberth iteration, which improves all estimates in the complex plane together, followed by Newton steps on the original polynomial. Vieta's formulas, the sum and product above, are used as an independent check on the answer.
A quartic with two real and two complex roots
The default polynomial is x^4 - 3x^3 + 3x^2 - 3x + 2, which factors as (x - 1)(x - 2)(x^2 + 1). The roots are 1, 2, i and -i, so there are 2 real roots and 2 complex roots.
Vieta's formulas confirm the result: the roots add up to 1 + 2 + i - i = 3, which equals -(-3)/1, and they multiply to 1 x 2 x (i)(-i) = 2, which equals the constant term. The relative residual of every root is at the limit of double precision.
Real and complex roots
A polynomial of degree n has exactly n roots if you count complex ones and repeats. When the coefficients are real, any complex root comes with its conjugate. A root of 0 appears when the constant term is 0, and the page takes those out first. For a degree 2 polynomial with steps shown, the Quadratic Equation Solver is more direct.
Plotting helps you see where real roots lie. The Graphing Calculator draws the same polynomial, and the Root Finder homes in on one real root with a method you can follow step by step.
Repeated roots and accuracy
Roots that repeat, such as the triple root of (x - 1)^3, can only be found to about the cube root of the usual accuracy, so the last digits shown are less reliable and a warning appears. High-degree polynomials with widely differing coefficients are also sensitive: a tiny change in one coefficient can move a root a lot. The residual column is the best way to judge each root.
More math tools
For numerical methods and measurement questions, try the Root Finder, Numerical Integration Calculator and Error Propagation Calculator.
Assumptions and limits
- The coefficients are real numbers, given from the highest power to the constant term.
- The leading coefficient is not 0. Leading zeros are ignored.
- Roots are computed in double precision, with about 15 significant digits.
- Near-zero imaginary parts are shown as zero, and complex roots are paired as conjugates.
Frequently asked questions
Why does a degree 5 or higher polynomial have no formula for its roots?
There is no general solution in radicals for degree five and above, which is why numerical methods like the one used here are the standard way to find them.
What does the residual mean?
It is the size of the polynomial at the root divided by the size of its terms there. A value near 1e-15 means the root is correct to the limit of double precision.
Why are some roots shown with a tiny real part such as 1e-17?
They are not. Parts that are below the working accuracy are set to zero, so a root of i is shown as i and not as 1e-17 + i.
Can the polynomial have complex coefficients?
No. This page handles real coefficients only, so complex roots always come as conjugate pairs.