mitchell vitez blog music art media dark mode

The sum of cubes is the square of the sum

A few years ago, I encountered this mathematical identity for the first time: the sum of the first \(n\) cubes is the square of the sum of the first \(n\) (where we have \(n \in \N\))

\[\sum n^3 = \left(\sum n\right)^2\]

To be super clear, here’s a version with explicit indices1

\[\sum_{k=1}^n k^3 = \left(\sum_{k=1}^n k\right)^2\]

I wanted to play with this a bit and see if I could prove it for myself.

Proof

As a first approach, I happen to remember the sum of the first \(n\) naturals is \(\frac{n(n+1)}{2}\), which we can substitute in.

\[\sum n^3 = \left(\frac{n(n+1)}{2}\right)^2 \]

This simplifies to

\[\sum n^3 = \frac{n^2(n+1)^2}{4} \]

which is

\[\sum n^3 = \frac{n^2(n^2+2n+1)}{4} \]

or, equivalently,

\[\sum n^3 = \frac{n^4+2n^3+n^2}{4} \]

but this doesn’t seem to get us much closer without doing something to the left side, and I don’t happen to remember any convenient formulas dealing with cubes.

Instead, let’s tackle this by induction. For \(n = 1\) we have this for the left side

\[\sum_{k=1}^1 k^3 = 1^3 = 1\]

And this on the right

\[\left(\sum_{k=1}^1 k\right)^2 = 1^2 = 1\]

This is our base case taken care of. Now we have to show that when the equivalence is true for \(n\) it’s true for \(n+1\). “True for \(n\)” is this statement we saw earlier

\[\sum_{k=1}^n k^3 = \left(\sum_{k=1}^n k\right)^2\]

We can expand the left side in two ways: substituting in \(n+1\), and adding the \((n+1)\)th term directly.

\[\sum_{k=1}^{n+1} k^3 = \sum_{k=1}^{n} k^3 + (n+1)^3\]

We can add the same term to the right side instead

\[\left(\sum_{k=1}^{n+1} k\right)^2 = \left(\sum_{k=1}^n k\right)^2 + (n+1)^3\]

Substituting back in the remembered formula from earlier we get

\[\left(\frac{n(n+1)}{2}\right)^2 + (n+1)^3\]

Which we saw was this when partially simplified

\[\frac{n^2(n+1)^2}{4} + (n+1)^3\]

Now we can spot that there’s an \((n+1)^2\) term multiplying each subexpression (each side of the main plus sign), which is great progress. Let’s factor it out

\[ (n+1)^2 \left( \frac{n^2}{4} + n + 1 \right)\]

Simplify, which takes a few steps. First multiply the \(n+1\) piece by \(\frac{4}{4}\)

\[ (n+1)^2 \left( \frac{n^2}{4} + \frac{4(n + 1)}{4} \right)\]

Distribute and combine terms

\[ (n+1)^2 \frac{n^2 + 4n + 4}{4}\]

Factor

\[ (n+1)^2 \frac{(n+2)^2}{4}\]

Extract the squaring

\[\left( \frac{(n+1)(n+2)}{2} \right)^2\]

We’ve done a lot of manipulation to the right side, but remember we started by plugging in \(n+1\) on the left side to get here

\[\sum_{k=1}^{n+1} k^3 = \left( \frac{(n+1)(n+2)}{2} \right)^2\]

Let \(m = n + 1\)

\[\sum_{k=1}^{m} k^3 = \left( \frac{m(m+1)}{2} \right)^2\]

From before we remembered the sum of the first \(m\) naturals is \(\frac{m(m+1)}{2}\)

\[\sum_{k=1}^{m} k^3 = \left( \sum_{k=1}^{m} k \right)^2\]

Drop indices and swap \(n+1\) back in for \(m\)

\[\sum (n+1)^3 = \left( \sum (n+1) \right)^2\]

This proves the inductive case. So, we’ve shown this statement is true for \(n = 1\) and true for \(n + 1\) when true for \(n\). By induction we have (for all \(n \in \N\))

\[\sum n^3 = \left(\sum n\right)^2\]

There we go.


  1. For sticklers, we could start our indices from \(0\) since \(0 \in \N\). However: \[\sum 0^3 = 0^3 = \left(\sum 0\right) ^2 = 0^2 = 0\] so it isn’t really that interesting to include.↩︎