Special products - perfect squares and the difference of two squares, step by step
· 15 min read
In short
(a + b)² = a² + 2ab + b², (a − b)² = a² − 2ab + b² and a² − b² = (a + b)(a − b). A square of side a + b is made of a square a², a square b² and two rectangles a by b - those two rectangles are the 2ab that is easy to forget. Read from left to right, the formulas expand brackets; read backwards, they factorise expressions such as x² − 6x + 9 = (x − 3)².
Words to know
- Perfect square
- An expression that is something squared, such as x² − 6x + 9 = (x − 3)².
- Difference of two squares
- An expression a² − b². It factorises as (a + b)(a − b).
- Middle term
- The 2ab in a² + 2ab + b² - twice the product of a and b.
- Expanding brackets
- Multiplying out a product, so that it becomes a sum of terms.
- Factorising
- Writing a sum as a product - expanding brackets in reverse.
What do you think?
A square garden has sides of 5 m. Each side is made 2 m longer. By how much does the area of the garden grow?
By 24 m². The new garden is a square with sides of 7 m, so its area is m², and the old one had m². The new part is not just the small corner m². Along two sides of the old garden there are also two strips, each m². Together: m².
The idea: the square of a sum is more than the sum of the squares
Take a square with side . Its area is . Cut each side into a piece and a piece , and the square falls apart into four pieces:
- a square ,
- a square ,
- two rectangles by , with area each.
So . The two rectangles, , are the part that is easy to forget. The same kind of picture explains two more formulas: the square of a difference, , and the difference of two squares, . Together they are called special products.
Three formulas from one square, step by step
The picture is made of small squares, so you can count every area. Here and . Go through the animation with the buttons or the arrow keys.
(a + b)² = (5 + 2)² = 7² = 49
A square with side a + b - here 5 + 2 = 7. It is made of 7 · 7 = 49 small squares, so (a + b)² = 49.
The pictures need lengths, so and are positive there, and when we cut off . The formulas themselves hold for any numbers, negative ones and fractions included. You can check that by multiplying out the brackets - it is done in “The definitions” below.
Try it yourself: change a and b
Set the lengths and and choose a formula. The picture cuts the squares in the same way as the animation. The readouts give both sides of the formula with numbers, next to the mistake that is easy to make with it.
- square of a sum
- (5 + 2)² = 7² = 49
- a² + 2ab + b²
- 25 + 20 + 4 = 49
- wrong: a² + b²
- 25 + 4 = 29 ≠ 49
What to notice:
- both sides of each formula always give the same number,
- the mistake always falls short of by exactly the two rectangles, ,
- and are different numbers. They are equal only when or ,
- when is larger than , the picture cannot cut off , but the formulas still work: , the same as , because .
The definitions
Special products are formulas for multiplying out brackets quickly. For any numbers and :
The first two are the square of a sum and the square of a difference. Their results are perfect squares (in the US also called perfect square trinomials). The third formula is the difference of two squares.
You do not have to take the formulas on trust. Multiply each term of the first bracket by each term of the second, and collect like terms:
In the same way, , and the two middle terms cancel, leaving .
In place of and you can put any numbers and any expressions, such as , or . Read from left to right, the formulas expand brackets. Read from right to left, they factorise: they turn a sum into a product, as in . A sum of two squares, such as , has no such formula. It cannot be written as a product of brackets with real numbers.
The formulas also help with mental arithmetic:
For cubes there are formulas too. The sum and the difference of two cubes also factorise:
For example, .
Example 1: expanding the square of a difference
Expand .
Step 1. Spot the formula
This is the square of a difference, , with these two terms:
Step 2. Work out the three terms
We square , double the product and square , one at a time.
Step 3. Put them into the formula
The middle term has a minus sign, and the last term is positive.
Answer
. Three terms, and the middle one, , comes from the two rectangles of the picture.
Example 2: factorising with the formulas read backwards
Factorise and .
Step 1. Write the first expression as a difference of squares
Both terms of are squares: is squared, and is squared.
Step 2. Use the difference of two squares
With and , the formula gives the factors.
Step 3. Check the middle term of the second expression
In the first and last terms are squares, and . A perfect square needs a middle term of .
Step 4. Write it as a square
The middle term is with a minus sign, so it is the square of a difference.
Answer
and . Expanding the brackets again gives back the expressions we started from.
Your turn
Simplify .
Hintshow
Expand both squares first. Then remember that the minus sign in front of the second bracket changes the sign of every term inside it. For a check, you can also see the whole expression as a difference of two squares.
Solutiontry it on your own first
Step 1. Expand the square of the sum
We use with and .
Step 2. Expand the square of the difference
The same terms, but now the middle one is subtracted.
Step 3. Remove the brackets
The minus sign in front of the second bracket changes the sign of each of its three terms.
Step 4. Collect like terms
and cancel, and so do and .
Step 5. Check with the difference of two squares
The whole expression is with and , so we work out and .
Answer
. At this gives , as it should.
Common mistakes
- written as . The two rectangles go missing: , but . The two are equal only when or .
- written as . These are different formulas: , but .
- Squaring only part of a term. , not .
- A minus sign on the last term. , not . The last term is the square , and a square is never negative.
- A sum of squares “factorised”. is not , which equals .
At GCSE, A-level and in the US
In England, expanding products of two brackets and factorising quadratic expressions of the form , including the difference of two squares, are part of GCSE Mathematics. GCSE also asks you to show that two algebraic expressions are equivalent - exactly what multiplying out the brackets does in “The definitions”.
A-level Mathematics builds on the same algebra. Completing the square uses a perfect square backwards, as in the vertex form of a quadratic function. Rationalising a denominator with a surd uses the difference of two squares: , a whole number. The binomial expansion of continues the pattern of and to higher powers.
In the US, the Common Core standards for high-school algebra give an example of the same idea: see as , a difference of squares that factors as .
Check yourself
Test yourself
What is ?
Which expression equals ?
What is ?
Which expression cannot be factorised with these formulas?
A square with side is cut into two squares and two rectangles. What is the area of the two rectangles together?
Flashcards for review
Flip a card and say whether you knew the answer. The ones you did not know come back at the end of the deck. Why it pays to come back to them in a few days is explained in the guide Spaced repetition.
Flashcards
Question
Answer
What is ?
- the square of a sum.What is ?
- the square of a difference. The last term, , is positive.What is as a product?
- the difference of two squares.Where does the in come from in the picture?
From the two rectangles by in a square of side . The other two pieces are the squares and .Why is there in ?
When two strips by are cut off the square , the corner lies in both of them, so it is cut off twice. It has to be added back once.When is equal to ?
Only when or - when .How do you check that is a perfect square?
and are squares, and the middle term is . So .Can be factorised with these formulas?
No. It is a sum of two squares, and it cannot be written as a product of brackets with real numbers.What is ?
- the square applies to the 3 as well as to the .What is as a product?
- the difference of two cubes.
Sources
We checked the facts on this page against these sources. All of them may be reused freely: they carry an open licence or are not covered by copyright.
- Illustrative Mathematics - Algebra 1, Unit 7, Lesson 6: Rewriting Quadratic Expressions in Factored Form, Part 1 (an area diagram keeps track of every product when you multiply out two brackets) · CC BY 4.0
- Illustrative Mathematics - Algebra 1, Unit 7, Lesson 8: Rewriting Quadratic Expressions in Factored Form, Part 3 (the difference of two squares a² − b² = (a + b)(a − b); is (x + 4)² equal to x² + 4²; x² + 9 does not factorise; squaring a two-digit number in your head) · CC BY 4.0
- Illustrative Mathematics - Algebra 1, Unit 7, Lesson 11: What are Perfect Squares? ((x + n)² = x² + 2nx + n²; a perfect square is an expression that is something times itself) · CC BY 4.0
- LibreTexts - Corequisite Companion to Precalculus (Freidenreich), 1.2 FOIL Method and Special Products (multiplying out brackets as the area of a rectangle; perfect square trinomials and the difference of squares) · CC BY-SA 4.0
- LibreTexts - Corequisite Companion to Precalculus (Freidenreich), 2.3 Review of Factoring ((A ± B)² = (A ± B)(A ± B) = A² ± 2AB + B², the difference of squares, the sum and difference of cubes; a sum of squares does not factorise) · CC BY-SA 4.0
- Wikibooks - A-Level Maths & Further Maths/Algebraic Expressions (expanding brackets; writing (x + y)² as x² + y² is a common mistake; the difference of two squares) · CC BY-SA 4.0
- Wikipedia - Difference of two squares (the proof by multiplying out; a square with a corner cut out, rearranged into a rectangle (a + b) by (a − b); mental arithmetic) · CC BY-SA 4.0
- Wikipedia - Binomial theorem (a square of side a + b cut into a square a², a square b² and two rectangles; (x + y)³ = x³ + 3x²y + 3xy² + y³) · CC BY-SA 4.0