Formalize a proof without words of the identity $(1 + 2 + \cdots + n)^2 = 1^3 + 2^3 + \cdots + n^3$ This website gives the following proof without words for the identity  $(1 + 2 + \cdots + n)^2 = 1^3 + 2^3 + \cdots + n^3$.

I find it interesting but have trouble seeing the proof behind it.  Could anyone could give me a formal proof based on this animation?
 A: Notice that the base of the $n^\text{th}$ cube is the diagonal square prism $n^2\times 1$, and that each cube is build out of the diagonal square prism and rectangular prisms above and to the left of the diagonal square prism.  Since adding another term to the left hand sum will give us one more diagonal square and set of prisms above and left of it, this suggests we can use induction.
For $n=1$, we trivially have $\left(\sum_{m=1}^n m\right)^2 = \sum_{m=1}^n m^3$.
Now, let's suppose $\left(\sum_{m=1}^n m\right)^2 = \sum_{m=1}^n m^3$ for some $n$.  Then,
$$\begin{align*}\left(\sum_{m=1}^{n+1} m\right)^2 &= \left(n+1 + \sum_{m=1}^{n} m\right)^2\\ 
&= (n+1)^2 + 2(n+1)\left(\sum_{m=1}^{n} m\right) + \left(\sum_{m=1}^{n} m\right)^2 \tag{*}\\
&= (n+1)^2 + 2(n+1)\frac{n(n+1)}{2} + \sum_{m=1}^{n} m^3 \tag{**}\\ 
&= (n+1)^2(n+1) + \sum_{m=1}^{n} m^3\\
&= \sum_{m=1}^{n+1} m^3
\end{align*}$$
where $(**)$ comes from the well known identity $\sum_{m=1}^n m = \frac{n(n+1)}{2}$.  In $(*)$, the first term is the volume of the diagonal square prism, the middle term is the volume of the rectangular prisms left of and above the diagonal prism, and the last term is the volume of the remaining shapes.
A: This gif is a nice visualization of the following algebraic manipulations (color to correspond to the colors in the gif):
\begin{align*}
(1 + 2 + 3 + \cdots + n)^2
&= \sum_{i=1}^n \sum_{j=1}^n ij \\
&= \color{green}{\sum_{1 \le i < j \le n} ij} + \color{red}{\sum_{1 \le j < i \le n} ji} + \color{blue}{\sum_{1 \le j \le n} j^2} \\
&= \color{green}{\sum_{1 \le i < j \le n} ij} + \color{red}{\sum_{1 \le i < j \le n} ji} + \color{blue}{\sum_{1 \le j \le n} j^2} \\
&= \sum_{j=1}^n j \left[ \color{green}{\sum_{i=1}^{j-1} i} + \color{red}{\sum_{i=1}^{j-1} i} + \color{blue}{j} \right] \\
&= \sum_{j=1}^n j \left[ \sum_{i=1}^{j-1} \big(\color{green}{(i)} + \color{red}{(j-i)}\big) + \color{blue}{j} \right] \\
&= \sum_{j=1}^n j \left[ \sum_{i=1}^j j\right] \\
&= \sum_{j=1}^n j^3.
\end{align*}

A: Method 1 (By $k^3=k\cdot k^2=k$ pieces of squares of side $k$)
$\displaystyle \quad  (1^{3}+2^{3}+3^{3}+\ldots+n^{3} )cm^3
\\= 1 \cdot (1^{2} cm^2\times 1 cm)+2 \cdot (2^{2}cm^2\times 1 cm)+3 \cdot (3^{2} cm^2\times 1cm)+\ldots+n \cdot (n^{2}cm^2\times 1 cm)
\\=(1cm+2cm+3cm+\cdots+ncm)^2\times 1cm$
Method 2(By Induction)
The statement is true for $n=1$, now assume it is true for some $n$, then $$
\begin{aligned}
\sum_{k=1}^{n+1} k^{3}&=\sum_{k=1}^{n} k^{3}+(n+1)^{3} \\
&=\left(\sum_{k=1}^{n} k\right)^{2}+n(n+1)^{2}+(n+1)^{2} \\
&=\left(\sum_{k=1}^{n} k\right)^{2}+2(n+1)\left(\sum_{k=1}^{n} k\right)+(n+1)^{2} \\
&=\left[\sum_{k=1}^{n} k+(n+1)\right]^{2} \\
&=\left(\sum_{k=1}^{n+1} k\right)^{2}
\end{aligned}
$$
Method 3(By difference)
Considering the difference yields
\begin{aligned}\\  n^{3}-(n-1)^{3}&=3 n^{2}-3 n+1 \\
\therefore  \sum_{k=1}^{n}\left[n^{3}-(n-1)^{3}\right]&=3 \sum_{k=1}^{n} n^{2}-3 \sum_{k=1}^{n} n+n \\ k^{4}-(k-1)^{4}&=4 k^{3}-6 k^{2}+4 k-1 \end{aligned}
Summing up yields
\begin{aligned}
 \sum_{k=1}^{n}\left[k^{4}-(k-1)^{4}\right]&=4 \sum_{k=1}^{n} k^{3}-6 \sum_{k=1}^{n} k^{2}+4 \sum_{k=1}^{n} k-n \\
n^{4}&=4 \sum_{k=1}^{n} k^{3}-6 \cdot \frac{n}{6} \cdot(n+1)(2 n+1)+4 \cdot \frac{n}{2}(n+1)-n \\
4 \sum_{k=1}^{n} k^{3}&=n^{4}+n \left( n+1\right)(2 n+1)-2 n(n+1)+n  =[n(n+1)]^{2} \\
\sum_{k=1}^{n} k^{3}&=\left[\frac{n(n+1)}{2}\right]^{2}=(1+2+3+\cdots+n)^{2}
\end{aligned}
Wish you enjoy the explanation!
