## Introduction to Factoring Polynomials

Factoring by grouping divides the terms in a polynomial into groups, which can be factored using the greatest common factor.

### Learning Objectives

Describe what it means to factor a polynomial and why it is useful to do so

### Key Takeaways

#### Key Points

• Factorization or factoring is the decomposition of an object, for example an integer or a polynomial, into a product of other objects, or factors, which when multiplied together give the original.
• Factoring by grouping is done by placing the terms in the polynomial into two or more groups, where each group can be factored separately. The results of these factorizations can sometimes be combined to make an even more simplified expression.

#### Key Terms

• polynomial: an expression consisting of a sum of a finite number of terms, each term being the product of a constant coefficient and one or more variables raised to a non-negative integer power, such as $a_n x^n + a_{n-1}x^{n-1} +… + a_0 x^0$. Importantly, because all exponents are positive, it is impossible to divide by x.
• greatest common divisor: The greatest common divisor of a set is the largest positive integer or polynomial that divides each of the numbers in the set without remainder.
• factorization: An expression listing items that, when multiplied together, will produce a desired quantity.

A polynomial consists of a sum of monomials. However, sometimes it will be more useful to write a polynomial as a product of other polynomials with smaller degree, for example to study its zeros. The process of rewriting a polynomial as a product is called factoring.

### Factoring and Expanding Polynomials

Factoring is the decomposition of an algebraic object, for example an integer or a polynomial, into a product of other objects, or factors, which when multiplied together give the original. As an example, the integer $15$ factors as $3 \cdot 5$, and the polynomial $x^3 + 2x^2$ factors as $x^2(x+2)$. In all cases, a product of simpler objects than the original (smaller integers, or polynomials of smaller degree) is obtained.

For example:

\begin{align}3x^3-2x^2-3xy^2+2y^2 &= (3x-2)x^2 + (2-3x)y^2 \\ & = (3x-2)(x^2-y^2) \\ & = (3x-2)(x+y)(x-y) \end{align}

is a factorization of a polynomial of degree $3$ into $3$ polynomials of degree $1$.

The aim of factoring is to reduce objects to “basic building blocks”, such as integers to prime numbers, or polynomials to irreducible polynomials. (These are polynomials which cannot be factored non-trivially.)

The inverse procedure of polynomial factorization is expansion, which is just explicitly writing out the multiplication of two or more factors, for example:

$(x^3-2x+5y)(2x^4-3) = 2x^7 - 4x^5 +10x^4y - 3x^3+ 6x-15y$

### Example: Factoring by Grouping

One way to factor polynomials is factoring by grouping. This is done by grouping the terms in the polynomial into two or more groups in such a way that each group can be factored separately. The results of these factorizations can sometimes be combined to make an even more simplified expression. For example, to factor the polynomial $4x^2+20x+3yx+15y$, we can factor the terms with $y$ and those without $y$ separately:

$(4x^2+20x)+(3yx+15y)$

As both terms in the left expression are divisible by $4x$ and both terms in the right expression are divisible by $3y$ we can again rewrite this as:

$4x(x+5)+3y(x+5)$

Both groups share the same factor $(x+5)$, so the polynomial is factored as:

$(x+5)(4x+3y)$

Sometimes, when factoring a polynomial in two or more variables, this last step is not possible and we have to content ourselves with having two or more terms which are each factorized themselves:

\begin{align} x^2 + 2x + y^2 - 2y + 2 & = (x^2 + 2x + 1) + (y^2 - 2y + 1) \\ & = (x+1)^2 + (y -1)^2. \end{align}

## Division and Factors

Polynomial long division functions similarly to long division, and if the division leaves no remainder, then the divisor is called a factor.

### Learning Objectives

Use polynomial division to find additional factors of a polynomial

### Key Takeaways

#### Key Points

• Dividing one polynomial by another can be achieved by using long division. The rules for polynomial long division are the same as the rules learned for long division of integers.
• The four steps of long division are divide, multiply, subtract, and bring down.
• After completing polynomial long division, it is good to check the answers, either by plugging in a number or by multiplying the quotient times the divisor to get the dividend back.

#### Key Terms

• quotient: The number resulting from the division of one number or expression by another.
• divisor: An integer that divides another integer an integral number of times.
• dividend: A number or expression that is to be divided by another.

### Long Division with Integers

Suppose you are given positive integers $D$ and $d$. We want to find integers $q$ and $r$ such that $0 \leq r < d$ and $D = qd+r.$ This we can do with long division, which we all learned to do in elementary school.

To refresh our memory, we divide $\frac{745}{13}$ by hand. We write the numbers down like this:

$\underline{5 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ 13|745$

As $7$ is smaller than $13$, we group the first two digits together and we see that: $5\cdot 13 = 65 \leq 74 < 78 = 6\cdot 13$

So we write down a five as our first digit of $q$ and subtract $65$ from $74:$

\underline{ \ 5 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ \begin{align}13|&745 \\ -&65 \\ &\ \ 95 \end{align}

We now group the remaining two digits and see that $7 \cdot 13 = 91 \leq 95 < 104 = 8 \cdot 13$

So the second digit of $q$ is $8$ and we subtract $91$ from $95$ to obtain $4$. As $4$ is smaller than $13$, we cannot repeat this procedure and we have found that $q = 58, r = 4.$ So $745$ contains $58$ copies of $13$, and another copy of $4.$

\underline{ \ 58 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ \begin{align}13|&745 \\ -&65 \\ &\ \ 95 \\ - & \ \ 91 \\ & \ \ \ \ 4 \end{align}

### Dividing Polynomials with Long Division

The beauty of long division is that the algorithm can be used not for integers only, but also for polynomials.

Here we think about a larger polynomial as one with a higher degree. So given two polynomials $D(x)$ (the dividend) and $d(x)$ (the divisor), we are looking for two polynomials $q(x)$ (the quotient) and $r(x)$ (the $remainder)$ such that $D(x) = d(x)q(x) + r(x)$ and the degree of $r(x)$ is strictly smaller than the degree of $d(x).$

Conceptually, we want to see how many copies of $d(x)$ are contained in $D(x)$ (this is the quotient) and then how far $D(x)$ is away from being a multiple of $d(x)$ (this is the remainder ).

For example, suppose we want to divide $6x^3-8x^2+4x-2$ by $2x-4$:

$\underline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ 2x-4|6x^3-8x^2+4x-2$

We look at the highest degree terms and we see that $6x^3=2x\cdot3x^2$. So we write down a $3x^2$, multiply the divisor with this result and subtract this from the dividend:

$\underline{\ \ \ \ \ \ \ 3x^2 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ 2x-4|6x^3-8x^2+4x-2 \\ \ \ \ \ \ - \ \ 6x^3 -12x^2 \\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4x^2+4x-2$

Again looking at the highest degree terms, we see that $4x^2 = 2x\cdot2x$, so we write down $2x$ as the second term in the quotient and proceed as before:

$\underline{\ \ \ \ \ \ \ 3x^2 +2x \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ 2x-4|6x^3-8x^2+4x-2 \\ \ \ \ \ \ - \ \ 6x^3 -12x^2 \\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4x^2+4x-2 \\ \ \ \ \ \ - \ \ \ \ \ \ \ \ \ \ \ \ \ 4x^2 - 8x \\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 12x-2$

As $12x = 2x\cdot 6$, our next term will be $6:$

$\underline{\ \ \ \ \ \ \ 3x^2 +2x +6 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ 2x-4|6x^3-8x^2+4x-2 \\ \ \ \ \ \ - \ \ 6x^3 -12x^2 \\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 4x^2+4x-2 \\ \ \ \ \ \ - \ \ \ \ \ \ \ \ \ \ \ \ \ 4x^2 - 8x \\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 12x-2 \\ \ \ \ \ \ - \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 12x - 24 \\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 22$

As multiplying any polynomial with the divisor $2x-4$ gets us a polynomial of degree greater than $0$, we cannot divide any further. We see that the quotient $q(x)$ $3x^2+2x+6$ and the remainder $r(x)$ is $22$, so

$6x^3-8x^2+4x-2 = (2x-4)(3x^2+2x+6) + 22$.

### Zero Remainders and Factors

If the remainder $r(x)$ equals $0$, we also say that there is no remainder and do not explicitly write out the $0$. This means that $D(x)=d(x)q(x)$: the dividend is a multiple of the divisor, or the divisor is said to divide the dividend. We say that the divisor is a factor of the dividend. (Of course, the quotient will also be a factor.)

### Checking Your Results

If you have enough time to check your results, it is always wise to do so. The best way to do this is to explicitly work out the equation

$D(x) = d(x)q(x)+r(x)$.

Another way is to check this equation for only one value of $x$.

## The Remainder Theorem and Synthetic Division

Synthetic division is a technique for dividing a polynomial and finding the quotient and remainder.

### Learning Objectives

Use synthetic division to divide a polynomial

### Key Takeaways

#### Key Points

• Synthetic division is most commonly applied when dividing by a monomial such as $x-a$.
• The most useful aspects of synthetic division are that it allows one to calculate without writing variables and uses fewer calculations.

#### Key Terms

• remainder: The amount left over after subtracting the divisor as many times as possible from the dividend without producing a negative result. If (dividend) and $d$ (divisor) are integers, then can always be expressed in the form $n = dq + r$, where $q$ (quotient) and $r$ (remainder) are also integers and $0 \leq r \leq d$.
• polynomial: an expression consisting of a sum of a finite number of terms, each term being the product of a constant coefficient and one or more variables raised to a non-negative integer power, such as $a_n x^n + a_{n-1}x^{n-1} +… + a_0 x^0$. Importantly, because all exponents are positive, it is impossible to divide by $x$.

### The Remainder Theorem

In algebra, the polynomial remainder theorem or little Bézout’s theorem, is an application of polynomial long division. It states that the remainder of a polynomial $f(x)$ divided by a linear divisor $(x-a)$ is equal to $f(a)$.

For example, take the polynomial:

$f(x)=x^3-12x^2-42$

Then divide it by $x-3$.

This gives the quotient $x^2-9x-27$ and the remainder $-123$. Therefore, $f(3)=-123$. We can check this by plugging $3$ into the equation, which yields:

\begin{align} 3^3 - 12\cdot 3^2 - 42 &= 27-108-42 \\ &= -123 \end{align}

In particular, $f(a)=0$ if and only if $(x-a)$ divides $f(x).$

### Synthetic division

To use the remainder theorem, one must first perform division, which is a bit of work. A shorthand way to perform long division is synthetic division. It uses less writing and fewer calculations. It also takes significantly less space than long division. Most importantly, the subtractions in long division are converted to additions by switching the signs at the very beginning, preventing sign errors. Synthetic division only works for polynomials divided by linear expressions with a leading coefficient equal to $1.$

Let’s use synthetic division to solve the example above $f(x)=x^3−12x^2−42$ divided by $x-3$:

We start by writing down the coefficients from the dividend and the negative second coefficient of the divisor. Note that we explicitly write out all zero terms!

$\ \ |1 \ -12 \ 0 \ -42 \\ 3 |\underline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ \ \ |$

Bring down the first coefficient and multiply it by the divisor. Place the resulting $3$ under the $-12$.

$\ \ |1 \ -12 \ 0 \ -42 \\ 3 |\underline{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ \ \ |1$

Then add the next column of coefficients, get the result and multiply that by the divisor to find the third coefficient $-27$:


$\ \ |1 \ -12 \ 0 \ -42 \\ 3 |\underline{\ \ \ \ \ \ \ \ \ 3 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ \ \ |1 \ \ \ - 9$

$\ \ |1 \ -12 \ \ \ \ \ 0 \ -42 \\ 3 |\underline{\ \ \ \ \ \ \ \ \ 3 \ - 27 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ \ \ |1 \ \ \ -9 \ - 27$

So the quotient must be the second degree polynomial $x^2 - 9x - 27$. Now we can also see what the remainder is, just by repeating the procedure:

$\ \ |1 \ -12 \ \ \ \ \ 0 \ -42 \\ 3 |\underline{\ \ \ \ \ \ \ \ \ 3 \ - 27 \ -81 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ } \\ \ \ |1 \ \ \ - 9 \ - 27 \ \color{red}{-123}$

In particular, the number we write on the left is a root of the upper polynomial if and only if the last number we obtain is $0$.

A special case of this is when the left number is $1$: then the last number equals the sum of all coefficients! Thus $1$ is a zero of a polynomial if and only if its coefficients add to $0.$

When we divide by $ax-b$ and $a \not = 1$, we can divide by $(x-b/a)$ and then divide the result by $a$. This way we can still use synthetic division.

## Finding Factors of Polynomials

Finding factors of polynomials is important, since it is always best to work with the simplest version of a polynomial.

### Learning Objectives

Practice the different methods for finding the factors of a polynomial

### Key Takeaways

#### Key Points

• Factoring is a critical skill in simplifying functions and solving equations.
• There are four types of factoring shown, which are 1) “pulling out” common factors, 2) factoring perfect squares, 3) the difference between two squares, and then 4) how to factor when the other three techniques are not applicable.
• The first step should always be “pulling out” common factors. Even if this does not factor out the polynomial completely, this will make the rest of the process much easier.

#### Key Terms

• common factor: A value, variable or combination of the two that is common to all terms of a polynomial.
• factor: To express a mathematical quantity as a product of two or more like quantities.

When multiplying, things are put together. When factoring, things are pulled apart. Factoring is a critical skill in simplifying functions and solving equations.

There are four basic types of factoring. In each case, it is beneficial to start by showing a multiplication problem, and then show how to use factoring to reverse the results of that multiplication.

### “Pulling Out” Common Factors

This type of factoring is based on the distributive property, which states:

$2x(4x^2-7x+3)=8x^3-14x^2+6x$

When factoring, this property is done in reverse. Therefore, starting with an expression such as the one above, it can be noted that every one of those terms is divisible by $2$. Also, every one of those terms is divisible by $x$. Henc, one can “factor out,” or “pull out,” $2x$.

$8x^3-14x^2+6x=2x(? { } - ? { } + ? { } ).$

We now divide each term with this common factor to fill in the blanks. For instance, $8x^3$divided by $2x$ equals $4x^2$. Doing this for each term, we obtain:

$8x^3-14x^2+6x=2x(4x^2-7x+3 ).$

For many types of problems, it is easier to work with this factored form.

As another example, consider $6x+3$. The common factor is $3$. When factoring $3$ from $6x$, $2x$ is left. When factoring $3$ out of $3$, $1$ remains:

$6x+3=3(2x+1)$.

1. This is the simplest kind of factoring. Whenever trying to factor a complicated expression, always begin by looking for common factors that can be pulled out.
2. The factor must be common to all the terms. For instance, $8x^3-14x^2+6x+7$8 has no common factor, since the last term, $7$, is not divisible by $2$ or $x$.

### Perfect Squares

The second type of factoring is based on the “squaring” formulae:

$(x+a)^2=x^2+2ax+a^2$

$(x-a)^2=x^2-2ax+a^2$

For instance, if the problem is $x^2 + 6x + 9$, then one may recognize the signature of the first formula: the middle term is three doubled, and the last term is three squared. Thus, this simplifies to $(x+3)^2$. Other examples are

$x^2+10x+25=(x+5)^2$

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

If the middle term is negative, then the second formula is:

$x^2-8x+16=(x-4)^2$

$x^2-14x=49=(x-7)^2$

This type of factoring only works in this specific case: the middle number is something doubled, and the last number is that same value squared. Furthermore, although the middle term can be either positive or negative, the last term cannot be negative. This is because if a negative is squared, the answer is positive.

To use this method of factoring, one must keep their eyes open to recognize the pattern. The best way to do this is practice.

### Difference Between Two Squares

The third type of factoring is based on the third of the basic formulae:

$(x+a)(x-a)=x^2-a^2$

This formula can be run in reverse whenever subtracting two perfect squares. For instance, if there is $x^2-25$, it can be seen that both $x^2$ and $25$ are perfect squares. Therefore it factors as $(x+5)(x-5)$. Other examples include:

$x^2-64=(x+8)(x-8)$

$16y^2-49=(4y+7)(4y-7)$

$2x^2-18=2(x^2-9)=2(x+3)(x-3)$

Note that, in the last example, the first step is done by pulling out a factor $2$, and there are two perfect squares left. This follows the rule: always begin by pulling out common factors before trying anything else.

Note also that when we are working with real numbers, all positive numbers are squares. So

$x^2 - 3 = (x+\sqrt{3})(x-\sqrt{3})$.

It often happens that we can use this method twice (or more):

\begin{align} x^4-81 & = (x^2 + 9)(x^2-9) \\ & = (x^2 + 9)(x+3)(x-3). \end{align}

It is important to note that the sum of two squares cannot be factored.

As in the case of factoring a perfect square, to use this method one has to keep their eyes open to notice the pattern.

### Brute Force Factoring

This is the hardest way to factor a polynomial, but the one we need to use when the other ones do not suffice.

In general, we can multiply any number of polynomials with any number of terms using the distributive property.

To see how to use this for factoring, we again try to notice a pattern. For example, we have:

$x^2+3x+7x+21=(x+3)(x+7)$

Since
$3+7 = 10$ and $3 \cdot 7 = 21$.

In general:

$x^2 + (a+b)x + ab = (x+a) (x+b)$

Or, of course:

$z^4 + (c-d)z^2 -cd = (z^2+c)(z^2-d)$

which we can factor again by the previous method if $-c$ or $d$ are positive.

Especially when we think $a$ and $b$ are integers, the best tactic to do this is checking for positive and negative factors of the last term, since there are only a limited number of them.