<s>[INST] Using generating functions find the sum $1^3 + 2^3 + 3^3 +\dotsb+ n^3$ I am quite new to generating functions concept and I am really finding it difficult to know how to approach problems like this. I need to find the sum of $1^3 + 2^3 + 3^3 +\dotsb+ n^3$ using generating functions. How do I proceed about it?
 [/INST] Note that if $A(z) = \sum_{n \ge 0} a_n z^n$, then
$$
z \frac{\mathrm{d}}{\mathrm{d} z} A(z)
  = \sum_{n \ge 0} n a_n z^n
$$
and also:
$$
\frac{A(z)}{1 - z}
  = \sum_{n \ge 0} \left( \sum_{0 \le k \le n} a_k \right) z^n
$$
Starting with:
$$
\sum_{n \ge 0} z^n
  = \frac{1}{1 - z}
$$
the generating function for the sum you want is:
$\begin{align}
 \frac{z}{1 - z}
   \frac{\mathrm{d}}{\mathrm{d} z}
     \left( z \frac{\mathrm{d}}{\mathrm{d} z}
       \left( z \frac{\mathrm{d}}{\mathrm{d} z} \frac{1}{1 - z} \right)
     \right)
  &= \frac{z (1 + 4 z + z^2)}{(1 - z)^5}
\end{align}$
Thus:
$\begin{align}
\sum_{0 \le k \le n} k^3
  &= [z^n] \frac{z (1 + 4 z + z^2)}{(1 - z)^5} \\
  &= [z^n] (z + 4 z^2 + z^3) \sum_{k \ge 0} (-1)^k \binom{-5}{k} z^k \\
  &= [z^n] (z + 4 z^2 + z^3) \sum_{k \ge 0} \binom{k + 5 - 1}{5 - 1} z^k \\
  &= \binom{n - 1 + 4}{4}
        + 4 \binom{n - 2 + 4}{4}
        + \binom{n - 3 + 4}{4} \\
  &= \frac{n^2 (n + 1)^2}{4}
\end{align}$
Note that:
$$
\sum_{0 \le k \le n} k^3
  = \left( \sum_{0 \le k \le n} k \right)^2
$$
</s>