Dividing polynomials by polynomials

Kapitoly: Many members of, Division of polynomials, The root of a polynomial, Decomposing polynomials

The division of polynomials is a non-trivial operation that is used relatively often when modifying and simplifying polynomials.

Example one

Division of polynomials is already a pretty complicated thing, at least compared to the previous operations. However, the procedure for dividing polynomials is quite similar to that for ordinary manual division. We will illustrate the whole algorithm with examples. Let's start with a simple one, for example:

$$(4x^3+8x^2)/(2x^2)$$

Suppose we have both polynomials sorted in descending order and properly adjusted - that is, what we could add, we added. This is not essential to the algorithm, but it will simplify the computation. In the first step, we divide the first term of the first polynomial by the first term of the second polynomial (here the second polynomial has only one term, so the first term of the second polynomial is also equal to the entire second polynomial). That is, we perform the operation

$$4x^3 /, (2x^2) = \frac42x^{3-2}=2x$$

The division of these base terms is done in the opposite way to multiplication, there should be nothing surprising. Since this is the first step, let's rewrite this into the original expression we want to compute

$$(4x^3+8x^2)/(2x^2)=2x$$

and continue with the second step. We multiply our temporary result with the second polynomial, the polynomial we are dividing by.

$$2x\cdot(2x^2)=4x^3$$

We subtract this result from the entire first polynomial. We'll write it under the first polynomial, like this:

$$\begin{eqnarray} (4x^3+8x^2)&/(2x^2)=2x\\ \underline{-(4x^3)}\\ 8x^2 \end{eqnarray}$$

At this point, we are left with a result below the line, and we apply the same procedure to this result as we did to the original polynomial. We divide it by the first term of the second polynomial.

$$8x^2/(2x^2)=4$$

We add this result to the previous temporary solution:

$$(4x^3+8x^2)/(2x^2)=2x+4$$

And back again, multiply the entire second polynomial by four

$$(2x^2)\cdot4=8x^2$$

and subtract it from the temporary result.

$$\begin{eqnarray} (4x^3+8x^2)&/(2x^2)=2x+4\\ \underline{-(4x^3)}\\ 8x^2\\ \underline{-(8x^2)}\\ 0 \end{eqnarray}$$

After the subtraction, zero remains, and the algorithm ends. On the right hand side we have the result of the division. If we want to do a test, we multiply this resulting polynomial by the second polynomial and we have to get the first polynomial.

$$(2x^2)\cdot(2x+4)=4x^3+8x^2$$

The second example

We modify the previous problem just slightly and try to calculate

$$(4x^3+8x^2+7)/(2x^2).$$

The calculation will proceed all the same as in the previous example, only the result will always be seven greater after subtraction. So the calculation would be briefly as follows:

$$\begin{eqnarray} (4x^3+8x^2+7)&/(2x^2)=2x+4\\ \underline{-(4x^3)}\\ 8x^2+7\\ \underline{-(8x^2)}\\ 7 \end{eqnarray}$$

The procedure hasn't changed, we've just added a seven. In this step, we can no longer somehow nicely perform the division of the new difference (the seven) by the second polynomial. We simply write the result as seven slashed by the given polynomial and add it to the intermediate result.

$$\begin{eqnarray} (4x^3+8x^2+7)&/(2x^2)=2x+4+\frac{7}{2x^2}\\ \underline{-(4x^3)}\\ 8x^2+7\\ \underline{-(8x^2)}\\ 7 \end{eqnarray}$$

When multiplying back by the second polynomial, we get the seven

$$(2x^2)\cdot\frac{7}{2x^2}=7$$

and hence we get zero after the difference.

$$\begin{eqnarray} (4x^3+8x^2+7)&/(2x^2)=2x+4+\frac{7}{2x^2}\\ \underline{-(4x^3)}\\ 8x^2+7\\ \underline{-(8x^2)}\\ 7\\ \underline{-7}\\ 0 \end{eqnarray}$$

The algorithm ends here, we have reached zero.

The third example

We expand the second polynomial by some additional term.

$$(6x^7+19x^4+7)/(3x^3+5)$$

In the first step, we divide the first term of the first polynomial and the first term of the second, as in the previous examples.

$$6x^7/3x^3=2x^4$$

In the next step, we multiply this intermediate result by the entire second polynomial and subtract it from the first.

$$(3x^3+5)\cdot2x^4=6x^7+10x^4$$

Let's write this down neatly under the whole example.

$$\begin{eqnarray} (6x^7+19x^4+7)&/(3x^3+5)=2x^4\\ \underline{-(6x^7+10x^4)}\\ 9x^4+7 \end{eqnarray}$$

Continuing on, we divide the first term of the newly formed polynomial by the first term of the second polynomial.

$$9x^4/3x^3=3x$$

Multiply by the whole second polynomial:

$$(3x^3+5)\cdot3x=9x^4+15x$$

Write and subtract:

$$\begin{eqnarray} (6x^7+19x^4+7)&/(3x^3+5)=2x^4+3x\\ \underline{-(6x^7+10x^4)}\\ 9x^4+7\\ \underline{-(9x^4+15x)}\\ -15x+7 \end{eqnarray}$$

This can no longer be reasonably divided, so we simply add the fraction of the two polynomials.

$$(6x^7+19x^4+7)/(3x^3+5)=2x^4+3x+\frac{-15x+7}{3x^3+5}$$

If we still did the multiplication and difference backwards, we would immediately get zero as in the previous example. Let's do a test. Before we do a thorough test, we can try a quick test. Let's plug in some trivial value, such as zero, into the expressions. If we add zero to the result after division, we get

$$0+0+\frac{0+7}{0+5}=\frac75.$$

If we add zero to the expressions we're dividing, we get

$$(0+0+7)/(0+5)=\frac75.$$

If our treatment is correct, the two values must give the same result. As we can see, the values are equal. While this procedure will not guarantee complete correctness, since we would have to test all possible values that we can substitute after the parameter x, it can quickly reveal an error. Let's try the same thing with one. Add it to the result and we get:

$$2+3+\frac{-15+7}{3+5}=5-\frac88=4.$$

Substitute in the original expressions and we get

$$(6+19+7)/(3+5)=\frac{32}{8}=4.$$

It's on the right track, but we need to do the whole multiplication to get a final confirmation.

$$\begin{eqnarray} (3x^3+5)\cdot(2x^4+3x+\frac{-15x+7}{3x^3+5})&=&(3x^3+5)\cdot2x^4+(3x^3+5)\cdot3x+(-15x+7)\\ &=&6x^7+10x^4+9x^4+15x-15x+7\\ &=&6x^7+19x^4+7 \end{eqnarray}$$

More resources

If this article wasn't enough for you, you can try your luck at any of the following links.