A difference of squares is an expression of the form . It factors according to the algebraic
identity
The algebraic identity holds in every commutative ring, and more generally whenever and
commute.
An integer is a difference of two integer squares iff
. Indeed,
is a product
of two integers having the same parity.
Conversely, an odd integer
has the representation
while an integer divisible by 4 can be written .