How to find the roots of a polynomial

To find the roots of a polynomial, first look for easy factors, then test the candidates given by the rational root theorem, divide out any root you find, and repeat until what is left is a quadratic you can solve with the formula. When no exact root turns up, numerical methods find the roots to as many digits as you need. The polynomial root finder does the numerical part for every root at once, and this guide covers the methods behind it.

How many roots to expect

A root, or zero, of p(x) is a value of x that makes p(x) = 0; on a graph it is where the curve crosses or touches the x-axis. The fundamental theorem of algebra says a polynomial of degree n has exactly n roots, as long as you count complex roots and count repeated roots as many times as they repeat. A few consequences are worth knowing:

  • there are at most n real roots;
  • when the coefficients are real, complex roots come in conjugate pairs, such as 2 + i and 2 − i;
  • so a polynomial of odd degree always has at least one real root.

Factoring and simple cases

Always check for shortcuts first. If there is no constant term, take out x: x³ − 4x = x(x² − 4) = x(x − 2)(x + 2), so the roots are 0, 2 and −2. If only even powers appear, treat x² as a single unknown: x⁴ − 5x² + 4 = (x² − 1)(x² − 4), giving ±1 and ±2. Every root r you find gives a factor (x − r), and dividing it out lowers the degree by one, which makes the remaining roots easier to find.

The rational root theorem

If a polynomial has whole-number coefficients, any rational root p/q in lowest terms has p dividing the constant term and q dividing the leading coefficient. That turns guessing into a short list. For 2x³ − 3x² − 11x + 6:

  • divisors of 6 are 1, 2, 3 and 6; divisors of 2 are 1 and 2;
  • so the candidates are ±1, ±2, ±3, ±6, ±1/2 and ±3/2, twelve in all;
  • testing them, p(3) = 54 − 27 − 33 + 6 = 0, so x = 3 is a root;
  • dividing by (x − 3) leaves 2x² + 3x − 2 = (2x − 1)(x + 2).

The roots are 3, 1/2 and −2. The divisors calculator lists the divisors of the constant and leading coefficient when they are large. The theorem only finds rational roots, so if no candidate works, the roots are irrational or complex.

Formulas and their limits

Degree 2 has the quadratic formula, explained in The quadratic formula explained step by step and built into the quadratic solver. Degrees 3 and 4 also have general formulas, Cardano's for cubics and Ferrari's for quartics, but they are long enough that most people use a tool such as the cubic equation solver. For degree 5 and higher there is no general formula using only arithmetic and roots; that is the Abel–Ruffini theorem. Some quintics can still be solved exactly, but in general you need numerical methods.

Numerical methods

Numerical methods start with a guess and improve it. The simplest is bisection: for x³ − 2x − 5, p(2) = −1 and p(3) = 16, so the sign changes and a root lies between 2 and 3; halving the interval again and again pins it down. Newton's method is much faster. It follows the tangent line to where it crosses zero: x_new = x − p(x) / p′(x). Starting from 2 on the same polynomial gives 2.1, then 2.0945681, then 2.0945515, and the fourth step, 2.0945514815, is correct to ten decimal places.

The root finder takes a different approach that finds all roots together, including complex ones. It uses the Durand–Kerner method, which starts with n guesses spread around a circle in the complex plane and moves them all towards the roots at once, then polishes each one with a few Newton steps. You can type a polynomial with brackets, such as (x − 1)²(x + 2), or list its coefficients, for degrees up to 12. Repeated roots are harder for any numerical method, so the tool merges tight clusters and refines them separately; even so, expect about half the usual digits for a double root.

Checking your roots

Substitute each root back in: p(root) should be zero, or tiny for a numerical answer. The root finder shows |p(root)| for every root. It also checks Vieta's formulas, which link roots to coefficients: for a cubic ax³ + bx² + cx + d, the roots add up to −b/a and multiply to −d/a. For 2x³ − 3x² − 11x + 6, 3 + 1/2 − 2 = 3/2 and 3 × 1/2 × (−2) = −3, matching 3/2 and −6/2. A quick plot with the graphing calculator shows the real roots as crossings.

Sources and further reading

The claims in this guide rest on these references, which were checked when the guide was last updated. Spotted an error? The contact page says how to report it.

  1. Rational root theorem — Wikipedia
  2. Durand–Kerner method — Wikipedia
  3. Abel–Ruffini theorem — Wikipedia

Try the tool

Frequently asked questions

How many roots does a polynomial have?

Exactly as many as its degree, counting complex roots and counting repeated roots by their multiplicity.

What is the rational root theorem?

For whole-number coefficients, any rational root p/q has p dividing the constant term and q dividing the leading coefficient.

Is there a formula for degree 5 polynomials?

No general formula using arithmetic and roots exists for degree 5 or higher, so they are usually solved numerically.

How do I check a root?

Substitute it into the polynomial. The result should be zero, or very close to zero for a numerical root.