Euler's four-square identity
In mathematics, Euler's four-square identity says that the product of two numbers, each of which is a sum of four squares, is itself a sum of four squares. == Algebraic identity == For any pair of quadruples from a commutative ring, the following expressions are equal: ( a 1 2 + a 2 2 + a 3 2 + a 4 2 ) ( b 1 2 + b 2 2 + b 3 2 + b 4 2 ) = ( a 1 b 1 − a 2 b 2 − a 3 b 3 − a 4 b 4 ) 2 + ( a 1 b 2 + a 2 b 1 + a 3 b 4 − a 4 b 3 ) 2 + ( a 1 b 3 − a 2 b 4 + a 3 b 1 + a 4 b 2 ) 2 + ( a 1 b 4 + a 2 b 3 − a 3 b 2 + a 4 b 1 ) 2 .
Source: Wikipedia — Euler's four-square identity (CC BY-SA 4.0)