Find a closed form of $\sum_{i=1}^n i^3$ I'm trying to compute the general formula for $\sum_{i=1}^ni^3$. My math instructor said that we should do this by starting with a grid of $n^2$ squares like so:
$$
\begin{matrix}
1^2     & 2^2      & 3^2   &   ...   &   (n-2)^2 & (n-1)^2 & n^2      \\
2^2     & 3^2      & 4^2   &   ...   &   (n-1)^2 & n^2     & 1^2      \\
3^2     & 4^2      & 5^2   &   ...   &   n^2     & 1^2     & 2^2      \\
\vdots &\vdots    & \vdots&\ddots      & \vdots  & \vdots  & \vdots   \\
(n-2)^2 & (n-1)^2  & n^2   &   ...   &   (n-5)^2 & (n-4)^2 & (n-3)^2  \\
(n-1)^2 & n^2      & 1^2   &   ...   &   (n-4)^2 & (n-3)^2 & (n-2)^2  \\
n^2     & 1^2      & 2^2   &   ...   &   (n-3)^2 & (n-2)^2 & (n-1)^2  \\
\end{matrix}
$$
And then sum the rows, and then sum all of the sums of rows. How would I then compute the general formula for $\sum_{i=1}^ni^3$?

Notice 
$$k^3 = k(k+1)(k+2) - k(3k+2) = k(k+1)(k+2) - 3k(k+1) + k$$
and following identities for positive integer $m$:
$$\sum_{k=1}^n k(k+1)(k+2)\cdots(k+m-1) =  \frac{1}{m+1} n(n+1)(n+2)(n+3)\cdots(n+m)$$
One get
$$\begin{align}
\sum_{k=1}^n k^3 = & \frac{1}{4}n(n+1)(n+2)(n+3) - n(n+1)(n+2) + \frac12 n(n+1)\\
= & \frac{1}{4}n(n+1)((n+2)(n+3) - 4(n+2) + 2)\\
= & \frac{1}{4}\left(n(n+1)\right)^2\\
= & \left(\sum_{k=1}^n k\right)^2
\end{align}$$
