Let's tackle this problem visually: geometrically, the "cube" of any number can be interpreted as the volume of a cube with that number as its edge lengths (i.e. "3 cubed" is the volume of a cube with edges of length 3, and would have a volume of 3³ = 27). With that in mind, the cube of a + b would similarly be the volume of a cube with side lengths of a + b.
We can then break the larger cube down into parts to find the following pieces:
- One cube with edge lengths a and volume a³
- One cube with edge lengths b and volume b³
- Three rectangular prisms with edge lengths a, a, and b and volume a²b
- Three rectangular prisms with edge lengths b, b, and a and volume b²a
Adding all of these volumes together, we find that
(a + b)³ = a³ + 3a²b + 3b²a + b³
(Image source: math.brown.edu)
(The p and q in the image represent a and b in this problem)