Polynomial Division Trainer

Type the dividend and the divisor as polynomials in x, such as 2x^3 - 3x^2 + 4x - 5, or as coefficients from the highest power down, such as 2, -3, 4, -5. With whole-number coefficients of everyday size every step is exact, fractions included.

The division algorithm P(x)=D(x) Q(x)+R(x)deg⁡R<deg⁡D\begin{aligned}&P(x)=D(x)\,Q(x)+R(x)\\&\deg R<\deg D\end{aligned}
The remainder theorem P(x)÷(x−a): R=P(a)P(x)÷(ax−b): R=P(ba)\begin{aligned}&P(x)\div(x-a):\ R=P(a)\\&P(x)\div(ax-b):\ R=P\left(\tfrac{b}{a}\right)\end{aligned}
The factor theorem (x−a)∣P(x)  ⟺  P(a)=0(x-a)\mid P(x)\iff P(a)=0
Loading interactive simulation...

Lesson

The theory — Polynomial Division Trainer

Dividing a polynomial P(x) by D(x) means finding a quotient Q(x) and a remainder R(x) with P = DQ + R and the degree of R less than the degree of D.

Where the formula comes from

  1. Divide the leading terms. The leading term of P divided by the leading term of D is the first term of the quotient.
    2x3x=2x2\frac{2x^{3}}{x}=2x^{2}
  2. Multiply back and subtract. That term times D cancels the leading term of P, so what is left has a lower degree.
    2x3−3x2+4x−5−2x2(x−2)=x2+4x−5\begin{aligned}&2x^{3}-3x^{2}+4x-5-2x^{2}(x-2)\\&=x^{2}+4x-5\end{aligned}
  3. Repeat until the degree drops below D’s. Each round gives one more quotient term. A power missing from P still has its column, with coefficient 0.
    x2x=x:x2+4x−5−x(x−2)=6x−56xx=6:6x−5−6(x−2)=7\begin{aligned}&\frac{x^{2}}{x}=x:\quad x^{2}+4x-5-x(x-2)=6x-5\\&\frac{6x}{x}=6:\quad 6x-5-6(x-2)=7\end{aligned}
  4. Read the remainder theorem off the identity. For a divisor x − a, R is a number, and putting x = a into P = (x − a)Q + R wipes out the whole first term.
    P(x)=(x−a) Q(x)+RP(a)=0⋅Q(a)+R=R\begin{aligned}&P(x)=(x-a)\,Q(x)+R\\&P(a)=0\cdot Q(a)+R=R\end{aligned}
  5. Turn it into the factor theorem. x − a divides P exactly when the remainder P(a) is 0, so finding a factor is finding a root.
    R=P(a)=0  ⟺  P(x)=(x−a) Q(x)R=P(a)=0\iff P(x)=(x-a)\,Q(x)

Problems solved in full

  1. Long division with a missing power 4 steps

    Divide x³ + 2x − 5 by x + 1.

    Open this problem in the tool

    1. There is no x² term, so write it in as 0x² to keep the columns straight. x³ ÷ x = x².

      x3x=x2x3+0x2+2x−5−x2(x+1)=−x2+2x−5\begin{aligned}&\frac{x^{3}}{x}=x^{2}\\&x^{3}+0x^{2}+2x-5-x^{2}(x+1)=-x^{2}+2x-5\end{aligned}
    2. x² times (x + 1) is x³ + x². Subtracting leaves −x² + 2x − 5. Then −x² ÷ x = −x.

      −x2x=−x−x2+2x−5−(−x)(x+1)=3x−5\begin{aligned}&\frac{-x^{2}}{x}=-x\\&-x^{2}+2x-5-(-x)(x+1)=3x-5\end{aligned}
    3. −x times (x + 1) is −x² − x. Subtracting leaves 3x − 5. Then 3x ÷ x = 3, and 3(x + 1) = 3x + 3 leaves −8.

      3xx=33x−5−3(x+1)=−8\begin{aligned}&\frac{3x}{x}=3\\&3x-5-3(x+1)=-8\end{aligned}
    4. Check by multiplying back.

      (x+1)(x2−x+3)−8=x3+2x+3−8=x3+2x−5(x+1)(x^{2}-x+3)-8=x^{3}+2x+3-8=x^{3}+2x-5

    Answer

    Quotient x² − x + 3, remainder −8.

    x3+2x−5=(x+1)(x2−x+3)−8x^{3}+2x-5=(x+1)(x^{2}-x+3)-8
  2. A quadratic divisor 3 steps

    Divide x⁴ + 3x³ − x + 2 by x² + x − 1.

    Open this problem in the tool

    Show solution
    1. x⁴ ÷ x² = x². Multiply back and subtract.

      x4x2=x2x4+3x3+0x2−x+2−x2(x2+x−1)=2x3+x2−x+2\begin{aligned}&\frac{x^{4}}{x^{2}}=x^{2}\\&x^{4}+3x^{3}+0x^{2}-x+2-x^{2}(x^{2}+x-1)\\&\quad=2x^{3}+x^{2}-x+2\end{aligned}
    2. 2x³ ÷ x² = 2x. Multiply back and subtract.

      2x3x2=2x2x3+x2−x+2−2x(x2+x−1)=−x2+x+2\begin{aligned}&\frac{2x^{3}}{x^{2}}=2x\\&2x^{3}+x^{2}-x+2-2x(x^{2}+x-1)\\&\quad=-x^{2}+x+2\end{aligned}
    3. −x² ÷ x² = −1. Multiply back and subtract. What is left, 2x + 1, has degree 1, below the divisor’s 2, so it is the remainder.

      −x2x2=−1−x2+x+2−(−1)(x2+x−1)=2x+1\begin{aligned}&\frac{-x^{2}}{x^{2}}=-1\\&-x^{2}+x+2-(-1)(x^{2}+x-1)=2x+1\end{aligned}

    Answer

    Quotient x² + 2x − 1, remainder 2x + 1.

    x4+3x3−x+2=(x2+x−1)(x2+2x−1)+2x+1\begin{aligned}&x^{4}+3x^{3}-x+2\\&=(x^{2}+x-1)(x^{2}+2x-1)+2x+1\end{aligned}
  3. A divisor that is not monic 4 steps

    Divide 4x³ − 2x² + 6x + 1 by 2x − 1.

    Open this problem in the tool

    Show solution
    1. Every quotient term comes from dividing by 2x. 4x³ ÷ 2x = 2x².

      4x32x=2x2\frac{4x^{3}}{2x}=2x^{2}
    2. 2x²(2x − 1) = 4x³ − 2x², and subtracting removes the x² term as well. 0x² ÷ 2x = 0, so the quotient has no x term.

      4x3−2x2+6x+1−2x2(2x−1)=6x+10x22x=0\begin{aligned}&4x^{3}-2x^{2}+6x+1-2x^{2}(2x-1)=6x+1\\&\frac{0x^{2}}{2x}=0\end{aligned}
    3. 6x ÷ 2x = 3, and 3(2x − 1) = 6x − 3 leaves 4.

      6x2x=3:6x+1−3(2x−1)=4\frac{6x}{2x}=3:\qquad 6x+1-3(2x-1)=4
    4. The remainder theorem agrees: 2x − 1 is 0 at x = 1/2.

      P(12)=4⋅18−2⋅14+6⋅12+1=12−12+3+1=4\begin{aligned}P\left(\tfrac12\right)&=4\cdot\tfrac18-2\cdot\tfrac14+6\cdot\tfrac12+1\\&=\tfrac12-\tfrac12+3+1=4\end{aligned}

    Answer

    Quotient 2x² + 3, remainder 4.

    4x3−2x2+6x+1=(2x−1)(2x2+3)+44x^{3}-2x^{2}+6x+1=(2x-1)(2x^{2}+3)+4
  4. The remainder without dividing 2 steps

    Find the remainder when x³ − 4x² + 5x − 7 is divided by x − 3.

    Open this problem in the tool

    Show solution
    1. The divisor is x − a with a = 3, so the remainder is P(3).

      P(3)=33−4⋅32+5⋅3−7=27−36+15−7=−1P(3)=3^{3}-4\cdot3^{2}+5\cdot3-7=27-36+15-7=-1
    2. Long division gives the same, with quotient x² − x + 2.

      x3−4x2+5x−7=(x−3)(x2−x+2)−1x^{3}-4x^{2}+5x-7=(x-3)(x^{2}-x+2)-1

    Answer

    The remainder is −1.

    R=P(3)=−1R=P(3)=-1
  5. A factor, then the full factorisation 3 steps

    Show that x − 1 is a factor of x³ − 6x² + 11x − 6, and factorise it completely.

    Open this problem in the tool

    Show solution
    1. P(1) = 0, so by the factor theorem x − 1 divides P.

      P(1)=1−6+11−6=0P(1)=1-6+11-6=0
    2. Divide to find the other factor.

      x3−6x2+11x−6=(x−1)(x2−5x+6)x^{3}-6x^{2}+11x-6=(x-1)(x^{2}-5x+6)
    3. The quotient is a quadratic, and it factorises.

      x2−5x+6=(x−2)(x−3)x^{2}-5x+6=(x-2)(x-3)

    Answer

    (x − 1)(x − 2)(x − 3)

    (x−1)(x−2)(x−3)(x-1)(x-2)(x-3)
  6. An unknown coefficient 3 steps

    x + 2 is a factor of x³ + kx² − x − 2. Find k.

    Open this problem in the tool

    Show solution
    1. x + 2 is x − (−2), so P(−2) = 0.

      P(−2)=(−2)3+k(−2)2−(−2)−2=−8+4kP(-2)=(-2)^{3}+k(-2)^{2}-(-2)-2=-8+4k
    2. Solve for k.

      −8+4k=0 ⇒ k=2-8+4k=0\ \Rightarrow\ k=2
    3. Check by dividing: the remainder is 0.

      x3+2x2−x−2=(x+2)(x2−1)x^{3}+2x^{2}-x-2=(x+2)(x^{2}-1)

    Answer

    k = 2, and x³ + 2x² − x − 2 = (x + 2)(x² − 1) = (x + 2)(x − 1)(x + 1).

    k=2k=2
  7. Two unknowns, two conditions 3 steps

    P(x) = x³ + ax² + bx − 6. x − 1 is a factor of P, and dividing P by x + 1 leaves a remainder of 4. Find a and b.

    Open this problem in the tool

    Show solution
    1. The factor gives P(1) = 0.

      P(1)=1+a+b−6=0 ⇒ a+b=5P(1)=1+a+b-6=0\ \Rightarrow\ a+b=5
    2. The remainder gives P(−1) = 4.

      P(−1)=−1+a−b−6=4 ⇒ a−b=11P(-1)=-1+a-b-6=4\ \Rightarrow\ a-b=11
    3. Add the two equations, then substitute back.

      2a=16 ⇒ a=8,b=5−8=−32a=16\ \Rightarrow\ a=8,\quad b=5-8=-3

    Answer

    a = 8, b = −3

    a=8,b=−3a=8,\quad b=-3
  8. Dividing 2x³ − 3x² + 4x − 5 by x − 2 5 steps

    Dividing 2x³ − 3x² + 4x − 5 by x − 2 leaves a remainder of 7. Get there by synthetic division, and then obtain the same 7 without dividing at all.

    Open this problem in the tool

    Show solution
    1. Synthetic division is long division with the bookkeeping removed. Only the coefficients matter, and dividing by x − r means the multiplier is r.

      2x3−3x2+4x−5x−2:synthetic division with r=2\frac{2x^3-3x^2+4x-5}{x-2}:\quad \text{synthetic division with } r=2
    2. Bring down the 2, multiply by 2 and add to −3 to get 1, multiply by 2 and add to 4 to get 6, multiply by 2 and add to −5 to get 7. The first three are the quotient; the last is the remainder.

      2 ∣ 2−34−5 ⟶ 2, 1, 6  remainder 72\ \big|\ 2\quad -3\quad 4\quad -5\ \longrightarrow\ 2,\ 1,\ 6\ \ \text{remainder}\ 7
    3. Written out, that is the division algorithm for polynomials — and the identity holds for every x, not just convenient ones.

      2x3−3x2+4x−5=(x−2)(2x2+x+6)+72x^3-3x^2+4x-5=(x-2)(2x^2+x+6)+7
    4. So substitute x = 2. The (x − 2) factor annihilates the entire quotient, whatever it happens to be, and the identity collapses to P(2) = the remainder.

      P(2)=2(8)−3(4)+4(2)−5=16−12+8−5=7P(2)=2(8)-3(4)+4(2)-5=16-12+8-5=7
    5. Evaluating P(2) directly gives 7, matching the division without any division having been done.

      P(2)=7≠0⟹(x−2) is not a factorP(2)=7\ne0\quad\Longrightarrow\quad (x-2)\ \text{is not a factor}

    Answer

    The tool prints a quotient of 2x² + x + 6 and a remainder of 7. The remainder theorem is what step 4 proves, and it is worth more than the shortcut it provides: because the remainder is P(r), asking whether (x − r) divides a polynomial is the same as asking whether P(r) = 0. Here it is 7, so it does not. That equivalence turns factor-hunting into evaluation — try divisor values until the remainder reads 0, and you have found a root and factored the polynomial in the same step.

    P(x)=(x−r)Q(x)+P(r): the remainder IS P(r)P(x)=(x-r)Q(x)+P(r):\ \text{the remainder IS}\ P(r)

Supplementary problems, answers only

  1. Divide x³ − 3x² + 5 by x − 1.

    Show answer

    Quotient x² − 2x − 2, remainder 3

    Q=x2−2x−2,R=3Q=x^{2}-2x-2,\quad R=3
  2. Divide 2x⁴ − 3x³ + x − 4 by x² − 2.

    Show answer

    Quotient 2x² − 3x + 4, remainder −5x + 4

    Q=2x2−3x+4,R=−5x+4Q=2x^{2}-3x+4,\quad R=-5x+4
  3. Divide x² + 1 by 2x − 1.

    Show answer

    Quotient x/2 + 1/4, remainder 5/4

    Q=x2+14,R=54Q=\frac{x}{2}+\frac14,\quad R=\frac54
  4. Find the remainder when 2x³ + 3x² − 5 is divided by 2x + 1.

    Show answer

    −9/2

    −92-\frac92
  5. Show that x − 2 is a factor of x³ − 7x + 6, and factorise it completely.

    Show answer

    (x − 2)(x − 1)(x + 3)

    (x−2)(x−1)(x+3)(x-2)(x-1)(x+3)
  6. When x³ + px + q is divided by x − 1 the remainder is 6, and x + 2 is a factor. Find p and q.

    Show answer

    p = −1, q = 6

    p=−1,q=6p=-1,\quad q=6

Dividing by x − r needs no x at all

When the divisor is x − r, the whole long-division layout collapses into a single row of arithmetic on the coefficients: bring one down, multiply by r, add, repeat. That is synthetic division, and it is the same procedure as Horner’s method for evaluating a polynomial — which is why the last number you write is both the remainder and the value of the polynomial at r. The efficiency is real, not cosmetic: a degree-10 polynomial takes 10 multiplications this way against 19 if you compute each power separately. It is how numerical libraries actually evaluate polynomials.

Your files are checked by this

Every CRC checksum — the error check on a saved file, a ZIP archive, or an Ethernet packet — is polynomial long division in disguise. The data bits become coefficients of a giant polynomial over the field GF(2), where arithmetic is done modulo 2 so addition is just an XOR. That polynomial, shifted up by the generator’s degree, is divided by a fixed generator polynomial, and the remainder is the checksum, give or take the starting value and final inversion a particular standard adds. The same algorithm this trainer walks through by hand runs billions of times a second inside network hardware.

Learning path

Beyond the quadratic

References (1)