Skip to content

Polynomial Equation Solver

Degree
Real roots —
Real roots (with multiplicity)
—
Complex roots
—
Equation solved
—

A polynomial equation of degree n has exactly n roots once complex roots and repeats are counted. Pick the degree, type the coefficients, and the solver returns every root. For x³ − 6x² + 11x − 6 = 0 it gives x = 1, 2 and 3, and the sum of the roots, 6, matches −(−6)/1 from Vieta's formula.

About this tool

Students checking homework, engineers finding the poles of a characteristic polynomial and anyone who has hit a cubic or quartic with no obvious factor can use this solver. You choose quadratic, cubic or quartic and enter one coefficient per power of x. It returns the real roots as a headline, a table of all roots with complex ones written as a ± bi, counts of real and complex roots, and a check of the result against Vieta's sum-of-roots rule. Roots are found numerically and shown to six decimal places, so an irrational root such as √2 appears as 1.414214 and not in radical form. Degrees above four are not offered.

How to use it

  1. Choose the degree

    Select quadratic, cubic or quartic. The fields for higher powers appear only when the degree needs them.

  2. Enter the coefficients

    Type the number in front of each power of x, including negative signs. Use 0 for a power that is missing from your equation.

  3. Read the roots

    The headline lists the distinct real roots; the table lists all roots, including complex conjugate pairs.

  4. Check the working

    The steps restate the equation and compare the sum of the roots with −a(n−1)/a(n).

Examples

x² − 5x + 6 = 0

Degree
Quadratic (x²)
Coefficient of x²
1
Coefficient of x
-5
Constant term
6

Result Real roots: x = 2, 3
Real roots (with multiplicity): 2
Complex roots: 0
Equation solved: x^2 − 5x + 6 = 0

  1. Equation: x^2 − 5x + 6 = 0
  2. Divide by the leading coefficient 1 to make the polynomial monic.
  3. Iterate all 2 root estimates together (Durand-Kerner), then refine each with Newton steps.
  4. Check (Vieta): sum of roots = 5, and −a1/a2 = 5

The quadratic factors as (x − 2)(x − 3), so both roots are real: 2 and 3.

x³ − 6x² + 11x − 6 = 0

Degree
Cubic (x³)
Coefficient of x³
1
Coefficient of x²
-6
Coefficient of x
11
Constant term
-6

Result Real roots: x = 1, 2, 3
Real roots (with multiplicity): 3
Complex roots: 0
Equation solved: x^3 − 6x^2 + 11x − 6 = 0

  1. Equation: x^3 − 6x^2 + 11x − 6 = 0
  2. Divide by the leading coefficient 1 to make the polynomial monic.
  3. Iterate all 3 root estimates together (Durand-Kerner), then refine each with Newton steps.
  4. Check (Vieta): sum of roots = 6, and −a2/a3 = 6

Expanding (x − 1)(x − 2)(x − 3) gives this cubic, and the solver recovers all three roots.

x⁴ − 3x² − 4 = 0

Degree
Quartic (x⁴)
Coefficient of x⁴
1
Coefficient of x³
0
Coefficient of x²
-3
Coefficient of x
0
Constant term
-4

Result Real roots: x = -2, 2
Real roots (with multiplicity): 2
Complex roots: 2
Equation solved: x^4 − 3x^2 − 4 = 0

  1. Equation: x^4 − 3x^2 − 4 = 0
  2. Divide by the leading coefficient 1 to make the polynomial monic.
  3. Iterate all 4 root estimates together (Durand-Kerner), then refine each with Newton steps.
  4. Check (Vieta): sum of roots = 0, and −a3/a4 = 0

Factoring as (x² − 4)(x² + 1) gives two real roots, ±2, and a conjugate pair ±i that never crosses the x-axis.

How it is calculated

z_i ← z_i − p(z_i) / ∏_{j≠i} (z_i − z_j)

p(x)
the polynomial divided by its leading coefficient so the top term is x^n
z_i
the current estimate of root i, a complex number
n
the degree, which is also the number of roots

The solver uses the Durand-Kerner (Weierstrass) iteration, which updates all n root estimates at once from starting points spread around a circle in the complex plane. Each estimate is pushed by the value of the polynomial divided by its distance to the other estimates. After convergence, a few Newton steps sharpen each root. A root whose imaginary part is negligible next to the size of the roots is reported as real. The sum of the roots is then compared with −a(n−1)/a(n), which Vieta's formulas say it must equal.

When not to use it

  • This solver stops at quartics, so degree five and above need another method.
  • Results are decimals, not exact radicals like the square root of 5.
  • Equations with terms such as sin x or 1/x are not polynomials.

Common mistakes

  • Skipping a missing power shifts the other terms: x³ − 8 has coefficients 1, 0, 0 and −8.
  • Move every term to one side before reading coefficients.
  • A double root can differ slightly in the sixth decimal.

Frequently asked questions

Why does a cubic always have at least one real root?

A cubic with real coefficients heads to minus infinity on one side and plus infinity on the other, so its graph must cross the x-axis at least once. Complex roots of real polynomials also come in conjugate pairs, which leaves an odd number of real roots for an odd degree.

What does a complex root such as 1 + 2i mean?

It is a value of x that makes the polynomial zero but is not on the real number line. Its conjugate, 1 − 2i, is always a root too when the coefficients are real. On a graph, complex roots correspond to no crossing of the x-axis.

How are repeated roots shown?

A double or triple root appears once in the headline but several times in the table, once per multiplicity. The real-root count includes those repeats, so (x − 2)² gives a count of 2 with the single headline value 2.

Why not use the cubic or quartic formula?

Cardano's and Ferrari's formulas exist, but they involve nested cube roots and can lose precision through cancellation, even when all roots are real. A simultaneous iteration with Newton polishing is the standard numerical choice and treats all three degrees the same way.

Can the leading coefficient be zero?

No. If the top coefficient is 0 the equation has a lower degree, so the solver asks you to pick that degree instead. For example, 0x³ + x² + 2x + 1 is really the quadratic x² + 2x + 1.

What is the Vieta check in the steps?

For a polynomial a(n)x^n + a(n−1)x^(n−1) + …, the roots always add up to −a(n−1)/a(n). The steps print both numbers; if they agree, the set of roots is consistent with the equation you entered.