Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Polynomial Equation Solver

x

Solve polynomial equations up to degree 4, step by step

Enter equation...
Var
Num
Op

Select an equation type or enter your own polynomial equation, then click Solve to see the step-by-step solution.






Getting Started

The solver shows an equation display at the top with a blinking yellow caret marking the cursor position. Click anywhere in the display to place the cursor, or use arrow keys, Home, and End for keyboard navigation. Type directly or use the button panel below.

Three quick experiments:

• Type x36x2+11x6=0x^3 - 6x^2 + 11x - 6 = 0 and press Enter — the right panel applies the rational root theorem, finds x=1x = 1 as a root, divides by (x1)(x - 1) to get a quadratic, and solves to give three roots: x=1x = 1, x=2x = 2, x=3x = 3.
• Click an example template like "Cubic (rational roots)" — a random cubic with three integer roots loads into the display.
• Use the x2x^2, x3x^3, x4x^4 shortcut buttons to insert the proper Unicode superscripts, or use the caret operator for arbitrary exponents.

The Solve button is disabled until you enter something. Pressing Enter on the display is equivalent to clicking Solve.

Building Equations with Buttons and Keyboard

The button panel groups inputs by type. All inputs can be made either by clicking or typing on the keyboard.

• Variable row — xx, yy, nn. The solver picks up whichever variable appears in your equation.
• Number row — digits 0 through 9 and the decimal point.
• Operator row — multiplication, division, plus, minus, equals.
• Power row — x2x^2, x3x^3, x4x^4 shortcut buttons (insert proper superscript characters), caret for any exponent, and bracket buttons.

Keyboard shortcuts: type letters and digits directly, use star or slash for multiplication and division (auto-converted on display), and press Enter to solve. You can paste Unicode superscript characters — the tokenizer recognizes them as power operations.

Ctrl+Z undoes up to fifty edits back; Backspace deletes the character before the cursor; Delete removes the one after it. The Clear button empties the display entirely; the curved-arrow button steps through the undo stack one edit at a time.

Try an Example — Eight Form Templates

Click the "Try an Example" header to expand the template panel. Each card generates a random equation of that form. Clicking again produces a new random version.

• Linear — ax+b=0ax + b = 0. Single integer solution.
• Quadratic (factorable) — x2+bx+c=0x^2 + bx + c = 0 with integer roots. Tests rational root extraction at degree 2.
• Quadratic (general) — ax2+bx+c=0ax^2 + bx + c = 0 with arbitrary integer coefficients. May or may not factor over the integers.
• Cubic (rational roots) — x3+bx2+cx+d=0x^3 + bx^2 + cx + d = 0 constructed from three integer roots. Exercises the full rational root + synthetic division pipeline.
• Cubic (leading coeff) — ax3+=0ax^3 + \ldots = 0 with a>1a > 1. Tests rational root candidates of the form p/qp/q with q>1q > 1.
• Quartic (rational roots) — degree-4 equation with four rational roots. Two synthetic divisions, then a quadratic.
• No Real Roots — x2+c=0x^2 + c = 0 with c>0c > 0. The solver flags negative discriminant.
• Perfect Square — (x+a)2=0(x + a)^2 = 0 expanded. Produces a repeated root.

Roughly 80 percent of generated equations have clean integer solutions; the rest exercise rational, irrational, or numerical cases.

Reading the Step-by-Step Solution

The solution panel shows each algebraic move as a labeled step. The step sequence depends on the degree and which roots the solver finds.

• Standard Form — moves everything to the left side and writes the polynomial as anxn++a0=0a_n x^n + \ldots + a_0 = 0.
• Factor Out Variable — if the constant term is zero, x=0x = 0 is immediately a root; the solver factors out xx to reduce the degree.
• Rational Root Theorem — lists the candidate roots as ±\pm(factors of constant)/(factors of leading coefficient) before testing them.
• Rational Root Found — reports each integer or rational root located by direct substitution.
• After Division — shows the quotient polynomial after dividing out (xr)(x - r) via synthetic division.
• Numeric Method — appears when no further rational roots exist; switches to Newton's method.
• Quadratic Formula — applied to the final quadratic factor once the degree is reduced to 2.

The final answer card lists every root found. If at least one root required numerical approximation, the entire answer is flagged as approximate.

The Solving Strategy — Reduce, Solve, Combine

The solver follows a single recursive strategy: reduce the polynomial's degree until it can be solved exactly, then combine the roots from each reduction step.

• Step 1: Drop trivial zero roots. If the constant term is zero, xx divides the polynomial, so x=0x = 0 is a root. Factor it out, reducing the degree.

• Step 2: Apply the rational root theorem at degree 3 and 4. Enumerate candidates as ±p/q\pm p/q where pp divides the constant and qq divides the leading coefficient. Test each candidate by direct substitution. Each rational root found is divided out via synthetic division, reducing the degree.

• Step 3: Once the degree is at most 2, solve exactly. A linear remainder gives a single root by isolation; a quadratic remainder is solved by the discriminant. Both produce exact symbolic answers.

• Step 4 (fallback): Newton's method. If the polynomial still has degree 3 or higher after the rational root pass, no further closed-form factor exists over the rationals. The solver tries Newton's iteration from a fixed grid of starting points, isolates one real root numerically, divides it out, and recurses.

This pipeline handles every polynomial up to degree 4 the solver supports. Polynomials with all rational roots resolve exactly; mixed cases produce some exact and some approximate roots; pure-irrational cases give all approximate roots.

What is a Polynomial?

A polynomial in one variable xx is a finite sum of terms, each consisting of a numerical coefficient times a non-negative integer power of xx:

P(x)=anxn+an1xn1++a1x+a0P(x) = a_n x^n + a_{n-1} x^{n-1} + \cdots + a_1 x + a_0


The largest exponent nn with an0a_n \neq 0 is the degree of the polynomial. The coefficient ana_n is the leading coefficient; a0a_0 is the constant term.

A polynomial equation sets P(x)=0P(x) = 0. Its solutions are the roots of PP, also called zeros or x-intercepts of the graph y=P(x)y = P(x).

The fundamental theorem of algebra guarantees a polynomial of degree nn has exactly nn roots when counted with multiplicity in the complex numbers. Over the real numbers, a polynomial can have fewer: some roots may be complex conjugate pairs. The solver returns only real roots.

Polynomials of small degree have special names: degree 1 is linear, degree 2 is quadratic, degree 3 is cubic, degree 4 is quartic.

For deeper coverage see polynomials, polynomial functions, and fundamental theorem of algebra.

The Rational Root Theorem

The rational root theorem is the key tool for finding exact roots of polynomial equations with integer coefficients.

Statement. If a polynomial anxn++a0a_n x^n + \cdots + a_0 with integer coefficients has a rational root p/qp/q in lowest terms, then pp divides a0a_0 (the constant term) and qq divides ana_n (the leading coefficient).

Consequence. The set of candidate rational roots is finite. List all divisors pp of a0|a_0| and all divisors qq of an|a_n|, then enumerate ±p/q\pm p/q. Every rational root must appear in this list. Test each candidate by plugging it in: if P(p/q)=0P(p/q) = 0, it is a root.

Example. For 2x33x28x+12=02x^3 - 3x^2 - 8x + 12 = 0, divisors of 12 are {1,2,3,4,6,12}\{1, 2, 3, 4, 6, 12\} and divisors of 2 are {1,2}\{1, 2\}. Candidates are ±1,±2,±3,±4,±6,±12,±1/2,±3/2\pm 1, \pm 2, \pm 3, \pm 4, \pm 6, \pm 12, \pm 1/2, \pm 3/2. Testing reveals x=3/2x = 3/2, x=2x = 2, x=2x = -2 as the three roots.

Limitations. The theorem says nothing about irrational roots. If a polynomial has only irrational or complex roots, the candidate list returns no hits and a numerical method is needed.

For comprehensive treatment see rational root theorem, synthetic division, and polynomial factoring.

Related Concepts

Polynomial Functions — functions of the form f(x)=anxn++a0f(x) = a_n x^n + \cdots + a_0. The equation f(x)=0f(x) = 0 identifies the x-intercepts.

Polynomial Inequalities &mdash; same form as polynomial equations but with <<, >>, \leq, or \geq. Solved by finding the roots first, then sign-chart analysis.

Linear Equations &mdash; degree-1 polynomial equations. Always exactly one solution.

Quadratic Equations &mdash; degree-2 polynomial equations. Solved by factoring, completing the square, or the quadratic formula.

Cubic Equations &mdash; degree-3 polynomial equations. Always have at least one real root.

Quartic Equations &mdash; degree-4 polynomial equations. Solvable in closed form via Ferrari's method.

Synthetic Division &mdash; shortcut for dividing a polynomial by a linear factor xrx - r, used after each rational root is found.

Newton's Method &mdash; iterative numerical method for approximating roots of any differentiable function: xn+1=xnf(xn)/f(xn)x_{n+1} = x_n - f(x_n) / f'(x_n).

Fundamental Theorem of Algebra &mdash; every non-constant polynomial of degree nn has exactly nn roots over the complex numbers.

Vieta's Formulas &mdash; relate the coefficients of a polynomial to symmetric functions of its roots (sum, sum of pairwise products, and so on).