I've been given an assignment question that says this:
Show that the ordinary generating function for the sequence $\{a_n\}_{n\geq0}$ where $a_n = n^2$ is
$$g(t) = \frac{t(1+t)}{(1-t)^3}$$
I'm not sure how to start and was wondering if anyone could give me some suggestions as to where to begin. Many thanks for any help.
First note the identity $$ n^2=\binom{n+1}{2}+\binom{n}{2}\tag{1} $$ and recall the binomial theorem $$ (1+x)^{\alpha}=\sum_{n=0}^\infty \binom{\alpha}{n}x^n.\quad (\alpha\in\mathbb{C}) $$ which converges absolutely for $\lvert x\rvert <1$. In particular $$ (1-x)^{-3}=\sum_{n=0}^\infty \binom{-3}{n}(-x)^n =\sum_{n=0}^\infty \binom{n+2}{2} x^n\tag{2}. $$ The identity (1) together with (2) imply that $$ [x^n]\left(\frac{x(1+x)}{(1-x)^3}\right) =[x^n]\left(\frac{x}{(1-x)^3}\right)+[x^n]\left(\frac{x^2}{(1-x)^3}\right) =\binom{n+1}{2}+\binom{n}{2} =n^2. $$ where $[x^n]$ extracts the coefficient of $x^n$ in the generating function.