3.5.4: Factoring – Difference of Squares and the Sum and Difference of Cubes

Learning Outcomes

  • Factor a difference of squares
  • Factor a sum and a difference of cubes

We now have several methods in our factoring arsenal. We should always look for a greatest common factor of all terms first, then how we proceed is primarily determined by the number of terms we have. If we have 4 terms, we should look at factoring by grouping. When we have a trinomial function of the form f(x)=ax2+bx+c trial and error or the ac-method are well suited for factoring. In this section, we are going to consider binomial functions of a special type; the difference of squares, and the sum or difference of cubes.

Factoring a Difference of Squares

When we multiply two binomials, we usually end up with a trinomial. For example, (x+3)(x4)=x2x12. That is why we try to factor trinomials back into the product of two binomials. However, there is an occasion when the coefficients of the x-terms end up with opposite signs and cancel each other out. For example, (2x3)(2x+3)=4x2+6x6x9=4x29. When this happens we end up with a difference of two squares. 4x2=(2x)2 and 9=32.

In general,

(ab)(a+b)=a2+ababb2=a2b2

Therefore,
a2b2=(ab)(a+b)

We can use this equation to factor any difference of squares.

factoring a difference of squares into binomials

  1. Confirm that the two terms are perfect squares: f(x)=a2b2
  2. Write the factored form as f(x)=(ab)(a+b).

Example 1

Factor f(x)=9x225.

Solution

We have two terms and a difference. We need to check that 9x2 and 25 are perfect squares.

9x2=32x2=(3x)2 and 25=52 so they are both perfect squares.

Please note that 32x2=33xx=3x3x=(3x)(3x)=(3x)2.

The binomial 9x225 represents a difference of squares and can be rewritten as (3x5)(3x+5).

Consequently,

f(x)=9x225=(3x5)(3x+5)

Try It 1

Factor:

1. f(x)=81y2100

2. g(x)=1009x2

3. h(x)=36x249

4. f(x)=4x2+9

Did you notice that the sum of squares a2+b2 is prime? Only the difference of squares factors.

sum of squares

For all values a,b,

a2+b2 is prime

Sometimes we have a greatest common factor to deal with before we have the difference of two squares.

Example 2

Factor f(x)=3x248

Solution

We have a difference of two terms but neither 3x2 nor 48 are perfect squares. However, they do have a common factor of 3: 3x2=3x2 and 48=316. After “pulling out” the GCF 3, we are left with the difference of two squares.

f(x)=3x248=3(x216)=3(x242)=3(x4)(x+4)

Try It 2

Factor:

1. f(x)=5x220

2. g(x)=7x2+63

3. h(x)=32x272

Perfect squares always have an exponent that is divisible by 2. For example, (x2)2=x4; (x3)2=x6(x5)2=x10; 4, 6, and 10 are all divisible by 2. So the difference of two squares can be applied when exponents are even.

Example 3

Factor f(x)=16x41

Solution

16x4=44x2x2=(4x2)(4x2)=(4x2)2 so is a perfect square.

f(x)=16x41=(4x2)212=(4x21)(4x2+1)We are not done! 4x21 is the difference of two squares.=(2x1)(2x+1)(4x2+1)

Try It 3

Factor:

1. f(x)=25x481

2. g(x)=x416

Factoring the Sum and Difference of Cubes

Another binomial form that can be factored is the sum or difference of cubes. When we multiply a binomial and a trinomial we usually end up with a polynomial with 4 terms. Occasionally, some of the terms get cancelled out and we end up with the sum or difference of two cubes, a3+b3 or a3b3. Although the sum of two squares cannot be factored, the sum of two cubes can be factored into a binomial and a trinomial.

factoring the Sum and Difference of Cubes

For all values a,b:

a3+b3=(a+b)(a2ab+b2)

 

a3b3=(ab)(a2+ab+b2)

Notice the pattern of + and – signs in the formulas.

a3+b3=(a+b)(a2ab+b2)
a3b3=(ab)(a2+ab+b2)
The binomial factor is always the same sign as the sum or difference. That sign changes for the middle term of the trinomial. The last term in the trinomial is always positive.

Example 4

Factor f(x)=x3+512.

Solution

x3 and 512=83 are perfect cubes.

The sum of cubes formula says ab+b3=(a+b)(a2ab+b2) (x+8)(x28x+64).

So with a=x and b=8, we get:

f(x)=x3+512=(x+8)(x28x+64)

Analysis of the Solution

After writing the sum of cubes this way, we may need to think whether the binomial and trinomial can be factored further. For this example, both the binomial and trinomial are prime.

Try It 4

Factor the sum of cubes f(x)=216a3+b3.

Example 5

Factor g(x)=8x3125.

Solution

Notice that 8x3=(2x)3 and 125=53 are perfect cubes. Therefore, we have the difference of two cubes.

The formula says a3b3=(ab)(a2+ab+b2), so writing a=2x and b=5:

f(x)=8x3125=(2x)353=(2x5)(4x2+10x+25).

Analysis of the Solution

Just as with the sum of cubes, the trinomial factor is always prime so there is no more factoring to be done.

Try It 5

Factor:

1. f(x)=1,000x31

2. g(x)=27x38

3. h(x)=64x3+125

Remember that we should always look for a GCF between terms when we are factoring.

Example 6

Factor f(x)=128x454x

Solution

First, notice that there is a common factor of 2x.

f(x)=128x454x=2x(64x327)=2x((4x)333)=2x(4x3)(16x2+12x+9)

Try It 6

Factor:

1. f(x)=500x5+4x2

2. g(x)=16x42x

3. h(x)=108+32x3