Sub topic 13
Special products: squares and difference of squares
What this chapter assumes
You should already be able to multiply two binomials with FOIL, combine like terms, and handle negative signs. Earlier chapters covered these. This chapter shows that three patterns come up so often that you should recognize them on sight instead of expanding them each time.
The three patterns are:
- The square of a sum: (a + b)² = a² + 2ab + b²
- The square of a difference: (a − b)² = a² − 2ab + b²
- The difference of squares: (a + b)(a − b) = a² − b²
Here a and b can be any numbers, variables, or monomials. Each pattern is what you get when you run FOIL on that specific shape. Nothing new is being proved. You are saving work.
Where the patterns come from
Squaring a sum
Squaring means multiplying a quantity by itself. So (a + b)² means (a + b)(a + b). Apply FOIL:
- First: a · a = a²
- Outer: a · b = ab
- Inner: b · a = ab
- Last: b · b = b²
The outer and inner terms are like terms, so they combine into 2ab. The result is a² + 2ab + b².
Squaring a difference
Replace b with −b in the previous result. The square of −b is still b², but the middle term picks up the negative sign:
(a − b)² = a² − 2ab + b²
Difference of squares
Multiply a sum by a difference of the same two terms:
(a + b)(a − b) = a² − ab + ab − b²
The outer term −ab and the inner term +ab cancel. That leaves a² − b². The middle term disappears, so the answer is a binomial instead of a trinomial.
The table below summarizes the three patterns and the number of terms in each result.
| Product | Expanded form | Terms in result | Middle term |
|---|---|---|---|
| (a + b)² | a² + 2ab + b² | 3 | +2ab |
| (a − b)² | a² − 2ab + b² | 3 | −2ab |
| (a + b)(a − b) | a² − b² | 2 | none |
Worked examples
Example 1: square of a sum
Expand (x + 5)². Here a = x and b = 5.
- a² = x²
- 2ab = 2 · x · 5 = 10x
- b² = 25
The result is x² + 10x + 25.
Example 2: square of a difference
Expand (3x − 4)². Here a = 3x and b = 4.
- a² = (3x)² = 9x²
- 2ab = 2 · 3x · 4 = 24x, with a minus sign, so −24x
- b² = 16
The result is 9x² − 24x + 16.
Notice that (3x)² is 9x², not 3x². The exponent applies to the coefficient too. The product rule for exponents and the rule for multiplying monomials give this: (3x)(3x) = 9x².
Example 3: difference of squares
Expand (2x + 7)(2x − 7). Here a = 2x and b = 7.
- a² = 4x²
- b² = 49
The result is 4x² − 49.
Example 4: a pattern with two variables
Expand (4x − 3y)(4x + 3y). The order of the two factors does not matter, because multiplication is commutative. Here a = 4x and b = 3y.
The result is 16x² − 9y².
The most common error
Many learners write (a + b)² = a² + b². This is wrong. It skips the middle term 2ab.
A numeric test shows why. Let a = 3 and b = 4.
- (3 + 4)² = 7² = 49
- 3² + 4² = 9 + 16 = 25
The two values differ by 24, which is exactly 2ab = 2 · 3 · 4. The missing middle term accounts for the whole gap.
Two other frequent errors:
- Forgetting to square the coefficient. (5x)² is 25x², not 5x².
- Getting the sign of the last term wrong. In (a − b)², the last term is +b², because a negative squared is positive. So (x − 6)² ends in +36, not −36.
A geometric picture
The square of a sum has a picture. Take a square whose side length is a + b. Its area is (a + b)². Split each side into a piece of length a and a piece of length b. This cuts the big square into four regions:
- One a-by-a square, with area a²
- One b-by-b square, with area b²
- Two a-by-b rectangles, each with area ab
Adding the four areas gives a² + 2ab + b². The two rectangles are why the middle term is 2ab.
Using the patterns in reverse
A pattern works in both directions. If you see a² − b², you can write it as (a + b)(a − b). If you see a trinomial of the form a² + 2ab + b², you can write it as (a + b)². Reading the patterns backward is the basis of factoring, which later chapters treat in detail. For now, practice recognizing the shapes.
To test whether a trinomial is a perfect square:
- Check that the first and last terms are perfect squares.
- Take the square roots of those terms, for example a and b.
- Check that the middle term equals 2ab in absolute value.
For example, x² + 14x + 49 has first term x², last term 49 = 7², and middle term 14x = 2 · x · 7. So it equals (x + 7)².
By contrast, x² + 10x + 49 is not a perfect square. The middle term would need to be 14x.
A numeric shortcut
The difference of squares gives a mental arithmetic trick. To compute 31 × 29, notice that 31 = 30 + 1 and 29 = 30 − 1. Then:
31 × 29 = (30 + 1)(30 − 1) = 30² − 1² = 900 − 1 = 899
Similarly, 52² = (50 + 2)² = 2500 + 200 + 4 = 2704.
Degree of special products
The degree rules from the earlier chapter still hold. When you multiply two polynomials, the degrees add. Squaring a binomial of degree 1 gives degree 2. Squaring a binomial of degree 2, such as (x² + 3)², gives degree 4:
(x² + 3)² = (x²)² + 2 · x² · 3 + 3² = x⁴ + 6x² + 9
Here a = x² and b = 3. The same pattern applies to any monomial or expression you choose for a and b.
Checking with substitution
You can verify an expansion by evaluating both sides at a chosen value of x. The program below checks the three patterns with the coefficient-list representation used earlier in this tutorial. Coefficients are listed from the constant term upward.
def multiply(p, q):
result = [0] * (len(p) + len(q) - 1)
for i, a in enumerate(p):
for j, b in enumerate(q):
result[i + j] += a * b
return result
# (3x - 4)^2 should equal 9x^2 - 24x + 16
square_diff = multiply([-4, 3], [-4, 3])
print(square_diff) # [16, -24, 9]
# (2x + 7)(2x - 7) should equal 4x^2 - 49
diff_squares = multiply([7, 2], [-7, 2])
print(diff_squares) # [-49, 0, 4]
# (x^2 + 3)^2 should equal x^4 + 6x^2 + 9
square_quad = multiply([3, 0, 1], [3, 0, 1])
print(square_quad) # [9, 0, 6, 0, 1]The middle coefficient in the second result is 0. That confirms the cross terms cancel in a difference of squares. The zeros in the third result show that x⁴ + 6x² + 9 has no x³ or x term.
To check by substitution, pick a value such as x = 2:
- (3x − 4)² = (6 − 4)² = 4, and 9x² − 24x + 16 = 36 − 48 + 16 = 4. They match.
- (2x + 7)(2x − 7) = 11 · (−3) = −33, and 4x² − 49 = 16 − 49 = −33. They match.
Exercises
Exercise
Expand (x − 8)² and explain why the last term is positive.
Show answer
Here a = x and b = 8. The result is x² − 16x + 64. The last term is b² = 64, and squaring a number removes the negative sign, so it is positive. The minus sign from (x − 8) appears only in the middle term −16x.
Exercise
Expand (5x + 2y)(5x − 2y), then use 49 × 51 to show the same idea with numbers.
Show answer
With a = 5x and b = 2y, the product is a² − b² = 25x² − 4y². For the numbers, 49 × 51 = (50 − 1)(50 + 1) = 2500 − 1 = 2499.
Exercise
Is 4x² + 12x + 9 a perfect square? If so, write it as a squared binomial. Then check your answer at x = 2.
Show answer
The first term 4x² = (2x)² and the last term 9 = 3². The middle term should be 2 · 2x · 3 = 12x, which matches. So the trinomial equals (2x + 3)². At x = 2: 4(4) + 24 + 9 = 49, and (4 + 3)² = 49. They match.