The square of a number is the product of that number by itself. For example 2 x 2 = 4 which means 4 is a square of 2. So, we obtain a square when a number is multiplied by itself. We represent a square by raising the number to the power of two as well. For example: 4$^{2}$ = 4 x 4 = 16.

Suppose ‘x’ is a number whose square is x$^{2}$ and ‘y’ is another number whose square is y$^{2}$, then the difference of the two squares is represented by x$^{2}$ - y$^{2}$ which is equal to (x + y) and (x – y) that is the product of sum and difference of the respective numbers. So, mathematically we can write it as: x$^{2}$ – y$^{2}$ = (x + y) (x – y)

We can prove this as well considering the right hand side.

RHS = (x + y) (x – y) = x (x – y) + y (x – y) = x$^{2}$ – xy + yx – y$^{2}$ = x$^{2}$ – y$^{2}$ = LHS

We use commutative law for –xy + yx as –yx + yx only which cancels them out to zero.

We use difference of squares formula in various places:

In factorization of polynomials

As conjugates in case of complex numbers

For rationalizing denominators in case of irrational or complex denominators.

For making mental arithmetic easier to an extent.
The most important rule for difference of two squares formula to be applicable is that the powers of both numbers should always be even. As only in that case, the powers will be a multiple of two and thus the given formula is applicable.

There is no restriction of how many times the difference of two squares formula is used in a given problem. This only depends on the required result and the given problem.
Suppose we have two consecutive numbers say ‘x’ and ‘x + 1’.  Now the difference of the square of these numbers is

(x + 1)$^{2}$ – x$^{2}$ = (x + 1 – x) (x + 1 + x) = 2x + 1

This makes our calculation way too easier. Also, this proves that the difference of squares of two consecutive numbers is always an odd number. 

Suppose ‘x’ is one number and ‘y’ is another number. Clearly we can represent y = x + k

So y$^{2}$ – x$^{2}$ = (x + k)$^{2}$ – x$^{2}$ = k$^{2}$ + 2xk = k (2x + k)

From this, we conclude that the difference of squares of two odd perfect squares will be a multiple of 8 and the difference of squares of two even perfect squares will be a multiple of 4.

For example:

We have 4 and 6

Here x = 4 and k = 2

y$^{2}$ – x$^{2}$ = 6$^{2}$ – 4$^{2}$ = 2 (2 x 4 + 2) = 2 (8 + 2) = 2 x 10 = 20 = 4 x 5

Again let y = 7 and x = 3. Here k = 4

y$^{2}$ – x$^{2}$ = 7$^{2}$ – 3$^{2}$ = 4 (2 x 3 + 4) = 4 (6 + 4) = 4 x 10 = 40 = 8 x 5
Let us see some examples on difference of two squares
Example 1:

Factorize the given polynomials to the limit they can be factorized.
a) x$^{4}$ – 81
b) (x – 3)$^{2}$ – (y – 2)$^{2}$
c) Z$^{8}$ – 1
d) x$^{2}$ – 81z$^{2}$

Solution:

a) x$^{4}$ – 81 = (x$^{2})^{2}$ – 9$^{2}$
= (x$^{2}$ – 9) (x$^{2}$ + 9)
= (x$^{2}$ – 3$^{2}$) (x$^{2}$ + 9)
= (x + 3) (x – 3) (x$^{2}$ + 9)

b) (x – 3)$^{2}$ – (y – 2)$^{2}$ = (x – 3 + y – 2) {x – 3 – (y – 2)}
= (x + y – 5) (x – y – 1)

c) z$^{8}$ – 1 = (z$^{4})^{2}$ – 1$^{2}$
= (z$^{4}$ – 1) (z$^{4}$ + 1)
= {(z$^{2})^{2}$ – 1$^{2}$} (z$^{4}$ + 1)
= (z$^{2}$ – 1) (z$^{2}$ + 1) (z$^{4}$ + 1)
= (z + 1) (z – 1) (z$^{2}$ + 1) (z$^{4}$ + 1)

d) x$^{2}$ – 81z$^{2}$ = x$^{2}$ – (9y)$^{2}$
= (x – 9y) (x + 9y)

Example 2:

Find the value of the given numbers
a) 97 x 103
b) 33 x 27
c) 49 x 51

Solution:

a) 97 x 103
    97 = 100 – 3
    103 = 100 + 3
So, 97 x 103 = (100 – 3) (100 + 3) = (100)$^{2}$ – 3$^{2}$ = 10000 – 9 = 9991

b) 32 x 28
    32 = 30 + 2
    28 = 30 – 2
    32 x 28 = (30 + 2) (30 – 2) = (30)$^{2}$ – 2$^{2}$ = 900 – 4 = 896

c) 49 x 51
    49 = 50 – 1
    51 = 50 + 1
    49 x 51 = (50 – 1) (50 + 1) = (50)^2 – 1 = 2500 – 1 = 2499