Generating functions - deriving a formula for the sum $1^2 + 2^2 +\cdots+n^2$ I would like some help with deriving a formula for the sum $1^2 + 2^2 +\cdots+n^2$ using generating functions. 
I have managed to do this for $1^2 + 2^2 + 3^2 +\cdots$ by putting
$$f_0(x) = \frac{1}{1-x} = 1 + x + x^2 + x^3 +\cdots$$
$$f_1(x) = x \frac{d}{dx}[f_0(x)] = \frac{1}{(1-x)^2} = 0 + x + 2x^2 + 3x^3 +\cdots$$
$$f_2(x) = x \frac{d}{dx}[f_1(x)] = \frac{x^2+x}{(1-x)^3} = 0^2 + 1^2x + 2^2x^3 + 3^2x^3+\cdots,$$
and I assume I'm supposed to be able to do something similar in this case, but things get trickier when it's bounded by n and I keep getting stuck.

To answer otherwise, you can use the known fact that the sum of the first $n$ positive odd numbers is equal to $n^2$. So you have
$$\begin{cases}1=1^2\\1+3=2^2\\1+3+5=3^2\\1+3+5+7=4^2\\................\\1+3+5+…….+(2n-1)=n^2 \end{cases}$$  Therefore
 $$\sum_{i=1}^{i=n}n^2=n+(n-1)3+(n-2)5+(n-3)7+………+2(2n-3)+(2n-1)$$  That is to say
$$\sum_{i=1}^{n}n^2=\sum_{k=0}^{n-1}(n-k)(2k+1)=\frac{n(n+1)(2n+1)}{6}$$
NOTE.- Quite different story is the sequence of the corresponding inverse squares; one has the Euler’s formula  $$\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{(\pi)^2}{6}$$
