<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] Let $s_n=\sum_{k=0}^nk^3$; your generating function for these numbers will be $$f(x)=\sum_{n\ge 0}s_nx^n\;.$$
You know that the sequence satisfies the recurrence $s_n=s_{n-1}+n^3$. Multiply this recurrence by $x^n$ and sum over $n\ge 0$:
$$\sum_{n\ge 0}s_nx^n=\sum_{n\ge 0}s_{n-1}x^n+\sum_{n\ge 0}n^3x^n\tag{1}\;.$$
The lefthand side of $(1)$ is $f(x)$. We assume that $s_n=0$ for all $n<0$, so we can rewrite $(1)$ as $$f(x)=x\sum_{n\ge 0}s_{n-1}x^{n-1}+\sum_{n\ge 0}n^3x^n=x\sum_{n\ge 0}s_nx^n+\sum_{n\ge 0}n^3x^n=xf(x)+\sum_{n\ge 0}n^3x^n$$ and see that $$f(x)=\frac1{1-x}\sum_{n\ge 0}n^3x^n\;.\tag{2}$$
To deal with the summation in $(2)$, start with $$\frac1{1-x}=\sum_{n\ge 0}x^n\;.$$ Differentiate and multiply by $x$ to get $$\frac{x}{(1-x)^2}=\sum_{n\ge0}nx^n\;.$$ Repeat: $$\frac{x(1+x)}{(1-x)^3}=\sum_{n\ge0}n^2x^n\;.$$ And one more time: $$\frac{x(1+4x+x^2)}{(1-x)^4}=\sum_{n\ge 0}n^3x^n\;.$$ Thus,
$$f(x)=\frac{x+4x^2+x^3}{(1-x)^5}\;.$$ Now decompose $f$ into partial fractions:
$$f(x)=-\frac1{(1-x)^2}+\frac7{(1-x)^3}-\frac{12}{(1-x)^4}+\frac6{(1-x)^5}\;.$$
Finally, you need to know some standard generating functions. In particular, you need to know that $$\frac1{(1-x)^k}=\sum_{n\ge 0}\binom{n+k-1}{k-1}x^n\;.$$ With that you get finally that 
$$\begin{align*}
f(x)&=\sum_{n\ge 0}\left(-\binom{n+1}1+7\binom{n+2}2-12\binom{n+3}3+6\binom{n+4}4\right)x^n\\
&=\sum_{n\ge 0}\frac14\left(n^4+2n^3+n^2\right)x^n
\end{align*}$$
and therefore that $$s_n=\frac14\left(n^4+2n^3+n^2\right)=\left(\frac{n(n+1)}2\right)^2\;.$$
</s>