The idea: divide polynomials like numbers

Dividing a polynomial p(x) by a polynomial d(x) gives a quotient q(x) and a remainder r(x), with p(x) = d(x)·q(x) + r(x) and the degree of r below the degree of d. It is the same as 17 ÷ 5 = 3 remainder 2, because 17 = 5·3 + 2. The steps are the steps of school long division, with powers of x in place of digits.

Long division of x cubed minus 2x squared plus 0x minus 4 by x minus 3. The quotient x squared plus x plus 3 is on top. Under the dividend, three rounds of a subtracted product and a difference: x cubed minus 3x squared leaves x squared, bring down 0x; x squared minus 3x leaves 3x, bring down minus 4; 3x minus 9 leaves the remainder 5. Labels name the four moves: divide, multiply, subtract, bring down
(x³ − 2x² − 4) ÷ (x − 3): divide, multiply, subtract, bring down, three times; the remainder is 5.

The page has one problem at a time. Long Division does it with full terms, Synthetic Division does it with the coefficients only, and Evaluate p(c) plugs c into p with Horner's rule. The plot on the right shows p(x) with its real roots in green.

Long division, step by step

Write every power of p(x), using a 0 coefficient for a missing one: x³ − 2x² − 4 becomes x³ − 2x² + 0x − 4, so each column holds one power of x. Then repeat four moves:

  1. Divide the leading term of the working row by the leading term of d: x³ ÷ x = x². That is the next quotient term; it goes on top.
  2. Multiply d by that term: x²·(x − 3) = x³ − 3x².
  3. Subtract it: (x³ − 2x²) − (x³ − 3x²) = x². The leading terms cancel, so the degree drops by one each round.
  4. Bring down the next term of p: x² + 0x.

Stop when the degree of what is left is below the degree of d. Here: x² + x + 3 with remainder 5, so x³ − 2x² − 4 = (x − 3)(x² + x + 3) + 5 (Demo: long division). The most common mistake is the subtraction: every sign of the product flips.

Synthetic division: only the numbers

When the divisor is x − c, the leading term is always x, and the long division writes the same x's again and again. Synthetic division keeps just the coefficients. Write c on the left and the coefficients of p on top. Then:

  • Bring down the first coefficient.
  • Multiply it by c and write the product under the next coefficient.
  • Add that column, and repeat with the new number.
Synthetic division with c = 3. Top row 1, minus 2, 0, minus 4. Middle row 3, 3, 9. Bottom row 1, 1, 3 and a remainder 5 behind a bar. Arrows: each bottom number times 3 goes up to the next column, and each column is added downward
The same division as synthetic division: bottom row 1, 1, 3 is q(x) = x² + x + 3, and the last number 5 is the remainder.

The bottom row, except its last number, holds the coefficients of q(x), one degree lower than p. The last number is the remainder (Demo: synthetic division). The middle row is "multiply by c and add" instead of "multiply by −c and subtract", which is why a divisor x + 1 means c = −1. Synthetic division only works for x − c; for a divisor like x² + x − 1 use long division.

The remainder theorem and Horner's rule

Put x = c into p(x) = (x − c)·q(x) + r. The first part becomes 0, so p(c) = r: the remainder of p ÷ (x − c) is the value of p at c. For the example, p(3) = 27 − 18 + 0 − 4 = 5, the same 5 (Demo: remainder theorem).

Horner's rule evaluates p(c) by nesting: p(3) = ((1·3 − 2)·3 + 0)·3 − 4. Each step is one multiply and one add, so a degree-n polynomial costs n multiplications instead of computing every power. The intermediate values 1, 1, 3, 5 are exactly the bottom row of synthetic division: the two are the same computation. It is also how a number is read in a base: 156 = (1·10 + 5)·10 + 6, and binary 1001 1100 is Horner's rule with c = 2 (see Number Bases and Two's Complement).

stepHornersynthetic column
b01bring down 1
b11·3 − 2 = 1−2 + 3 = 1
b21·3 + 0 = 30 + 3 = 3
b33·3 − 4 = 5−4 + 9 = 5 = remainder

The factor theorem

If the remainder is 0, then p(x) = (x − c)·q(x) exactly: (x − c) is a factor of p, and p(c) = 0 means c is a root, a place where the graph crosses the x-axis. The other roots of p are the roots of the smaller q(x). For x³ − 6x² + 11x − 6 ÷ (x − 2) the remainder is 0, q(x) = x² − 4x + 3, and that factors as (x − 1)(x − 3) (Demo: factor found).

Graph of p of x = x cubed minus 6x squared plus 11x minus 6 crossing the x-axis at 1, 2 and 3, each marked with a green dot. Next to it: p(2) = 0, so p = (x − 2)(x squared − 4x + 3) = (x − 1)(x − 2)(x − 3)
Remainder 0 at c = 2 means a root at x = 2; dividing it out leaves a quadratic with the other two roots.

This is how cubics are solved by hand: guess an integer root among the divisors of the constant term (±1, ±2, ±3, ±6 here), check it with synthetic division, and solve the leftover quadratic with the formula from Quadratics. The problem x³ − 7x − 6 ÷ (x + 1) in the problem list is another one, with c = −1 and roots −2, −1 and 3.

Dividing by a quadratic

Long division works for any divisor. With d(x) = x² + x − 1 each product has three terms, and the remainder can have degree up to 1: (2x⁴ + 3x³ − x + 5) ÷ (x² + x − 1) = 2x² + x + 1 with remainder −x + 6 (Demo: divide by a quadratic). Check: (x² + x − 1)(2x² + x + 1) = 2x⁴ + 3x³ − 1, and adding −x + 6 gives back p. There is no single c here, so synthetic division and the plain remainder theorem do not apply; instead p(x) equals r(x) at the two roots of d(x).

Division also finds the slant asymptote of a rational function: (x² + 1)/(x − 1) = x + 1 + 2/(x − 1), so far from x = 1 the graph runs along the line y = x + 1. See Types of Asymptotes.

How the coefficients of a cubic relate to its roots (Vieta: the roots add up to −b/a) is animated in Cubic Functions: What a, b, c, d Do.

See also Reed-Solomon Erasure Coding: k points fix one polynomial of degree < k, which is how storage systems recover lost shards.

What the page leaves out

Divisors whose leading coefficient is not 1 (the quotient gets fractions, or divide by a·x − b and scale), synthetic division by quadratics (expanded synthetic division), the rational root theorem in detail, complex roots, polynomial GCDs with the Euclidean algorithm, and polynomial division in other settings such as CRC checksums over bits.