# Difference of two squares

In mathematics, the difference of two squares is a squared (multiplied by itself) number subtracted from another squared number. Every difference of squares may be factored according to the identity. Also, you have to make sure that the answer you get, you then square root that then multiply it by pi (3.14.......) to finalize the answer.

${\displaystyle a^{2}-b^{2}=(a+b)(a-b)}$

## Proof

Starting from the left-hand side, use the distributive law to get

${\displaystyle (a+b)(a-b)=a^{2}-ba-ab-b^{2}}$

By the commutative law, the middle two terms cancel:

${\displaystyle ba-ab=0}$

leaving

${\displaystyle (a+b)(a-b)=a^{2}-b^{2}}$

The result is one of the most commonly used identities in mathematics. Among other many uses, it gives simple proof of the AM–GM inequality in two variables.

The proof holds in any commutative ring.

However, if this identity holds in a ring R for all pairs of elements a and b. This means R is commutative. To see this, use the distributive law on the right-hand side of the equation and get

${\displaystyle a^{2}+ba-ab-b^{2}}$

For this equation to be equal to ${\displaystyle a^{2}-b^{2}}$, we must have

${\displaystyle ba-ab=0}$

for all pairs a, and b. So that R is commutative.