On this page
Before you start
This page is easier if you are comfortable with:
What Perfect square (difference) means
The method is the same as for ( a + b ) 2 , but the middle term is negative: − 2 ab . The last term is still positive because ( − b ) 2 = b 2 .
For example ( x − 4 ) 2 = x 2 − 8 x + 16 .
The commonest errors are leaving out the middle term, and making the last term negative. Its companion is the perfect square, the result is related to the difference of two squares , and the technique of completing the square makes use of it.
This page is part of Expressions, brackets and factorising in Algebra . Topics that work alongside it: Perfect square (sum) , Difference of two squares , Completing the square (a = 1) , Index law: power of a power , Index law: multiply and Zero and negative indices .
What is it used for? A square of a difference, (x − a)², expands to x² − 2ax + a². The middle term is negative but the last term is always positive.
Expanding (x − a)² without the common mistake of writing x² − a². Recognising perfect squares when factorising. Completing the square for quadratics with a negative middle term.
How to use perfect square (difference)
Square the first term. Double the product, with a minus sign. Square the last term; it is positive. Add them up.
Diagram x² −3x −3x 9 x −3 x −3 (x − 3)² = x² − 3x − 3x + 9 = x² − 6x + 9. The two middle terms are both negative, but the last term is positive.
Worked examples
The examples marked with a button were worked out by the solver on this page. You can try each one yourself.
Example 1: a simple square Expand ( x − 4 ) 2 .
Try this in the solver: expand (x-4)^2
Binomial expansion Answer checked
Answer
16 − 8 x + x 2 16 - 8 x + x^{2} 16 − 8 x + x 2 Use the binomial theorem: ( a + b ) n = ∑ n C k a n − k b k
a = x , b = − 4 , n = 2
Pascal's triangle row 2 gives the coefficients
1 2 1
Write out every term
1 ( x ) 2 ( − 4 ) 0 + 2 ( x ) 1 ( − 4 ) 1 + 1 ( x ) 0 ( − 4 ) 2
Simplify each term and write in ascending powers of x
16 − 8 x + x 2
Check: put a number in for the letter and compare both sides
x = 2 : 4 = 4
Example 2: with a coefficient Expand ( 2 x − 5 ) 2 .
Try this in the solver: expand (2x-5)^2
Binomial expansion Answer checked
Answer
25 − 20 x + 4 x 2 25 - 20 x + 4 x^{2} 25 − 20 x + 4 x 2 Use the binomial theorem: ( a + b ) n = ∑ n C k a n − k b k
a = 2 x , b = − 5 , n = 2
Pascal's triangle row 2 gives the coefficients
1 2 1
Write out every term
1 ( 2 x ) 2 ( − 5 ) 0 + 2 ( 2 x ) 1 ( − 5 ) 1 + 1 ( 2 x ) 0 ( − 5 ) 2
Simplify each term and write in ascending powers of x
25 − 20 x + 4 x 2
Check: put a number in for the letter and compare both sides
x = 2 : 1 = 1
Example 3: a difference squared Expand (x − 6)².
Try this in the solver: expand (x-6)^2
Binomial expansion Answer checked
Answer
36 − 12 x + x 2 36 - 12 x + x^{2} 36 − 12 x + x 2 Use the binomial theorem: ( a + b ) n = ∑ n C k a n − k b k
a = x , b = − 6 , n = 2
Pascal's triangle row 2 gives the coefficients
1 2 1
Write out every term
1 ( x ) 2 ( − 6 ) 0 + 2 ( x ) 1 ( − 6 ) 1 + 1 ( x ) 0 ( − 6 ) 2
Simplify each term and write in ascending powers of x
36 − 12 x + x 2
Check: put a number in for the letter and compare both sides
x = 2 : 16 = 16
Special cases
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
A simple square (x − 4)² = x² − 8x + 16
x² − 2 × 4 × x + 4².
With a coefficient (2x − 5)² = 4x² − 20x + 25
(2x)² − 2 × 2x × 5 + 5².
A small constant (x − 1)² = x² − 2x + 1
Double 1, then square it.
The pattern (a − b)² = a² − 2ab + b²
The last term is always positive.
Word problems
A squared difference (a − b)² expands to a² − 2ab + b². The middle term is negative and the last term is positive.
A simple square Expand (x − 4)².
Square the first x² Double the product −2 × x × 4 = −8x Square the last +16 Check: x = 6: 4 and 36 − 48 + 16 = 4 ✓ x² − 8x + 16.
With a coefficient Expand (2x − 5)².
Square the first 4x² Double the product −2 × 2x × 5 = −20x Square the last 25 Check: x = 3: 1 and 36 − 60 + 25 = 1 ✓ 4x² − 20x + 25.
A small constant Higher Expand (x − 1)².
Middle −2x Last 1 Check: x = 5: 16 and 25 − 10 + 1 = 16 ✓ x² − 2x + 1.
Why the last sign is positive Higher Show that (−4)² is positive.
Multiply (−4) × (−4) = 16 Check: negative times negative is positive ✓ 16.
Common mistakes
Negative last term (x − 4)² = x² − 8x − 16 ✗
x² − 8x + 16 ✓
(−4)² is positive.
Squaring each term only (x − 4)² = x² − 16 ✗
x² − 8x + 16 ✓
There is a middle term.
Positive middle term (x − 4)² = x² + 8x + 16 ✗
x² − 8x + 16 ✓
The middle sign matches the bracket.
Forgetting to square the coefficient (2x − 5)² = 2x² − 20x + 25 ✗
4x² − 20x + 25 ✓
(2x)² = 4x².
Exam tips
(a − b)² = a² − 2ab + b².
Middle term negative.
Last term positive.
Square coefficients.
Test with a number.
Practice questions
Try each one on paper, then open the answer. Use the solver above to see the full working.
1. Expand (x − 3)². What is the coefficient of x? Foundation −6
2. Expand (x − 5)². What is the constant term? Foundation 25
3. Expand (x − 2)². What is the coefficient of x? Foundation −4
4. Expand (3x − 2)². What is the coefficient of x? Higher −12
5. Expand (2x − 7)². What is the constant term? Higher 49
6. Expand (4x − 1)². What is the coefficient of x²? Higher 16
Practice generator Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Foundation Higher Mixed New question
Solve: …
The practice generator needs JavaScript.
Key terms
Perfect square A bracket squared. Expand Multiply out. Middle term −2ab. Binomial Two terms. Quadratic Has x². Square of a negative Always positive.
Frequently asked questions
What is (a − b)²? a² − 2ab + b².
Why is the last term positive? A negative squared is positive.
How is it different from (a + b)²? The middle term is negative.
How do I check? Substitute a number.
Which page covers (a + b)²? perfect square (a + b)².
Which page covers the difference of two squares? difference of two squares.