Brahmagupta's identity

In other words, the set of such numbers is closed under multiplication.

Specifically: Both (1) and (2) can be verified by expanding each side of the equation.

That identity was rediscovered by Brahmagupta (598–668), an Indian mathematician and astronomer, who generalized it and used it in his study of what is now called Pell's equation.

[1] The identity later appeared in Fibonacci's Book of Squares in 1225.

In its original context, Brahmagupta applied his discovery to the solution of what was later called Pell's equation, namely x2 − Ny2 = 1.