Perfect Square (difference) Equation Solver with Worked Examples

A perfect square with a minus expands as . Type a square such as and the solver expands it.

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Perfect square (difference) means

The method is the same as for , but the middle term is negative: . The last term is still positive because .

For example .

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.

How to use perfect square (difference)

  1. Square the first term.
  2. Double the product, with a minus sign.
  3. Square the last term; it is positive.
  4. Add them up.

Diagram

x²−3x−3x9x−3x−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 .

Binomial expansion Answer checked
Answer
16−8x+x216 - 8 x + x^{2}
  1. Use the binomial theorem:
  2. Pascal's triangle row 2 gives the coefficients
  3. Write out every term
  4. Simplify each term and write in ascending powers of x
  5. Check: put a number in for the letter and compare both sides

Example 2: with a coefficient

Expand .

Binomial expansion Answer checked
Answer
25−20x+4x225 - 20 x + 4 x^{2}
  1. Use the binomial theorem:
  2. Pascal's triangle row 2 gives the coefficients
  3. Write out every term
  4. Simplify each term and write in ascending powers of x
  5. Check: put a number in for the letter and compare both sides

Example 3: a difference squared

Expand (x − 6)².

Binomial expansion Answer checked
Answer
36−12x+x236 - 12 x + x^{2}
  1. Use the binomial theorem:
  2. Pascal's triangle row 2 gives the coefficients
  3. Write out every term
  4. Simplify each term and write in ascending powers of x
  5. Check: put a number in for the letter and compare both sides

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)².

  1. Square the firstx²
  2. Double the product−2 × x × 4 = −8x
  3. Square the last+16
  4. Check: x = 6: 4 and 36 − 48 + 16 = 4 ✓x² − 8x + 16.

With a coefficient

Expand (2x − 5)².

  1. Square the first4x²
  2. Double the product−2 × 2x × 5 = −20x
  3. Square the last25
  4. Check: x = 3: 1 and 36 − 60 + 25 = 1 ✓4x² − 20x + 25.

A small constant Higher

Expand (x − 1)².

  1. Middle−2x
  2. Last1
  3. Check: x = 5: 16 and 25 − 10 + 1 = 16 ✓x² − 2x + 1.

Why the last sign is positive Higher

Show that (−4)² is positive.

  1. Multiply(−4) × (−4) = 16
  2. 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

  1. (a − b)² = a² − 2ab + b².
  2. Middle term negative.
  3. Last term positive.
  4. Square coefficients.
  5. 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.

Solve: …

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.

More in Algebra and the formula sheets.