# Write $xy$ as the sum of the squares of two rational integers

Show that if $x$ and $y$ may both be written as the sum of the squares of two rational integers, then their product $xy$ may also be written as the sum of the squares of two rational integers.

• What is a rational integer? – wythagoras May 15 '15 at 14:32
• I guess the OP means the "ordinary" integers such as $\dots, -1, 0, 1 \dots$. The OP might want to rule out such as Gaussian integers. I saw in Hardy's number theory that terminology. – Megadeth May 15 '15 at 14:34
• The identity to use is often called the Fibonacci Identity (please see Wikipedia) even though a more general identity was used by Brahmagupta several centuries before Fibonacci, and the identity was used by Diophantus even earlier. – André Nicolas May 15 '15 at 14:43

If $x = a^2 + b^2$ and $y = b^2 + d^2$ then:

$$xy = (a^2+b^2)(c^2+d^2) = a^2c^2 + a^2d^2 + b^2c^2 + b^2d^2 = (ac+bd)^2 + (ad-bc)^2$$

• Just what I was looking for, thank you – sandy May 15 '15 at 14:42

HINT $$(a^2+b^2)(c^2+d^2) = (ac+bd)^2 + (ad-bc)^2$$

If the two numbers are $a^2+b^2$ and $c^2+d^2$, then their product is $(ac-bd)^2+(ad+bc)^2$.

Proof: write $a^2+b^2$ as the determinant $\left| \begin{array} {cc} a & \mathbb i b \\ \mathbb i b & a \end{array} \right|$, and $c^2+d^2 = \left| \begin{array} {cc} c & \mathbb i d \\ \mathbb i d & c \end{array} \right|$. Then multiply these two determinants.

Since you are studying Gaussian integers, please note that the "Fibonacci" identity that one uses just says that if $N(x+iy)$ is the norm of the Gaussian integer $x+iy$, the "Fibonacci" identity that one uses just says that $$N((a+bi)(c+di))=N(a+bi)N(c+di).$$

By taking square roots, we can see that the result can be viewed as saying that if $z_1$ and $z_2$ are any complex numbers, then $|z_1z_2|=|z_1||z_2|$.