Brahmagupta's identity
In mathematics, Brahmagupta's identity says that the product of two numbers, each of which being a sum of two squares, is itself a sum of two squares. Specifically:(a2 + b2)(c2 + d2) = (ac-bd)2 + (ad+bc)2
The identity holds in any commutative ring, but most usefully in the integers.
See also Euler's four-square identity. There is a similar eight-square identity derived from the Cayley numbers, but that isn't particularly interesting for integers because every positive integer is a sum of four squares.