# Expressing a number as a difference of two squares

Any whole number can be expressed as a product of two whole numbers. If the number is prime, it can be expressed as a product of itself and 1. The algebraic formula a2 – b2 = (a + b)(a – b) shows that the product of the sum (a + b) and their difference (a – b)  is a difference of two squares.

Case A is easy to illustrate. 17, a prime number can be expressed only as a product of 17 and 1.  So let (a – b) = 1; that is, let a and b be consecutive numbers adding up to 17. a and b are thus 9 and 8 respectively.

Therefore, ( 9 + 8) ( 9 – 1) = (92 – 82) = 81 – 64 = 17

In case B, 24 can be expressed as 24 x 1, 12 x 2 , 8 x 3 and 6 x 4. We can immediately see that we can not apply the method we used in case B. We need a more general solution. In his book Vedic Mathematics, Sri Bharati Tithaji showed how we can do that.

If we expand (a + b)2   and (a – b)2 and take their difference, we would get

(a2 + 2ab + b2) – (a2 – 2ab + b2) = 4ab or

(a + b)2  – (a – b)2 = 4 ab and

[(a + b)/2]2  – [(a – b)/2]2 = ab

Now if we take 24 as 12 x 2, we would have (12 + 2)/2 = 7 and (12 – 2)/2 = 5 and

72 – 52 = 49 – 25 = 24.

For 24 = 6 x 4, we have (6 + 4)/2 = 5 and (6 – 4)/2 = 1 ; 52 – 12 = 25 – 1 = 24.

We can also apply it for 3 x 8. (8 + 3)/2 = 11/2 and (8 – 3)/2 = 5/2;

(11/2)2 – (5/2)2 = 121/4 – 25/4 = 96/4 = 24

For 1 x 24, we have (24 + 1)/2 = 25/2 and (24 – 1)/2 = 23/2;

(25/2)2 – (23/2)2 = 625/4 – 529/4 = 96/4 = 24

Let us now apply this formula in case B. (17 + 1)/2 = 9 and (17 – 1)/2 = 8. We will again have 92 – 82 = 81 – 64 = 17.

Later we will see how this formula can be used in determining the sides of a right triangle.

Suggested readings: Sri Bharati Tirthaji, Vedic Mathematics, pp 281-284.