Lably
Skip to content

Difference of two squares

Mathematical identity of polynomials

  • 6 min read
  • 3 chapters

Learn it on Lably

a2−b2=(a+b)(a−b).

Note that a and b can represent more complicated expressions, such that the difference of their squares can be factored as the product of their sum and difference. For example, given a=2mn+2, and b=mn−2 :

a2−b2=(2mn+2)2−(mn−2)2=(3mn)(mn+4).

In the reverse direction, the product of any two numbers can be expressed as the difference between the square of their average and the square of half their difference:

xy=(x+y2)2−(x−y2)2.

Proof

Algebraic proof

The proof of the factorization identity is straightforward. Starting from the right-hand side, apply the distributive law to get (a+b)(a−b)=a2+ba−ab−b2. By the commutative law, the middle two terms cancel: ba−ab=0 leaving (a+b)(a−b)=a2−b2. The resulting identity is one of the most commonly used in mathematics. Among many uses, it gives a simple proof of the AM–GM inequality in two variables.

The proof holds not only for numbers, but for elements of any commutative ring. Conversely, if this identity holds in a ring R for all pairs of elements a and b, then R is commutative. To see this, apply the distributive law to the right-hand side of the equation and get a2+ba−ab−b2. For this to be equal to ⁠a2−b2⁠, we must have ba−ab=0 for all pairs a, b, so R is commutative.

Geometric proof

The difference of two squares can also be illustrated geometrically as the difference of two square areas in a plane. In the diagram, the shaded part represents the difference between the areas of the two squares, i.e. a2−b2. The area of the shaded part can be found by adding the areas of the two rectangles; a(a−b)+b(a−b), which can be factorized to (a+b)(a−b). Therefore, a2−b2=(a+b)(a−b).

Another geometric proof proceeds as follows. We start with the figure shown in the first diagram below, a large square with a smaller square removed from it. The side of the entire square is a, and the side of the small removed square is b; thus, the area of the shaded region is a2−b2. A cut is made, splitting the region into two rectangular pieces, as shown in the second diagram. The larger piece, at the top, has width a and height a-b. The smaller piece, at the bottom, has width a-b and height b. Now the smaller piece can be detached, rotated, and placed to the right of the larger piece. In this new arrangement, shown in the last diagram below, the two pieces together form a rectangle, whose width is a+b and whose height is a−b. This rectangle's area is (a+b)(a−b). Since this rectangle came from rearranging the original figure, it must have the same area as the original figure. Therefore, a2−b2=(a+b)(a−b).

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Mathematics