next up previous contents
Next: Areas of primitive Pythagorean Up: Pythagorean Triples, etc. Previous: The complex numbers from   Contents

The difference of two squares.


The difference of two squares is easily factored: We have,

$\displaystyle a^2-b^2=a^2-ab+ab-b^2=a(a-b)+b(a-b)=(a+b)(a-b)=(a-b)(a+b).
$

Claim 11   Every odd positive integer $ N>1$ is the difference of two positive integer squares.

Proof. Since $ N$ is greater than 1, $ N=n_1n_2$ for some odd positive integers $ n_1$ and $ n_2$ , $ n_1>n_2$ . So,

$\displaystyle \left(\frac{n_1+n_2}{2}\right)^2-\left(\frac{n_1-n_2}{2}\right)^2=n_1n_2=N.
$


Since $ n_1$ and $ n_2$ are both odd, $ \frac{n_1+n_2}{2}$ and $ \frac{n_1-n_2}{2}$ are integers. $ \qedsymbol$

Note that $ 1<N=N\cdot 1,$ hence we can always choose $ n_1=N$ and $ n_2=1.$ Then

$\displaystyle \left(\frac{N+1}{2}\right)^2-\left(\frac{N-1}{2}\right)^2=N\cdot 1=N.$

Claim 12   If $ N$ is an even positive integer then $ N$ is the difference of two positive integer squares if and only if $ N=4k$ for some integer $ k>1$ .

Proof. $ (\Rightarrow)   $ Let $ N=a^2-b^2=(a+b)(a-b)$ where $ a$ and $ b$ are positive integers, $ a>b.$ Set $ n_1=a+b$ and $ n_2=a-b.$ So, $ n_1n_2=N.$ Then

$\displaystyle a=\frac{n_1+n_2}{2}$   and$\displaystyle \quad b=\frac{n_1-n_2}{2}.
$

Since $ a$ and $ b$ are integers then $ n_1$ and $ n_2$ are both odd or they are both even. They can not both be odd since $ N$ is even. Hence for some integers $ k_1$ and $ k_2$ , $ k_1>k_2$ , $ n_1=2k_1$ and $ n_2=2k_2$ . Therefore $ N=n_1n_2=4k_1k_2=4k$ , $ k>1$ .


$ (\Leftarrow)   $ If $ N=4k$ , $ k>1$ , then $ k=k_1k_2$ for some positive integers $ k_1$ and $ k_2$ , $ k_1>k_2$ . Therefore

$\displaystyle N=4k=4k_1k_2=(k_1+k_2)^2-(k_1-k_2)^2.
$

$ \qedsymbol$


Example: $ N=15=15\cdot 1 =5\cdot 3.$ Therefore

$\displaystyle 15=\left(\frac{15+1}{2}\right)^2-\left(\frac{15-1}{2}\right)^2=\b...
...2}
=\left(\frac{5+3}{2}\right)^2-\left(\frac{5-3}{2}\right)^2=\boxed{4^2-1^2}.
$


Example: $ N=48$ . So $ 48/4=12=12\cdot 1=6\cdot
2=4\cdot 3.$ Therefore

$\displaystyle 48=(12+1)^2-(12-1)^2=\boxed{13^2-11^2}=(6+2)^2-(6-2)^2=\boxed{8^2-4^2}
=(4+3)^2-(4-3)^2=\boxed{7^2-1^2}.
$


The only positive integers that can not be written as the difference of two positive integer squares are exactly $ 1,  4$ , and those integers $ N$ such that
$ 4$ divides $ N+2$ (that is, $ 2, 6,
10, \cdots$ )
.


Theorem 9   The set of the differences of two squares of integers is closed under multiplication. In fact

$\displaystyle \left(a^2-b^2\right)\left(c^2-d^2\right)=(ac+bd)^2-(bc+ad)^2=(ac-bd)^2-(bc-ad)^2.$ (45)

Proof. Equation (45) is due to Diophantus and is a special case of Brahmagupta's identity

$\displaystyle \left(-na^2+b^2\right)\left(-nc^2+d^2\right)=\left(nac+bd\right)^2-n\left(bc+ad\right)^2= \left(nac-bd\right)^2-n\left(bc-ad\right)^2$ (46)

where $ n=1$ . The Diophantus identity is easily derived straightforwardly.

$\displaystyle \left(a^2-b^2\right)\left(c^2-d^2\right)$ $\displaystyle =(a+b)(a-b)(c+d)(c-d)$    
  $\displaystyle =\Bigl((a+b)(c+d)\Bigr) \Bigl((a-b)(c-d)\Bigr)$    
  $\displaystyle =\Bigl((ac+bd)+(bc+ad)\Bigr)\Bigl((ac+bd)-(bc+ad)\Bigr)$    
  $\displaystyle =\boxed{(ac+bd)^2-(bc+ad)^2}$    
  $\displaystyle =\Bigl((a+b)(c-d)\Bigr)\Bigl((a-b)(c+d)\Bigr)$    
  $\displaystyle =\Bigl((ac-bd)+(bc-ad)\Bigr)\Bigl((ac-bd)-(bc-ad)\Bigr)$    
  $\displaystyle =\boxed{(ac-bd)^2-(bc-ad)^2} .$    

$ \qedsymbol$


Example:

$\displaystyle 15=3\cdot 5=\left(2^2-1^2\right)\left(3^2-2^2\right)$ $\displaystyle =\left(2\cdot 3+1\cdot 2\right)^2-\left(2\cdot2 +1\cdot 3\right)^2=\boxed{8^2-7^2}.$    
  $\displaystyle =\left(2\cdot 3-1\cdot 2\right)^2-\left(2\cdot2 -1\cdot 3\right)^2=\boxed{4^2-1^2}.$    


Example:    Solving the equation $ x^2+y^2=z^2$ in relatively prime positive integers.


Solution:    We know that if $ x$ and $ y$ are relatively prime and $ x^2+y^2=z^2$ then one of $ x$ and $ y$ is odd. Without loss of generality let $ x>1$ be an odd positive integer. Then there exists relative prime odd positive integers $ n_1$ and $ n_2$ , $ n_1>n_2$ , such that

$\displaystyle n_1n_2=x=\left(\frac{n_1+n_2}{2}\right)^2-\left(\frac{n_1-n_2}{2}\right)^2.
$

$ n_1=x$ and $ n_2=1$ is one such pair.

Set

$\displaystyle m=\left(\frac{n_1+n_2}{2}\right)$   and$\displaystyle \quad
n=\left(\frac{n_1-n_2}{2}\right).
$

Thus, from equation (45),

$\displaystyle x^2=\left(m^2-n^2\right)\left(m^2-n^2\right)=(mm+nn)^2-(mn+nm)^2
=\left(m^2+n^2\right)^2-(2mn)^2.
$

From whence

$\displaystyle x=m^2-n^2,\quad y=2mn,$   and$\displaystyle \quad z=m^2+n^2
$

where $ m$ and $ n$ are relative prime positive integers of opposite parity, $ m > n$ . This implies that positive integers $ x, y,$ and $ z$ are pair-wise relatively prime.


Supplemental


From equation (45) we have the inequality,

$\displaystyle \left(a^2-b^2\right)\left(c^2-d^2\right)\le(ac-bd)^2.$ (47)

And equality holds if $ a=br$ and $ c=dr$ for some integer $ r$ .


Compare equation (45) to the Fibonacci identity ( another special case of Brahmagupta's identity. Set $ n=-1$ in equation (46) and note that $ \left(-x\right)^2=x^2$ ),

$\displaystyle \left(a^2+b^2\right)\left(c^2+d^2\right)=(ac- bd)^2+(bc+ ad)^2=(ac+ bd)^2+(bc- ad)^2.$ (48)

Similarly Fibonacci's identity can easily be derived straightforwardly. Set $ i^2=-1.$ That is, we will factor each sum of two squares into Gaussian numbers. Hence

$\displaystyle \left(a^2+b^2\right)\left(c^2+d^2\right)$ $\displaystyle =(a+bi)(a-bi)(c+di)(c-di)$    
  $\displaystyle =\Bigl((a+bi)(c+di)\Bigr) \Bigl((a-bi)(c-di)\Bigr)$    
  $\displaystyle =\Bigl((ac-bd)+(bc+ad)i\Bigr)\Bigl((ac-bd)-(bc+ad)i\Bigr)$    
  $\displaystyle =\boxed{(ac-bd)^2+(bc+ad)^2}$    
  $\displaystyle =\Bigl((a+bi)(c-di)\Bigr)\Bigl((a-bi)(c+di)\Bigr)$    
  $\displaystyle =\Bigl((ac+bd)+(bc-ad)i\Bigr)\Bigl((ac+bd)-(bc-ad)i\Bigr)$    
  $\displaystyle =\boxed{(ac+bd)^2+(bc-ad)^2} .$    

This identity implies Cauchy's inequality for reals in two dimensions,

$\displaystyle (a^2+b^2)(c^2+d^2)\ge (ac+bd)^2.
$


Example 1.


In the Fibonacci identity, set

  $\displaystyle a=\cos \theta_1,\quad b=\sin \theta_1,$    
  $\displaystyle c=\cos \theta_2,\quad d=\sin \theta_2.$    

Then

$\displaystyle \left(a^2+b^2\right)\left(c^2+d^2\right)$ $\displaystyle =\left(\cos\theta_1\cos\theta_2-\sin\theta_1\sin\theta_2\right)^2 +\left(\sin\theta_1\cos\theta_2+\sin\theta_2\cos\theta_1\right)^2$    
  $\displaystyle =\cos^2(\theta_1+\theta_2)+\sin^2(\theta_1+\theta_2)=1.$    


Similarly, the Diophantus identity (45), set

  $\displaystyle a=\cosh \theta_1,\quad b=\sinh \theta_1,$    
  $\displaystyle c=\cosh \theta_2,\quad d=\sinh \theta_2.$    

Then

$\displaystyle \left(a^2-b^2\right)\left(c^2-d^2\right)$ $\displaystyle =\left(\cosh\theta_1\cosh\theta_2+\sinh\theta_1\sinh\theta_2\right)^2 -\left(\sinh\theta_1\cosh\theta_2+\sinh\theta_2\cosh\theta_1\right)^2$    
  $\displaystyle =\cosh^2(\theta_1+\theta_2)-\sinh^2(\theta_1+\theta_2)=1.$    


Example 2.


See Multiplying Pythagorean triples.


next up previous contents
Next: Areas of primitive Pythagorean Up: Pythagorean Triples, etc. Previous: The complex numbers from   Contents
f. barnes 2008-04-29
Hosted by www.Geocities.ws

1