# MSC #22 – Using the Average: the Difference Of Two Squares(DOTS)

Our MATH-Inic Special for today is
the other half of “Using the average”. This time we will start with the
difference of two squares: **a ^{2} – b^{2} = (a + b) (a – c). **According to Sri Bharati Tirthaji, given
this form, a number can be readily expressed as a difference of two squares
because it is very easy to express any given number as a product of two
numbers. Even if a number is prime, it can be expressed as a product of itself
and 1, as in 11 = 11 x 1.

Now if we start with

**(a + b) ^{2} – (a – b)^{2} = (a^{2} + 2ab + b^{2}) – (a^{2} – 2ab + b^{2}) = 4ab**

We can now express **ab **as:

** ab = (a + b) ^{2} / 4 – (a – b)^{2}/4 = [(a + b)/2]^{2} – [(a – b)/2]^{2} **

In our example, we want to express 24 as a difference of two squares. 24 can be factored into 24 x 1, 12 x 2, 8 x 3 and 6 x 4. We used only the pairs, 12 x 2 and 6 x 4 because we want to use the squares of integers.

If we used 24 x 1, we would get, using
“by one more than the one before”, (25/2)^{2} – (23/2)^{2} =
12.5^{2} – 11.5^{2} = 12(13) – 11(12) = 2(12) = 24. (Note that 12.5^{2}
= 156.25 and 11.5^{2} = 132.25; the decimal parts will cancel each
other out)

On the other hand if we used 8 x 3,
we would have (11/2)^{2} – (5/2)^{2} = 5.5^{2} – 2.5^{2}
= 5(6) – 2(3) = 30 – 6 = 24

And since we can also express 24 as 48 x 1/ 2, 72 x 1/ 3, 96 x 1/ 4, etc. we can have an infinite number of ways to a number as as difference of two squares.

An interesting application of this is, given a number, we can form a Pythagorean triple. For example, if we are given a side 7, squaring it would give us 49 which we could factor as 49 x1. The hypotenuse then is (49 +1)/2 = 25 and the other side is (49 -1)/2 = 24. Thus 7,24,25 is a Pythagorean triple.

More interesting applications will be included in chapter 22 of our forthcoming book, *30 Master Strategies in Computing*