xaktly | Algebra

Polynomial long division

Why we do this

Many times we find the need to divide one polynomial function into another using the kind of long division you probably learned in elementary school.

There are many reasons to divide polynomials. They can include

  • Checking to make sure a number from the domain is a root (or, equivalently, checking to make sure that an expression like (x - 2) is a factor; factors of a polynomial divide evenly into it.)
  • Simplifying an expression so that further work can be done with it. For example, division of one polynomial by another can reduce the degree of the result, giving you a simpler expression with which to work.
  • Polynomial division can be useful in your later study of infinite series, a very important subject. We'll touch on that in the last part of this page.

You can find video examples of polynmial division at the end of this page.

First a long division refresher ...

Just to remind you of long division with numbers, let's set up three very simple examples and solve them. First we'll try an obvious one:

$$ \require{enclose} \begin{array}{rll} 2 \enclose{longdiv}{6}\kern-.2ex \\[-3pt] \end{array}$$

Remember that we're looking for a number that will multiply the divisor, 2, to get us as close to the dividend, 6, as possible. That's 3 and we write it up top.

$$ \require{enclose} \begin{array}{rll} 3 \\[-3pt] 2 \enclose{longdiv}{6}\kern-.2ex \\[-3pt] \underline{-6} \\[-3pt] 0 \\[-3pt] \end{array}$$

Recall that we multiply the 3 by the 2, write the result below the dividend, then subtract it from the dividend.

In this case our quotient is 3 with no remainder, so 2 divides evenly into 6, three times, or 2 x 3 = 6.

$$\frac{6}{2} = 3$$

An example with a remainder

Now let's try this division

$$ \require{enclose} \begin{array}{rll} 2 \enclose{longdiv}{11}\kern-.2ex \\[-3pt] \end{array}$$

We work through it in the same way. 2 goes into 11 as a whole number only 5 times:

$$ \require{enclose} \begin{array}{rll} 5 \\[-3pt] 2 \enclose{longdiv}{11}\kern-.2ex \\[-3pt] \underline{-10} \\[-3pt] 1 \\[-3pt] \end{array}$$

The remainder is ½.  2 divides into 11 times (remember that the mixed fraction 5½ really means "5 + ½").

$$\frac{11}{2} = 5 \frac{1}{2}$$

Expanding a more difficult division

Now let's look at the more difficult division,

$$ \require{enclose} \begin{array}{rll} 5 \enclose{longdiv}{1625}\kern-.2ex \\[-3pt] \end{array}$$

We know that 5 will go into this number evenly because its last digit is 5, so we won't have a remainder. It will help you to learn polynomial division if you remember that this division can also be written as

$$ \require{enclose} \begin{array}{rll} 5 \enclose{longdiv}{1000 + 600 + 20 + 5}\kern-.2ex \\[-3pt] \end{array}$$

Now we do each of these four divisions separately. First 5 divides into one thousand 200 times:

$$ \require{enclose} \begin{array}{rll} 200\phantom{0000000000000} \\[-3pt] 5 \enclose{longdiv}{1000 + 600 + 20 + 5}\kern-.2ex \\[-3pt] \underline{{-1000} \phantom{0000000000000}} \\[-3pt] 600 \phantom{0000000} \\[-3pt] \end{array}$$

In the next steps we drop the next part of the dividend, the 600 down, then recognize that 5 divides into it 120 times:

$$ \require{enclose} \begin{array}{rll} 200 + 120\phantom{000000000} \\[-3pt] 5 \enclose{longdiv}{1000 + 600 + 20 + 5}\kern-.2ex \\[-3pt] \underline{{-1000} \phantom{0000000000000}} \\[-3pt] 600 \phantom{0000000} \\[-3pt] \underline{{-600} \phantom{0000000}} \\[-3pt] 20 \phantom{000} \\[-3pt] \end{array}$$

Then the 20 drops down for the next step. Notice that we're adding to our quotient above the division sign.

$$ \require{enclose} \begin{array}{rll} 200 + 120 + 4 + 1\phantom{0} \\[-3pt] 5 \enclose{longdiv}{1000 + 600 + 20 + 5}\kern-.2ex \\[-3pt] \underline{{-1000} \phantom{0000000000000}} \\[-3pt] 600 \phantom{0000000} \\[-3pt] \underline{{-600} \phantom{0000000}} \\[-3pt] 20 \phantom{000} \\[-3pt] \underline{{-20} \phantom{000}} \\[-3pt] 5 \\[-3pt] \underline{-5} \\[-3pt] 0 \\[-3pt] \end{array}$$

Now we add up the quotient: 200 + 120 + 4 + 1 = 325, so that's our result:

$$\frac{1625}{5} = 325$$

We'll use just this method to do division of one polynomial function by another.

Polynomial long division

Now let's start with an easy polynomial division problem. We'll take a quadratic function that already factors evenly into factors $(x + 1)$ and $(x - 3),$ and ask whether one of the known roots (3 or -1) is indeed a root.

$$x^2 - 2x - 3 = (x + 1)(x - 3)$$

The polynomial division looks like this, and we know in advance that the answer should be $x-3.$

$$ \require{enclose} \begin{array}{rll} x + 1 \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] \end{array}$$

Now we need to start building the quotient. The trick is to focus on only the x in the divisor x+1, and ask, "by what do we need to multiply x to get the first term (x2) in the dividend. The answer is x, so we write it on top of the division sign.

$$ \require{enclose} \begin{array}{rll} x\phantom{00000000} \\[-3pt] (x + 1) \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] \end{array}$$

Now multiply x by (x + 1), but remember that x multiplies both the x and the 1; it needs to be distributed across that binomial.

$$ \require{enclose} \begin{array}{rll} x\phantom{00000000} \\[-3pt] (x + 1) \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] {x^2 + x} \phantom{0000} \\[-3pt] \end{array}$$

Now we subtract as usual, but remember that means subtracting both the x2 and the x in the second line:

$$ \require{enclose} \begin{array}{rll} x\phantom{00000000} \\[-3pt] (x + 1) \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] \underline{{-(x^2 + x)} \phantom{000}} \\[-3pt] -3x - 3 \\[-3pt] \end{array}$$

The result is -3x, and just like in our third numerical example, we can bring down that -3 from the original dividend. We then ask, "what do we need to multiply x in order to get -3?" It's -3, of course, so we just repeat the procedure to get

$$ \require{enclose} \begin{array}{rll} x\phantom{00000000} \\[-3pt] (x + 1) \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] \underline{{-(x^2 + x)} \phantom{000}} \\[-3pt] -3x - 3 \\[-3pt] \underline{-(-3x - 3)} \\[-3pt] 0 \\[-3pt] \end{array}$$

So $(x + 1)(x - 3) = x^2 - 2x - 3,$ just like we already knew.

An example with a remainder

Now let's do a polynomial division where the divisor isn't a factor of the dividend – so we'll end up with a remainder.

$$ \require{enclose} \begin{array}{rll} x - 7 \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] \end{array}$$

To begin, we ask again, "what must multiply x in order to get x2?"

$$ \require{enclose} \begin{array}{rll} x\phantom{00000000} \\[-3pt] (x - 7) \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] x^2 - 7x \phantom{000} \\[-3pt] \end{array}$$

Remember to distribute the x across the x-7, then subtract.

$$ \require{enclose} \begin{array}{rll} x\phantom{00000000} \\[-3pt] (x - 7) \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] \underline{{-(x^2 - 7x)} \phantom{00}} \\[-3pt] 5x - 3 \\[-3pt] \end{array}$$

The 5x-3 still contains an x, so we can divide again: By what does x need to be multiplied in order to get 5x? It's 5, of course. Add the 5 to the quotient, multiply and subtract, and what's left over is -8.

$$ \require{enclose} \begin{array}{rll} x + 5\phantom{00000} \\[-3pt] (x - 7) \enclose{longdiv}{x^2 - 2x - 3}\kern-.2ex \\[-3pt] \underline{{-(x^2 - 7x)} \phantom{00}} \\[-3pt] 5x - 3 \\[-3pt] \underline{-(5x - 35)} \\[-3pt] 32 \\[-3pt] \end{array}$$

So the remainder is the fraction (or rational function) 32/(x - 7).

$$\frac{x^2 - 2x - 3}{x - 7} = x + 5 + \frac{32}{x - 7}$$

This new version of the original rational function might be much easier to work with. For example, think about how it looks for large x, where the remainder term gets smaller and smaller (because x is in the denominator). For large enough x, f(x) ≈ x + 5. Also, the new version is linear in x, i.e. it no longer contains and x2 term.

Practice problems

Reduce the following rational expressions using polynomial long division. Some may have a remainder.

1. $$\frac{x^3 + 3x^2 - 10x - 24}{x - 3}$$
2. $$\frac{x^3 - 8x^2 + x + 42}{x^2 - 5x - 14}$$
3. $$\frac{x^3 - 8x^2 + x + 42}{x + 7}$$

4. $$\frac{2x^2 - 5x - 12}{x + 4}$$
5. $$\frac{x^4 - 6x^2 - 16}{x - 2\sqrt{2}}$$
6. $$\frac{x^5 + 2x^4 + x^3 - 8x^2 - 16x - 8}{x^2 + 2x + 1}$$

Converting a rational function to an infinite series

Consider the rational function

$$f(x) = \frac{1}{x + 1} \phantom{00000} (x \ne -1)$$

Notice that we really need to write x ≠ -1 in order to avoid a zero denominator. Now this rational function can be interpreted as a division, so let's try it.

$$\frac{1}{x + 1} \; = \; x + 1 \enclose{longdiv}{1}\kern-.2ex$$

As usual, the first step is to ask, "to what must x be multiplied to get 1 ?" This is a bit trickier, but if you think about it, 1/x will do it.

$$ \require{enclose} \begin{array}{rll} \frac{1}{x}\phantom{000} \\[-3pt] (x + 1) \enclose{longdiv}{1 \phantom{000}}\kern-.2ex \\[-3pt] \end{array}$$

Now we multiply 1/x by (x + 1) and subtract to get -1/x left over.

$$ \require{enclose} \begin{array}{rll} \frac{1}{x}\phantom{0000} \\[-3pt] (x + 1) \enclose{longdiv}{1 + 0 \phantom{0}}\kern-.2ex \\[-3pt] \underline{-\left(1 + \frac{1}{x}\right)} \\[-3pt] -\frac{1}{x} \\[-3pt] \end{array}$$

But we can ask our question again: "By what must x be multiplied to get -1/x ?" A little thought gives the answer: -1/x2. Here's the multiplication by (x+1) and the subtraction to get a new left-over term of 1/x2.

$$ \require{enclose} \begin{array}{rll} \frac{1}{x} - \frac{1}{x^2} \phantom{000} \\[-3pt] (x + 1) \enclose{longdiv}{1 + 0 \phantom{0000}}\kern-.2ex \\[-3pt] \underline{-\left(1 + \frac{1}{x}\right) \phantom{000}} \\[-3pt] -\frac{1}{x} + 0\\[-3pt] \underline{-\left(-\frac{1}{x} - \frac{1}{x^2}\right)} \\[-3pt] \frac{1}{x^2} \\[-3pt] \end{array}$$

We can continue this process. The next term in our quotient will be 1/x3. I won't go through the arithmetic of that step, but the next left-over term will by -1/x3. By now you should be getting the impression that this process could go on forever.

$$ \require{enclose} \begin{array}{rll} \frac{1}{x} - \frac{1}{x^2} + \frac{1}{x^3} \\[-3pt] (x + 1) \enclose{longdiv}{1 + 0 \phantom{0000}}\kern-.2ex \\[-3pt] \underline{-\left(1 + \frac{1}{x}\right) \phantom{000}} \\[-3pt] -\frac{1}{x} + 0\\[-3pt] \underline{-\left(-\frac{1}{x} - \frac{1}{x^2}\right)} \\[-3pt] \frac{1}{x^2} \\[-3pt] \end{array}$$

Our final answer has a a couple of repeated patterns. Our original rational function can be replaced by a series of terms of alternating sign, and with increasing powers of x in the denominator, like this:

$$\frac{1}{x + 1} = \frac{1}{x} - \frac{1}{x^2} + \frac{1}{x^3} - \frac{1}{x^4} + \dots$$

Now this is a very important result for a number of reasons. It turns out that there are many ways to represent almost any function as an infinite series of terms of some kind.

What we're saying is that this series of terms, an infinite sum, is a good replacement for the function f(x) = 1/(x + 1), x ≠ -1.

Below is a table of values of the function, the first few terms of the series and their sum, so you can see how the series does.

The values of x substituted into the function and the series are in the left column. In green are the first 5 terms of the series and (right), the sum. In magenta are the actual values of the function. What we notice is that

(1) For values of x < 1 the series is terrible. The right-most column of the table shows the difference between the actual value of the function and the series value, and clearly 90909 and 21.3 are giant errors compared to the real value.

(2) For larger x, our series approximation of f(x) is really pretty good. The errors are very small compared to the actual value of the function.

We'll leave this subject here for now, but you might want to refer back to the idea of obtaining infinite series through polynomial division when you begin to study infinite series in earnest.

Here is a plot of that function (black) and its approximation (purple), out to five terms.

You can see that the functions are nearly identical for x greater than about x = 2, so the series is a very good approximation there. But for lower values of x, it's not so good (they don't even have the same vertical asymptotes).

If you think about it, adding more terms of higher power in x really wouldn't improve upon that below x = 2 because the terms decrease rapidly in size as x grows.

This approximation is a good substitute for the function only for x ≥ 2.

Creative Commons License   optimized for firefox
xaktly.com by Dr. Jeff Cruzan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. © 2012, Jeff Cruzan. All text and images on this website not specifically attributed to another source were created by me and I reserve all rights as to their use. Any opinions expressed on this website are entirely mine, and do not necessarily reflect the views of any of my employers. Please feel free to send any questions or comments to jeff.cruzan@verizon.net.