gizmobench

Polynomial Division Calculator

Type a dividend and a divisor and the page divides them the way it would be written by hand: the quotient above the dividend, each product subtracted under the term it cancels, and what is left carried down to the next step. The arithmetic runs on exact fractions rather than decimals, so a coefficient of 1/3 stays 1/3 for the whole division and the leading term of every subtraction cancels exactly. Divisors of any degree up to 30 work, not just linear ones, and when the divisor does happen to be linear the same division is also shown as a synthetic sweep, since that is the form most classes ask for. Before anything reaches the screen the quotient is multiplied back by the divisor, the remainder is added and the result is compared with the dividend you typed.

divisiondegree 3 by degree 2
dividend   2x^3 + 3x^2 - x + 5
divisor    x^2 - 2

step 1   2x  (x^2 - 2) = 2x^3 - 4x
step 2   3   (x^2 - 2) = 3x^2 - 6
resultexact
quotient    2x + 3
remainder   3x + 11

check
(x^2 - 2)(2x + 3) + 3x + 11
  = 2x^3 + 3x^2 - x + 5
Quotient
2x + 3
Remainder
3x + 11
Check
Exact
Coefficients
Integer

The remainder is degree 1, lower than the divisor's degree 2, which is where long division stops.

  • x^3 - 1 by x^2 + 1remainder is not constant
    quotient x, remainder -x - 1
  • x^3 - 6x^2 + 11x - 6 by x - 1divides exactly
    quotient x^2 - 5x + 6, remainder 0
  • Divisor 0not a divisor
    refused and named
Accuracy. Exact coefficient long division over the rationals, so a coefficient of 1/3 stays 1/3 and never becomes 0.3333. Every subtraction step is shown in the order it was taken, and the page multiplies the quotient by the divisor, adds the remainder and compares the result to your dividend before it shows you anything.

The long division, written out

The quotient sits above the dividend, each product is subtracted under the term it cancels, and every column is one power of x. This is the layout a marker wants to see, so it is the layout the page prints.

                        2x  + 3
x^2 - 2 ) 2x^3 + 3x^2  - x  + 5
          2x^3        - 4x
          ---------------------
                 3x^2 + 3x  + 5
                 3x^2       - 6
                 --------------
                        3x + 11

How this is worked out

Coefficients are held as whole-number pairs, a numerator over a denominator, and added, multiplied and divided as fractions. Nothing is ever rounded, so 1/3 is printed as 1/3 and the leading term of each subtraction cancels exactly, which is what makes the degree of what is left fall on every step. A decimal you type is read as the fraction it is: 0.75 becomes 3/4 before any division happens.

The division stops when what is left has a lower degree than the divisor, and that is the remainder. The page then multiplies the quotient by the divisor, adds the remainder and compares the result with the dividend you typed. If that comparison ever failed you would see a refusal instead of an answer, which is why the check cell reads Exact rather than telling you a percentage.

What you can type

One letter for the variable, whole numbers, fractions such as 2/3, decimals such as 0.75, the signs + - * / ^ and brackets. Multiplication can be left out where it is obvious, so 2x and (x - 1)(x + 2) read the way they are written. A power must be a whole number from 0 to 30, and both boxes are read up to 600 characters. A list separated by commas and holding no letter, such as 1, 0, 0, -1, is read as coefficients from the highest power down. Dividing inside a box only works by a number: to divide by a polynomial, put it in the divisor box.

Common questions

How does polynomial long division actually work?
Divide the leading term of the dividend by the leading term of the divisor, and that is the first term of the quotient. Multiply the whole divisor by it, subtract that product, and repeat on what is left. The division stops when what is left has a lower degree than the divisor, and that is the remainder. This page prints each of those subtractions in the order it took them, so for 2x^3 + 3x^2 - x + 5 divided by x^2 - 2 you see 2x times the divisor subtracted first, then 3 times the divisor, ending at the quotient 2x + 3 with remainder 3x + 11.
When can I use synthetic division instead?
Only when the divisor has degree 1. This page shows the synthetic tableau underneath whenever that is true, including the case most textbooks skip: a divisor whose leading coefficient is not 1. There the sweep runs on the matching monic divisor, and each quotient coefficient it produces is then divided by that leading coefficient while the remainder is left alone, which is why the synthetic quotient and the long-division quotient agree. For a divisor of degree 2 or higher there is no synthetic form, and long division is the only route.
What does the remainder tell me?
It is what is left when the divisor no longer fits, and it always has a lower degree than the divisor. A remainder of 0 means the divisor divides exactly, so it is a factor of the dividend: x^3 - 6x^2 + 11x - 6 divided by x - 1 gives x^2 - 5x + 6 with remainder 0. A remainder that is not constant is normal once the divisor has degree 2 or more, which is why x^3 - 1 divided by x^2 + 1 gives quotient x and remainder -x - 1.
Does it keep fractions exact, or round them?
Exact. Coefficients are held as a whole-number numerator over a whole-number denominator and are never turned into decimals, so 1/3 is printed as 1/3 and nothing is rounded at any step. A decimal you type is converted the other way before the division starts, so 0.5 is read as 1/2. The readout says Integer when every coefficient on the page is a whole number, and Rational when any of them is a fraction.
What can I type into the two boxes?
One letter for the variable, whole numbers, fractions such as 2/3, decimals, the signs + - * / ^ and brackets, with multiplication left out where it is obvious, so 2x and (x - 1)(x + 2) both read correctly. Powers are whole numbers up to 30 and each box is read up to 600 characters. A list separated by commas that holds no letter is read as coefficients from the highest power down, so 1, 0, 0, -1 is the same as x^3 - 1.
Why does it refuse a divisor of 0?
Because there is no polynomial you could multiply 0 by to get the dividend back, so no quotient and no remainder exist. The page says so instead of printing something misleading. Every way of writing it is caught the same way, including x - x and 0x^5.
What if the divisor has a higher degree than the dividend?
Then the division is already finished before it starts: the quotient is 0 and the remainder is the whole dividend. The page states that rather than leaving the result blank, because it is a real answer and not an error.

Exact coefficient long division over the rationals, so a coefficient of 1/3 stays 1/3 and never becomes 0.3333. Every subtraction step is shown in the order it was taken, and the page multiplies the quotient by the divisor, adds the remainder and compares the result to your dividend before it shows you anything.