Home/Blog/Programming/Geometric visualization of the binomial theorem
Home/Blog/Programming/Geometric visualization of the binomial theorem

Geometric visualization of the binomial theorem

Aamir Shahzad
Jan 18, 2024
8 min read

A binomialThe etymology comes from the Latin root: binomium. From bi- meaning "having two" and nomos meaning "part" or "portion." expression is a polynomial with two terms. These two terms may involve variables, constants, or powers to the variables, and they are combined with addition or subtraction operators. Following are a few examples of binomial expressions:

  • x+yx+y

  • x+5x+5

  • x2+y3x^2 + y^3

  • 2xy+4y32xy + 4y^3

Now that we know what a binomial expression is, let's multiply a binomial expression with itself to get powers of the binomial term. These powers can be expanded using the binomial theorem.

A general expression for binomial theorem goes as follows:

A power of nn means we are multiplying (a+b)(a+b) with itself nn times. The multiplicative constant (nk){n \choose k} is called the binomial coefficient. It gets multiplied with the term ankbka^{n-k}b^k. This means that out of nn, we choose kk of bb terms and choose nkn-k of aa terms and get the powers of these terms.

Let’s look at a simple binomial expression with the first few powers:

In the following section, we'll give a visual explanation of some simple binomial expressions, without going into the algebraic manipulations.

Square of addition of the two terms#

We add the two terms aa and bb and take the square of their sum. We get the following binomial expansion:

Geometric proof#

The above expression involves squares and multiplications. In geometry, the multiplication of two terms defines the area of a shape. The most commonly used areas are the areas of squares and rectangles.

  • The area of a square shape is simply the square of the length of its side.

  • The area of a rectangle is the multiplication of its length with its width.

In the equation above,

  • We see the square terms, (a+b)2(a+b)^2, a2a^2, and b2b^2. We may think of these as areas of squares with sides (a+b)(a+b), aa, and bb.

  • The term involving abab can be seen as the area of a rectangle with sides aa and bb.

Let’s visualize it in the following figure:

Visualizing the square of (a + b) and its binomial expansion
Visualizing the square of (a + b) and its binomial expansion

We can see that the areas of the two regions in the image above are the same.

The side of the square with the length (a+b)(a+b) is divided into two segments: length aa and length bb. Let’s build squares of these sides within the larger square area. We get squares with areas a2a^2 and b2b^2. However, we also notice a couple of rectangles with sides aa and bb as well. The area of this rectangle is abab. There are two of these rectangles, so the area is 2ab2ab.

By adding all these areas we get the area of the larger square that is (a+b)2(a+b)^2.

Equating the areas of the larger square to the sum of areas of the components, we get the binomial expansion of power 22:

Visualizing individual terms in the binomial expansion
Visualizing individual terms in the binomial expansion

Square of subtraction of the two terms#

Let’s make a slight variation in the binomial terms. Instead of taking the sum, we take the difference (ab)(a-b), and compute its square. By direct multiplication, we get the following result:

Let’s show it geometrically.

Geometric proof#

Visualizing it geometrically is not as simple as in the case of the sum of the binomial terms. Again, we see squares and multiplication terms, indicating we can visualize with squares and rectangles and compute their areas.

On the left-hand side of the equation, we see the difference of the two terms. We can think of it as the difference between the lengths of the sides of two squares. The larger square has the side of length aa, and the smaller square has the side of length bb. We take the difference of the two lengths (ab)(a-b) and build a square with this length. The area of this square is (ab)2(a-b)^2.

Visualizing square of (a – b) and its binomial expansion
Visualizing square of (a – b) and its binomial expansion

Let’s look at the right side of the figure now. We get a larger square with a side of length aa. Its area is a2a^2.

  • It contains the smaller square of side (ab)(a-b). Its area is (ab)2(a-b)^2.

  • On top of this smaller square is a rectangle with sides aa and bb, so its area is abab.

  • The same rectangle is there, in the vertical position on the right side of the square with sides aa and bb. The area of the rectangle is abab.

  • We subtract areas of the rectangles from the larger square of the side aa, and we get the area a22aba^2-2ab.

  • It’s important to notice here that the two rectangles overlap with each other. The area of the intersection is b2b^2. When we subtract the rectangles, we subtract the area b2b^2 twice. We need to add it back once to get the correct measure. We get the area a22ab+b2a^2 -2ab +b^2.

So the two areas are the same:

Visualizing individual terms in the binomial expansion of square of (a - b)
Visualizing individual terms in the binomial expansion of square of (a - b)

Difference of squares of the two terms#

Let’s look at another binomial expression:

This gives us a nice factored form when we have a difference of two squared terms. We can easily show it algebraically by simply multiplying the factors on the right-hand side of the equation. Let’s show it visually.

Geometric proof#

The left-hand side of the equation indicates the difference of areas of two squares a2a^2 and b2b^2. The right-hand side is the area of a rectangle with sizes (a+b)(a+b) and (ab)(a-b).

Visualizing the difference of two squares in the factored form
Visualizing the difference of two squares in the factored form

On the left side of the figure, we see the difference in the areas of the two squares. We get a figure whose upper-right corner is missing. Let’s see how an area of this shape equals the area of a rectangle with sides (a+b)(a+b) and (ab)(a-b).

  • On the right side, we see the blue rectangle has sides of lengths (ab)(a-b) and bb. It is positioned on top of the square with an area of (ab)2(a-b)^2. When we look at the rectangle and square together, we get a larger rectangle with a vertical side of length aa and a horizontal base with length (ab)(a-b).

  • Below the square with area b2b^2, we get a smaller vertical rectangle with sides of bb and (ab)(a-b). Now, let’s rotate this rectangle and stack it horizontally under the larger white square, which has an area of (ab)2(a-b)^2.

Rearranging the individual components to form a rectangle with sides (a + b) and (a - b)
Rearranging the individual components to form a rectangle with sides (a + b) and (a - b)

The two rectangles and the square, when stacked on top of each other, form a larger rectangle with sides of lengths (ab)(a-b) and (a+b)(a+b). The area of this larger rectangle is (a+b)(ab)(a+b)(a-b).

So, we get the identity:

Higher powers#

Can we do it for higher powers? Let’s see for n=3n=3. We know the binomial expansion for power 33 is as follows:

We can validate it simply by multiplying the (a+b)(a+b) term three times.

Let’s visualize it geometrically.

Geometric proof#

We can think of (a+b)3(a+b)^3 as the volume of a cube with equal sides of length (a+b)(a+b). Let’s dissect this cube by slicing the length (a+b)(a+b) into smaller lengths aa and bb.

Visualizing the expansion of cube of (a+b)
Visualizing the expansion of cube of (a+b)

We get a number of cubes and cuboids. Let’s gather their volumes.

  • We see two cubes of volumes a3a^3 and b3b^3.

  • There are three cuboids of volumes a2ba^2b.

  • There are three cuboids of volumes ab2ab^2.

We get the total volume as follows:

Note: For higher powers it becomes hard to show it visually on a two dimensional plane.

Conclusion#

Geometry gives a beautiful way to understand the basic mathematical concepts. In this blog, we proved some basic binomial theorem expansions with the help of geometric shapes. Although it can be done algebraically, the geometric proofs give us a good insight into how the mathematical expressions are actually working.

Getting insights with geometric proofs may help to visualize many mathematical problems and analyses of algorithms.

Your next learning steps#

Problem solving skill is fundamental to computing. Visualizing a problem and its solution simplifies the problem solving approach, its explanation, and analysis. Educative offers some interesting courses to develop and enhance problem solving skills. Have a look at the following courses offered here at Educative:


  

Free Resources