The difference of perfect squares can be generalized as a factoring technique. By extension, any difference between terms that are raised to an even power like $$a^{6}-b^{6}$$ can be factored using the difference of perfect squares technique. This is because even powers can always be written as perfect squares: $$a^{6}-b^{6}=\left(a^{3}\right)^{2}-\left(b^{3}\right)^{2}$$.

What about the sum or difference of terms with matching odd powers?  How can those be factored?

### More Factoring Techniques

Factoring a trinomial of the form $$a x^{2}+b x+c$$ is much more difficult when $$a \neq 1$$. There are
four techniques that can be used to factor such expressions.

#### Guess and Check

The educated guess and check method can be time consuming but if the first and last coefficient only have a few factors, there are a finite number of possibilities. Take the expression:

$$6 x^{2}-13 x-28$$

The 6 can be factored into the following four pairs:

1, 6

2, 3

-1, -6

-2, -3

The -28 can be factored into the following twelve pairs:

1, -28 or -28, 1

-1, 28 or 28, -1

2, -14 or -14, 2

-2, 14 or 14, -2

4, -7 or -7, 4

-4, -7 or -7, -4

The correctly factored expression will need a pair from the top list and a pair from the bottom list.  This is 48 possible combinations to try.

If you try the first pair from each list and multiply out you will see that the first and the last coefficients are correct but the $$b$$ coefficient does not.

$$(1 x+1)(6 x-28)=6 x^{2}-28 x+6 x-28$$

A systematic approach to every one of the 48 possible combinations is the best way to avoid missing the correct pair.  In this case it is:

$$(2 x-7)(3 x+4)=6 x^{2}+8 x-21 x-28=6 x^{2}-13 x-28$$

This method can be extremely long and rely heavily on good guessing which is why other methods are preferable.

#### Factoring by Grouping

The next factoring technique is factoring by grouping.  Suppose you start with an expression already in factored form:

$$12 x^{2}+4 x z+3 x y+y z$$

Notice that the first two terms are divisible by both 4 and $$x$$ and the last two terms are divisible by $$y$$. First, factor out these common factors and then notice that there emerges a second layer of common factors. The binomial $$(3 x+z)$$ is now common to both terms and can be factored out just as before.

\begin{aligned} 12 x^{2}+4 x z+3 x y+y z &=4 x(3 x+z)+y(3 x+z) \\ &=(3 x+z)(4 x+y) \end{aligned}

To verify your work, multiply the binomials and compare it with the original expression.

$$(4 x+y)(3 x+z)=12 x^{2}+4 x z+3 x y+y z$$

Usually when you multiply the factored form of a polynomial, two terms can be combined because they are like terms.  In this case, there are no like terms that can be combined.

An alternative method to factor polynomials uses the quadratic formula as a clue even though this is an expression and not an equation set equal to zero.

$$6 x^{2}-13 x-28$$

$$a=6, b=-13, c=-28$$

\begin{aligned} x=\frac{-b \pm \sqrt{b^{2}-4 a c}}{2 a}=\frac{13 \pm \sqrt{169-4 \cdot 6 \cdot-28}}{2 \cdot 6} &=\frac{13 \pm 29}{12} \\=\frac{13+29}{12} &=\frac{42}{12}=\frac{7}{2} \\ &=\frac{13-29}{12}=-\frac{16}{12}=-\frac{4}{3} \end{aligned}

This means that when set equal to zero, this expression is equivalent to

$$\left(x-\frac{7}{2}\right)\left(x+\frac{4}{3}\right)=0$$

Multiplying by 2 and multiplying by 3 only changes the left hand side of the equation because the right hand side will remain $$0 .$$ This has the effect of shifting the coefficient from the denominator of the fraction to be in front of the $$x$$.

$$6 x^{2}-13 x-28=\left(x-\frac{7}{2}\right)\left(x+\frac{4}{3}\right)=(2 x-7)(3 x+4)$$

#### Factoring Algorithm

Another useful and efficient technique is the procedural factoring algorithm. The proof of the algorithm is beyond the scope of this book, but is a reliable technique for getting a handle on tricky factoring questions of the form: $$6 x^{2}-13 x-28$$

We will factor $$6 x^{2}-13 x-28$$ using the factoring algorithm to introduce it to you.

First, multiply the first coefficient (6) with the last coefficient (28) and set the first coefficient to 1:

$$x^{2}-13 x-168$$

Second, factor as you normally would with $$a=1$$:

$$(x-21)(x+8)$$

Third, divide the second half of each binomial by the coefficient that was multiplied in step 1:

$$\left(x-\frac{21}{6}\right)\left(x+\frac{8}{6}\right)$$

Fourth, simplify each fraction completely:

$$\left(x-\frac{7}{2}\right)\left(x+\frac{4}{3}\right)$$

Lastly, move the denominator of each fraction to become the coefficient of $$x$$:

$$(2 x-7)(3 x+4)$$

#### Sum or Difference of Matching Odd Powers

The last method of advanced factoring does not involve expressions of the form $$a x^{2}+b x+c$$ Instead, it involves the patterns that arise from factoring the sum or difference of terms with matching odd powers. The patterns are:

\begin{aligned} a^{3}+b^{3} &=(a+b)\left(a^{2}-a b+b^{2}\right) \\ a^{3}-b^{3} &=(a-b)\left(a^{2}+a b+b^{2}\right) \end{aligned}

This method is shown in the examples below and the pattern is fully explored in the Review.

### Examples

Example 1

Earlier, you were asked how the sum and difference of terms with matching odd powers can be factored. The sum or difference of terms with matching odd powers can be factored in a precise pattern because when multiplied out, all intermediate terms cancel each other out.

$$a^{5}+b^{5}=(a+b)\left(a^{4}-a^{3} b+a^{2} b^{2}-a b^{3}+b^{4}\right)$$

When $$a$$ is distributed: $$a^{5}-a^{4} b+a^{3} b^{2}-a^{2} b^{3}+a b^{4}$$

When $$b$$ is distributed: $$+a^{4} b-a^{3} b^{2}+a^{2} b^{3}-a b^{4}+b^{5}$$

Notice all the inside terms cancel: $$a^{5}+b^{5}$$

Example 2

Show that $$a^{3}-b^{3}$$ factors into the result given in the Sum or Difference of Matching Odd Powers section.

Factoring,

\begin{aligned} a^{3}-b^{3} &=(a-b)\left(a^{2}+a b+b^{2}\right) \\ &=a^{3}+a^{2} b+a b^{2}-a^{2} b-a b^{2}-b^{3} \\ &=a^{3}-b^{3} \end{aligned}

Example 3

Show that $$a^{3}+b^{3}$$ factors into the result given in the Sum or Difference of Matching Odd Powers section.

Factoring,

\begin{aligned} a^{3}+b^{3} &=(a+b)\left(a^{2}-a b+b^{2}\right) \\ &=a^{3}-a^{2} b+a b^{2}+b a^{2}-a b^{2}+b^{3} \\ &=a^{3}+b^{3} \end{aligned}

Example 4

Factor the following expression without using the quadratic formula or trial and error:

$$8 x^{2}+30 x+27$$

Using the factoring algorithm:

\begin{aligned} 8 x^{2}+30 x+27 & \rightarrow x^{2}+30 x+216 \\ & \rightarrow(x+12)(x+18) \\ & \rightarrow\left(x+\frac{12}{8}\right)\left(x+\frac{18}{8}\right) \\ & \rightarrow\left(x+\frac{3}{2}\right)\left(x+\frac{9}{4}\right) \\ & \rightarrow(2 x+3)(4 x+9) \end{aligned}

Review

Factor each expression completely.

1. $$2 x^{2}-5 x-12$$

2. $$12 x^{2}+5 x-3$$

3. $$10 x^{2}+13 x-3$$

4. $$18 x^{2}+9 x-2$$

5. $$6 x^{2}+7 x+2$$

6. $$8 x^{2}+34 x+35$$

7. $$5 x^{2}+23 x+12$$

8. $$12 x^{2}-11 x+2$$

Expand the following expressions. What do you notice?

9. $$(a+b)\left(a^{8}-a^{7} b+a^{6} b^{2}-a^{5} b^{3}+a^{4} b^{4}-a^{3} b^{5}+a^{2} b^{6}-a b^{7}+b^{8}\right)$$

10. $$(a-b)\left(a^{6}+a^{5} b+a^{4} b^{2}+a^{3} b^{3}+a^{2} b^{4}+a b^{5}+b^{6}\right)$$

11. Describe in words the pattern of the signs for factoring the difference of two terms with matching odd powers.

12. Describe in words the pattern of the signs for factoring the sum of two terms with matching odd powers.

Factor each expression completely.

13. $$27 x^{3}-64$$

14. $$x^{5}-y^{5}$$

15. $$32 a^{5}-b^{5}$$

16. $$32 x^{5}+y^{5}$$

17. $$8 x^{3}+27$$

18. $$2 x^{2}+2 x y+x+y$$

19. $$8 x^{3}+12 x^{2}+2 x+3$$

20. $$3 x^{2}+3 x y-4 x-4 y$$

c