In mathematics, the difference of two squares refers to the identity
- a2 − b2 = (a + b)(a − b)
from elementary algebra. The proof is straightforward, starting from the RHS: apply the distributive law to get a sum of four terms, and set
- ba − ab = 0
as an application of the commutative law. The resulting identity is one of the most commonly used in all of mathematics.
The proof just given indicates the scope of the identity in abstract algebra: it will hold in any commutative ring R. Also, conversely, if it holds in a ring R, then R is commutative.