Complex product identity

The Complex product identity expresses the product of any two numbers, each expressed as the sum of two squares, as the sum of two squares. [ Edit]
 * Main article: Complex product identity



Derivation from complex numbers
If u=a&minus;bi and U=A+Bi, then from
 * u||U|=|uU|,

we get
 * (a2+b2)(A2+B2) = (aA+bB)2+(aB&minus;bA)2

In defining u, the sign of b is arbitrary; We could have just as easily defined u=a+bi (or interchanged the meanings of A and B), so the identity can also be stated,
 * (a2+b2)(A2+B2) = (aA&minus;bB)2+(aB+bA)2

Generalization
By defining $$u=a-\sqrt{n}bi\,$$ and $$U=A+\sqrt{n}Bi\,$$, then from
 * u||U|=|uU|,

we get
 * (a2+nb2)(A2+nB2) = (aA+nbB)2+n(aB&minus;bA)2

Application
A simple application of this identity is
 * 2(A^2+B^2) = (A+B)^2+(A-B)^2