Brahmagupta–Fibonacci identity
In algebra, the Brahmagupta–Fibonacci identity expresses the product of two sums of two squares as a sum of two squares in two different ways. Hence the set of all sums of two squares is closed under multiplication. Specifically, the identity says
For example,
The identity is also known as the Diophantus identity, as it was first proved by Diophantus of Alexandria. It is a special case of Euler's four-square identity, and also of Lagrange's identity.
Brahmagupta proved and used a more general Brahmagupta identity, stating
This shows that, for any fixed A, the set of all numbers of the form x2 + Ay2 is closed under multiplication.
These identities hold for all integers, as well as all rational numbers; more generally, they are true in any commutative ring. All four forms of the identity can be verified by expanding each side of the equation. Also, (2) can be obtained from (1), or (1) from (2), by changing b to −b, and likewise with (3) and (4).