MathemagiciansLibraryExplorationsDeep Dives
← Mathematics · Pre-University
MathematicsPre-University

Polynomial division — algebraic long division

P1 — Pure Algebra and Functions › P1.1 — PolynomialsLecture 1 of 5~2810 words

Two divisions, two remainders, and both are right

Start with an ordinary division. , remainder 5. You can check it by multiplying back:

Now look at the polynomial . Put . You get . So this polynomial is the number 2261 in disguise. In the same way, is the number 8 in disguise.

By the end of this lecture, you will be able to divide by . Here is the answer, so that you can see the problem first:

Put into the right-hand side. You get . It is correct. But the quotient is 280, not 282. And the remainder is 21, which is bigger than 8.

For numbers, that would be wrong. A remainder must be smaller than the divisor. If 21 is left over, 8 still fits into it twice more. That is exactly why the number answer is 282 remainder 5: .

So which answer is right? Both are. They answer two different questions. This lecture is about the difference, because that difference is what makes polynomial division work.

What "smaller" means for a polynomial

Ask what the remainder 21 is "smaller" than. At , the divisor is 8, and 21 is bigger. At , the divisor is 98, and 21 is smaller. At , the divisor is 0. Size changes with . So size cannot be the rule for polynomials.

The rule must use something that does not change with . That is the degree: the highest power. The divisor has degree 1. The remainder 21 has degree 0. In the language of degree, 21 is smaller than for every value of at once.

This is also why the polynomial answer is more useful than the number answer. The number division is true for one number, 2261. The polynomial division is true for every . At , it says , and that is true. At , it says , and that is true too. One line of algebra holds a whole family of number facts.

The division statement

Dividing a polynomial by a divisor means finding a quotient and a remainder with

for every , and the degree of less than the degree of .

The degree of the quotient is the degree of minus the degree of . When is linear, the remainder is a number.

The degree rule for the quotient has a reason. The leading term of can only come from multiplying the leading terms of and . Powers add when terms multiply, so the degrees must add up. A cubic divided by a linear divisor gives a quadratic quotient, because .

Stop and think

Expand and check that this statement is true for every :

It is true. So is it a correct answer to "divide by "?

Show the answer

No. The "remainder" has degree 1, the same as the divisor. So the divisor still fits into it once more: .

Move that extra into the quotient, and becomes . The remainder becomes 21. The degree rule is what makes the answer unique. Without it, there would be endless true statements and no single answer.

The one move that makes the method work

You already know the method from numbers. Long division of 2261 by 8 works one place value at a time. A polynomial has places too. Its columns are , , and the number, just as 2261 has thousands, hundreds, tens and units. The difference is that there is no carrying. A coefficient of 7 or of can sit in its column for ever.

The method repeats one move. Look at the highest power that is left. Choose the quotient term that cancels it exactly. To cancel using , you need , because . This is why the rule is "divide the leading term of what is left by the leading term of the divisor". It is not a trick. It is the only choice that removes the top power.

Then multiply the whole divisor by that term, and subtract. The top power is gone, so the degree of what is left falls by at least one. A degree cannot fall below zero for ever. So the process must stop, and it stops at exactly the right moment: when what is left has a lower degree than the divisor.

Step through the division of by below. Read the reason for each move before you go on.

Step through — dividing 2x³ + 3x² − 4x + 1 by x − 2

Press Next to add one move. Each round has the same three moves: divide the leading terms, multiply back, subtract.

The division of 2x³ + 3x² − 4x + 1 by x − 2, one move at a time.

  • 1. 2x³ ÷ x = 2x². This is the only term that cancels 2x³.
  • 2. 2x²(x − 2) = 2x³ − 4x². Subtract: what is left is 7x² − 4x + 1. The degree has fallen from 3 to 2.
  • 3. 7x² ÷ x = 7x. 7x(x − 2) = 7x² − 14x. Subtract: what is left is 10x + 1.
  • 4. 10x ÷ x = 10. 10(x − 2) = 10x − 20. Subtract: what is left is 21.
  • 5. 21 has degree 0, less than the degree of x − 2, so the division stops.

Result: 2x³ + 3x² − 4x + 1 = (x − 2)(2x² + 7x + 10) + 21.

Notice one difference from the number method. With numbers, you "bring down" the next digit. Here, the whole of what is left is carried each time: , not only . "Bringing down" is only a shortcut for not writing the rest of the line. Writing the whole line is safer, because nothing can go missing.

The picture shows the same division as a table of coefficients. Each row is what is left after one round. The dark cell is the top power, which the next round removes.

x³ x² x 1 degree start 2 3 −4 1 3 after round 1 7 −4 1 2 after round 2 10 1 1 after round 3 21 0
What is left after each round of dividing 2x³ + 3x² − 4x + 1 by x − 2. Each round empties the highest column (dashed), so the degree falls from 3 to 2 to 1 to 0. The quotient terms 2x², 7x and 10 are the ones that emptied the columns. The remainder is 21.

That is it. That is the whole idea. Each round removes the top power, and you stop when the degree of what is left is below the degree of the divisor.

Always check the result. Expand the right-hand side: . Add 21 to get . ✓ The test from the start is a quick second check. There is also a third check. Put : the divisor is zero, so the statement says . Indeed, . A later lecture in this topic turns that check into a theorem.

When a power is missing

Some polynomials skip a power. In there is no term. Its coefficient is 0. In the number world, this is like the number 1025, where the zero holds the hundreds place.

Write the zero in: . It looks unnecessary, but it keeps the columns lined up. Without it, the from the first round can end up under the , and then two different powers get combined.

The working below divides by without the zero. One line is wrong. Find it.

Spot the error — a missing x² term

Tap the line you think is wrong. Every line has an explanation, so tap more than one if you like.

A student divides x³ + 2x − 5 by x − 1 without writing 0x². The working is below.

  • 1. x³ ÷ x = x², so the quotient starts with x². (Correct.)
  • 2. x²(x − 1) = x³ − x². (Correct.)
  • 3. (x³ + 2x) − (x³ − x²) = 3x. This line is wrong. The −x² was combined with 2x. Correctly, x³ + 0x² + 2x − (x³ − x²) = x² + 2x.
  • 4. The rest follows the wrong line: quotient x² + 3, remainder −2.

The correct division gives x³ + 2x − 5 = (x − 1)(x² + x + 3) − 2.

Look closely at the wrong answer. Its remainder, , is correct. Only the quotient is wrong. So a check that tests only the remainder, such as putting , would not catch this mistake. Expanding the answer, or the test, does catch it: , but .

Dividing by 2x + 1: where fractions come from

Now divide by . The first move asks what cancels . It must be , because . A fraction appears in the very first step.

This is not a mistake. The fractions come from the 2 in front of the . Every round divides by that leading coefficient, so halves, quarters and eighths build up. Carry on with the same three moves, and you reach

There is a cleaner way to see the same answer. Write . First divide by , whose leading coefficient is 1. That gives the quotient and the remainder . Then move the 2 across:

So the quotient for is half the quotient for . The remainder does not change. Check with : the left side is 833. The right side is . ✓

Stop and think

A polynomial has whole-number coefficients. You divide it by , where is a whole number. Can a fraction ever appear in the quotient?

Show the answer

No. The leading coefficient of is 1, so each new quotient term is a whole number times a power of . Multiplying back by and subtracting uses only multiplication, addition and subtraction of whole numbers. So every coefficient stays whole.

Fractions can only enter through the division in the first move. They need a leading coefficient that is not 1, as in .

Worked examples

Worked Example 1 — A missing power, and a remainder of zero

Divide by .

Set up. Write . The quotient will be a quadratic, since .

Round 1. . . Subtract: , so what is left is .

Round 2. . . Subtract: , so what is left is .

Round 3. . . Subtract: 0.

Answer: , remainder 0.

Check. At : , and . ✓

A remainder of zero means that divides exactly: it is a factor. The quadratic factorises too, as . So . The next lecture asks how to find a factor like without dividing at all.

Worked Example 2 — A divisor that starts with 2x

Divide by .

Round 1. . . Subtract: . What is left is .

Round 2. . . Subtract: . What is left is .

Round 3. . . Subtract: .

Answer: .

No fractions appeared this time. Each leading term, , and , had a coefficient that 2 divides exactly. That is luck in the numbers, not a different method.

Check. At : , and . ✓

Worked Example 3 — A quadratic divisor

Divide by .

Expect. The quotient has degree . The remainder must have degree less than 2, so it can be of the form . Write .

Round 1. . . Subtract: what is left is .

Round 2. . . Subtract: what is left is .

Round 3. . . Subtract: what is left is .

has degree 1, less than 2. Stop.

Answer: .

Check. At : . The right side is . ✓

Three traps

Trap 1 — Stopping at the wrong place

Stop when the degree of what is left is less than the degree of the divisor, and not before. With a quadratic divisor, a remainder such as is allowed. With a linear divisor, it is not: the divisor still fits into it once more.

Trap 2 — Leaving out a missing power

Write (or ) for every missing power before you start. Without the zero, terms of different powers end up in one column, and the quotient comes out wrong while the remainder can still look right.

Trap 3 — Subtracting only the first term

The subtraction takes away the whole line. In the first example, , not . A bracket around the line being subtracted, then a sign change on every term, prevents this.

Try it yourself

Work each one on paper first. Open a hint only when you are stuck.

  1. Divide by . Write the answer as a division statement.

    Hint 1

    The quotient is a quadratic, and the remainder is a number.

    Hint 2

    Round 1: , and . Subtract to get .

    Full answer

    Round 1 leaves . Round 2: ; ; subtract to get . Round 3: ; ; subtract to get .

    .

    Check at : , and . ✓ A negative remainder is fine: it is a number, and its degree is 0.

  2. Divide by .

    Hint 1

    Two powers are missing.

    Hint 2

    Write and start with .

    Full answer

    Round 1: ; what is left is . Round 2: ; what is left is . Round 3: ; what is left is 0.

    , remainder 0.

    Check at : . ✓ This is the difference of two cubes, .

  3. Divide by .

    Hint 1

    Write in the missing . Expect fractions, because the divisor starts with .

    Hint 2

    , and . What is left is .

    Full answer

    Round 2: ; ; what is left is . Round 3: ; ; what is left is .

    .

    Check at : , and . ✓

  4. Divide by . Then use your answer to explain, without a calculator, why and why .

    Hint 1

    Four powers are missing. Each round gives a quotient term one power lower than the last.

    Hint 2

    After round 1, what is left is . Look for the pattern. Then put , and then .

    Full answer

    Each round leaves one lower power minus 1: , then , then , then , then 0. The quotient terms are .

    , remainder 0.

    At : , because . At : . One polynomial division explains both number facts at once.

The bigger idea

The division statement , with "smaller" than , is very old. In the Elements, around 300 BCE, Euclid found the highest common factor of two whole numbers by taking the smaller away from the larger again and again. That is division with a remainder, done the slow way. In modern form: divide, then divide the divisor by the remainder, and repeat until the remainder is zero.

Polynomials took longer. In 1567, the Portuguese mathematician Pedro Nunes tried to find the highest common factor of two polynomials and did not succeed. Eighteen years later, in 1585, the Flemish mathematician Simon Stevin said the answer is Euclid's method, used exactly as for whole numbers. The historian P. M. Cohn suggests a reason for Nunes's difficulty: he may have kept to whole-number coefficients. You have now seen why that fails. Dividing by needs halves.

So the key condition is that you can divide by any coefficient except zero, as you can with fractions and real numbers. Then every division works, and the remainder is always of lower degree. At university, number systems with this property are called Euclidean domains. The integers form one, with size as the measure. Polynomials with fraction or real coefficients form another, with degree as the measure.

The same division runs inside the network hardware that sends this page to you. A common error check treats a block of data as a polynomial whose coefficients are 0 and 1. The sender divides it by a fixed polynomial and attaches the remainder. The receiver divides again, and a remainder that does not match shows that the data were damaged on the way.

Key concepts in this lesson