Polynomial Calculator

Add, multiply and divide expressions like x³ − 2x + 1, and find the values of x that bring one out at zero. The quadratic formula as printed in textbooks loses most of its accuracy when the middle number is large; the working here does not.

How to use it

Division behaves the way it does with whole numbers, giving a quotient and a remainder rather than failing when the two do not divide evenly.

  1. Enter coefficients, highest power first "1 -3 2" means x² − 3x + 2. Spaces or commas both work.
  2. Pick the operation Two-polynomial operations use Q as well; roots and evaluation use only P.
  3. Check the residuals Each real root shows P(x) at that point, which should be nearly zero — proof rather than assertion.
Full instructions

In depth

Polynomial arithmetic and root finding explained

This article covers how to enter polynomials as coefficient lists, what each operation does, why the standard quadratic formula loses accuracy on certain inputs, and how the calculator finds every root of a polynomial at once.

Screenshot: Roots that survive floating point
Roots that survive floating point as it appears when the page opens.

What a polynomial is and how to enter one

A polynomial is a sum of terms where a variable, usually called x, is raised to whole-number powers and multiplied by constant numbers called coefficients. The expression 3x squared minus 5x plus 2 is a polynomial of degree two, because the highest power of x is two. A cubic has degree three, a quartic has degree four, and so on.

The Polynomial Calculator asks for coefficients listed from the highest power down to the constant term. You type them separated by spaces or commas. For the example above you would enter 3 -5 2. A zero must be included for any missing power. The polynomial x cubed plus 1 is entered as 1 0 0 1, because the x-squared and x terms both have a coefficient of zero.

The six operations available

The Operation dropdown offers six choices. Find the roots of P solves the equation P(x) = 0 and returns every value of x that satisfies it, real or complex. Evaluate P at a value plugs a chosen number into the polynomial and gives you the output.

The remaining four are two-polynomial operations that use a second polynomial called Q. P + Q adds the two together, combining like terms. P minus Q subtracts Q from P. P times Q multiplies them, producing a polynomial whose degree is the sum of the two input degrees. P divided by Q performs polynomial long division and gives both a quotient and a remainder.

When you pick a two-polynomial operation, the Q(x) coefficients box becomes active. Enter the second polynomial the same way: highest power first, zeros for missing terms. For root finding and evaluation, only the P(x) box matters.

Understanding polynomial division

Division of polynomials works much like long division with whole numbers. You divide the leading term of P by the leading term of Q, multiply Q by the result, subtract, and repeat until what remains has a lower degree than Q. The collected results form the quotient, and whatever is left is the remainder.

The relationship P = Q times quotient plus remainder always holds. If the remainder is zero, Q divides P evenly and is said to be a factor. This is a practical way to test whether a linear expression like x minus 3 is a factor of a larger polynomial: divide and check whether anything is left over.

Why the textbook quadratic formula fails

The standard formula for solving a quadratic equation, negative b plus or minus the square root of b squared minus 4ac all over 2a, is correct on paper but dangerous on a computer. The trouble appears when b is very large compared with a and c.

Consider x squared plus one hundred million x plus one. The discriminant, b squared minus 4ac, is a number very close to b squared itself. One of the two roots comes from subtracting the square root from b, and those two values are nearly the same. In floating-point arithmetic, subtracting two nearly equal large numbers destroys most of the significant digits. The textbook formula gives the small root as roughly negative 7.45 times ten to the minus nine, when the true answer is negative ten to the minus eight. That is a 25% error from a formula that is supposedly exact.

The calculator avoids this by using the stable form of the formula. It computes the root whose sign avoids the cancellation first, then uses the identity that the product of the two roots equals c over a to get the second one without any subtraction of large numbers. You can try this yourself by pressing the ill-conditioned preset button.

Finding roots of higher-degree polynomials

For polynomials of degree three and above, there is no single formula as neat as the quadratic one. The calculator uses an iterative method that starts with a spread of initial guesses and refines them all at once until each one converges to a root. This approach finds real and complex roots equally well, without needing you to supply a starting point or know in advance how many roots are real.

The method works comfortably up into degree twenty or so. Very high degrees become numerically delicate no matter what algorithm you use, because tiny rounding errors in the coefficients can move the roots by a noticeable amount. For everyday work up to about degree ten, the results are extremely accurate.

Complex roots and conjugate pairs

A polynomial of degree n always has exactly n roots when you count complex ones and include repeats. A quadratic with a negative discriminant has no real roots, but it has two complex roots that are conjugates of each other. The calculator shows these in the form a plus bi and a minus bi, where i is the square root of negative one.

For any polynomial with real coefficients, complex roots always arrive in conjugate pairs. A cubic therefore has either three real roots or one real root and a pair of complex conjugates. A quartic has four real roots, two real and a complex pair, or two complex pairs. This is not a limitation of the tool; it is a property of the mathematics.

Reading the residuals

Each root in the output includes a residual, which is the value of P(x) at that root. If the root is exact, the residual is zero. In practice, floating-point arithmetic means the residual will be a very small number close to zero rather than zero itself.

The residual is your proof that the answer is correct. A root with a residual of ten to the minus fourteen is solid. A root with a residual of ten to the minus two is suspicious and may indicate that the polynomial is ill-conditioned at that point. Double roots are the most common source of larger residuals, because a repeated root is genuinely sensitive to tiny coefficient changes.

Repeated roots and ill-conditioning

A repeated root, also called a multiple root, occurs when a factor appears more than once. The polynomial x squared minus 2x plus 1 factors as (x minus 1) squared, so x equals 1 is a double root. These roots are inherently harder to compute accurately.

The reason is that near a double root, the polynomial barely touches zero rather than crossing through it. Tiny perturbations in the coefficients shift the root by a much larger amount than they would for a simple root. This is not a flaw in the calculator; it is a mathematical fact. Expect fewer correct digits on repeated roots than on simple ones, and use the residual to gauge how much to trust the figure.

Practical uses and the download button

Students checking homework or exam preparation will find the root finder and the division mode the most useful. Engineers modelling systems described by polynomials can use the arithmetic operations to combine transfer functions. Anyone working with curve fitting can verify the roots of a fitted polynomial to find where a trend line crosses zero.

The Download .txt button saves the full output to a plain text file. It includes the input polynomials, the operation, and every computed result, formatted so it can be pasted into a report or a lab notebook.

The preset buttons below the inputs give you known test cases to explore. Press x squared minus 3x plus 2 for a clean factoring example with roots at 1 and 2. Press cubic for a third-degree polynomial with three real roots. Press ill-conditioned to see the stable quadratic formula in action on a problem that defeats the textbook version. These are worth trying before you enter your own data, because they show what the output looks like when the answer is already known.

Privacy and browser-only computation

Every calculation runs entirely inside your browser on your own device. Your coefficients and results are not sent to any server. There is no account, no login, and no stored history. The preset buttons along the bottom of the panel provide a few well-known test cases you can use to see how the tool behaves before entering your own data.

Because the arithmetic is done in standard floating-point, the results carry about fifteen significant digits of precision. That is more than enough for any applied problem and is the same precision used by every major scientific computing platform.

Help

Roots that survive floating point

Division behaves the way it does with whole numbers, giving a quotient and a remainder rather than failing when the two do not divide evenly. Roots are found at any degree, not just quadratics, and complex ones come back written out alongside the real ones instead of being reported as no solution.

Enter coefficients, highest power first

"1 -3 2" means x² − 3x + 2. Spaces or commas both work.

Pick the operation

Two-polynomial operations use Q as well; roots and evaluation use only P.

Check the residuals

Each real root shows P(x) at that point, which should be nearly zero — proof rather than assertion.

Repeated roots are harder

A double root is genuinely ill-conditioned — tiny changes in the coefficients move it a lot. Expect fewer correct digits there than elsewhere.

Good to know

The textbook formula is unstable

On x² + 10⁸x + 1 it gives the small root as −7.45×10⁻⁹ where the truth is −10⁻⁸ — a 25% error. Press "ill-conditioned" to see this one get it exactly right.

Complex roots come in pairs

For a polynomial with real coefficients, every complex root has its conjugate alongside. A cubic therefore always has at least one real root.

Durand–Kerner finds all at once

No derivative, no starting guess to argue about, and it converges on complex roots as easily as real ones.

Common questions

Why is the quadratic formula unstable?
When b² is much larger than 4ac, one root comes from subtracting two nearly equal numbers, and floating point loses most of its precision doing that.
What does the remainder mean in division?
The same as with whole numbers: P = Q × quotient + remainder, with the remainder of lower degree than Q. A zero remainder means Q is a factor.
Can it factor a polynomial?
Indirectly — the roots give the linear factors. Exact symbolic factorisation over the integers is a different problem.
How high a degree can it handle?
Comfortably into the twenties. Very high degrees become numerically delicate regardless of the method used.