Polynomial Long Division

Related Calculators: Polynomial Long Division Calculator , Polynomial Calculator

Polynomial Long Division is a technique for dividing polynomial by another polynomial. It works in the same way as long division of numbers, but here you are dealing with variables.

You perform division step by step, by "guessing" terms of a quotient. Division is finished, when degree of the result is less than degree of the divisor.

Example 1. Divide `x^3-2x^2-8x+21` by `x+3`.

Write division in special form:


Let's carefully think what to do next.

The goal is to get rid of the leading term of dividend `x^3-2x^2-8x+21`.

In other words, we need to get rid of `x^3`.

To do it, we divide `x^3` by the leading term of divisor `x+3`, i.e. `x` (divide monomials): `x^3/x=color(red)(x^2)`.

Now, we subtract `color(red)(x^2)(x+3)` from `x^3-2x^2-8x+21`:

`x^3-2x^2-8x+21-x^2(x+1)=x^3-2x^2-8x+21-(x^3+3x^2)=` (multiply monomial by polynomial)


Nice, we got rid of `x^3` and ended up with a polynomial of lower degree.

Let's write it in vertical division:


You need to be careful with minus sign (we subtract polynomials). The best way is to change signs of terms, and discard parenthesis and minus sign in front of parenthesis, in other words add polynomials.


Next, perform addition:


Now, repeat above steps.

We need to get rid of `-5x^2`.

To do it, we divide `-5x^2` by the leading term of divisor `x+3`, i.e. `x`: `(-5x^2)/x=color(red)(-5x)`.

Next, subtract `color(red)(-5x)(x+3)` from `-5x^2-8x+21`:

`-5x^2-8x+21-(-5x(x+3))=-5x^2-8x+21-(-5x^2-15x)=` (multiply monomial by polynomial)


We got rid of `-5x^2` and ended up with a polynomial of lower degree:


Finally, get rid of `7x` by multiplying `x+3` by `7`:


We are done, because remainder is 0.

Thus, we can write that `(x^3-2x^2-8x+21)/(x+3)=x^2-5x+7`.

From another side it means, that `x^3-2x^2-8x+21=(x+3)(x^2-5x+7)`.

To better understand the process of long division, let's write, that

`color(purple)(x^3-2x^2-8x+21=x^2(x+3)+(-5x)(x+3)+7(x+3))` (you can simplify right hand side to make sure, that this is equality).

Each summand in the right hand side corresponds to the step in the division process.

Now, above equality can be divided by `(x+3)`: `(x^3-2x^2-8x+21)/(x+3)=(x^2(x+3))/(x+3)+(-5x(x+3))/(x+3)+(7(x+3))/(x+3)=x^2-5x+7`.

Note, how `x+3`'s in the denominators and numerators were cancelled.

Answer: `(x^3-2x^2-8x+21)/(x+3)=x^2-5x+7`.

Now, when you understood how to perform polynomial long division, it's time to consider harder examples.

First example was a "nice" example.

But in most cases there will be not "nice" cases.

Non-Zero Remainder. First not "nice" case is when remainder is not 0.

Similarly to division with remainder for numbers, in most cases you will end up with non-zero remainder (polynomial). But such cases are handled in the same way.

Example 2. Perform the long division: `(6x^3-17x^2-8x+2)/(3x^2+2x-1)`.

I will do this example a bit faster.


We are done, because degree of the remainder `8x-5` is less than degree of the divisor `3x^2+2x-1`, however, remainder is not zero.

We can write now (according to the steps), that


Or `color(purple) (6x^3-17x^2-8x+2=(2x-7)(3x^2+2x-1)+8x-5)` (distributive property of multiplication: `ac-bc=(a-b)c`).

Finally, `(6x^3-17x^2-8x+2)/(3x^2+2x-1)=2x-7+(8x-5)/(3x^2+2x-1)`.

Answer: `(6x^3-17x^2-8x+2)/(3x^2+2x-1)=2x-7+(8x-5)/(3x^2+2x-1)`, quotient is `2x-7`, remainder is `8x-5`.

Missing Terms. Another not "nice" case is when there are missing terms.

In some cases, during division process, there can appear terms that are not present in the dividend.

There are two options to fix this problem:

  • add missing terms with zero coefficient
  • add gaps during long division.

First option, actually, creates gaps at the beginning of the process, so you need not to worry about gaps later. However, second option is better, because often you don't know when and where to fill gaps.

Example 3. Find quotient and remainder of `(x^3-1)/(2x+8)`.

When we perform long division, there will appear terms involving `x` and `x^2`. However, there are no such terms in `x^3-1`.

To fix situation, we add mentioned terms with zero coefficient: `x^3-1=x^3+0x^2+0x-1`. We haven't changed anything, because adding zero doesn't change anything.

Now, perform long division:


Therefore, `x^3-1=(1/2x^2-2x+8)(2x+8)-65`.

Answer: Quotient is `1/2x^2-2x+8`, remainder is `-65`.

Finally, you can divide polynomials, that contain many variables, can also be divided.

Example 4. Divide `3x^3y^3+x^2y^3+x^2y^2+xy^2-2xy` by `xy+1`.


Note, that we swapped some terms to perform division.

Answer: `(3x^3y^3+x^2y^3+x^2y^2+xy^2-2xy)/(x+1)=3x^2y^2-2xy+xy^2`.

Now, it is time to exercise.

Exercise 1. Divide `x^3-3x^2-3x+5` by `x-1`.

Answer: `x^2-2x-5`.

Exercise 2. Find quotient and remainder of `(x^3+7x^2+10x-3)/(x+4)`.

Answer: Quotient is `x^2+3x-2`, remainder is `5`.

Exercise 3. Divide the following: `(x^3-2x^2+3)/(x^2+1)`.

Answer: `(x^3-2x^2+3)/(x^2+1)=x-2+(5-x)/(x^2+1)`.

Exercise 4. Perform long division: `(2a^3b^3+a^3b^2+a^2b^3-6a^2b-3a^2-3ab)/(a+b+2ab)`.

Answer: `a^2b^2-3a`.