Find the generating function for $c_r = \sum^r_{i=1}i^2$ Find the generating function of
where $c_0 = 0, c_r = \sum^r_{i=1}i^2$.
Hence show that
$\sum^r_{i=1}i^2 = C^{r+1}_3 + C^{r+2}_3$
Attempt:
$c_r = \sum^r_{i=1}i^2$
= $x + 4x^2 + 9x^3 + ... + r^2x^r$
= $x(1 + 4x + 9x^2 + ... + r^2x^{r-1})$
= $x(\frac{1}{1-2x})$
How do i proceed from here? Is this even right?

$\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

$\ds{\mc{C}\pars{z} \equiv \sum_{r = 0}^{\infty}c_{r}z^{r}\,,\quad\verts{z} < 1\,,\qquad c_{0} = 0\,,\quad
\left.c_{r}\right\vert_{\ r\ \geq\ 1} = \sum_{i = 1}^{r}i^{2}}$.

$$\bbox[10px,#ffe,border:0.1em groove navy]{%
\begin{array}{l}
\mbox{Besides any 'Generating Function Method', the identity can be easily proved by using the}
\\
falling\ factorial\ a^{\underline{n}} \pars{~\mbox{see, for example, Knuth et. al.}\ Concrete\ Mathematics\ \mbox{book}~}:
\\[1mm]
\ds{i^{\underline{1}} = i}\ \mbox{and}\
\ds{i^{\underline{2}} = i\pars{i - 1} = i^{2} - i}\
\mbox{such that}\ \ds{i^{2} =  i^{\underline{2}} + i^{\underline{1}}}.
\\[2mm]
\mbox{Then,} 
\\
\ds{\color{#f00}{\left.c_{r}\right\vert_{\ r\ \geq\ 1}} =
\sum_{i = 1}^{r}i^{2} =
\sum_{0\ \leq\ i\ <\ r + 1}\pars{i^{\underline{2}} + i^{\underline{1}}} =
\pars{{1 \over 3}\,i^{\underline{3}} + {1 \over 2}\,i^{\underline{2}}}
_{1}^{r + 1} =
{1 \over 3}\,\pars{r + 1}^{\underline{3}} + {1 \over 2}\,\pars{r + 1}^{\underline{2}}}
\\[2mm]
\ds{= {1 \over 3}\pars{r + 1}r\pars{r - 1} + {1 \over 2}\pars{r + 1}r =
2{r + 1 \choose 3} + {r + 1 \choose 2}}
\\[2mm]
\ds{= {r + 1 \choose 3} + \bracks{{r + 1 \choose 3} + {r + 1 \choose 2}} =
\color{#f00}{{r + 1 \choose 3} + {r + 2 \choose 3}}}
\\[4mm]
\mbox{In the last step, we used the}\ Pascal\ Triangle\ Identity.
\end{array}}
$$

The Generating Function Method is somehow longer:
\begin{align}
\color{#f00}{\mc{C}\pars{z}} & =
\sum_{r = 1}^{\infty}z^{r}\braces{\sum_{i = 1}^{\infty}i^{2}\bracks{i \leq r}} =
\sum_{i = 1}^{\infty}i^{2}\sum_{r = i}^{\infty}z^{r} =
\sum_{i = 1}^{\infty}i^{2}\,{z^{i} \over 1 - z} =
{1 \over 1 - z}\sum_{i = 1}^{\infty}i^{2}z^{i}
\\[5mm] & =
{1 \over 1 - z}\pars{z\,\partiald{}{z}}^{2}\sum_{i = 1}^{\infty}z^{i} =
{1 \over 1 - z}\pars{z\,\partiald{}{z}}^{2}\pars{z \over 1 - z} =
{1 \over 1 - z}\bracks{z\pars{1 + z} \over \pars{1 - z}^{3}} =
\color{#f00}{{z\pars{1 + z} \over \pars{1 - z}^{4}}}
\\[5mm] & =
{2 \over \pars{1 - z}^{4}} - {3 \over \pars{1 - z}^{3}} +
{1 \over \pars{1 - z}^{2}} = 
\sum_{r = 0}^{\infty}\bracks{2{-4 \choose r} - 3{-3 \choose r} +
{-2 \choose r}}\pars{-z}^{r}
\\[5mm] & =
\sum_{r = 0}^{\infty}\bracks{2{r + 3 \choose 3} - 3{r + 2 \choose 2} +
{r + 1 \choose 1}}z^{r} =
\sum_{r = 0}^{\infty}\bracks{\color{#f00}{{r + 1 \choose 3} +
{r + 2 \choose 3}}}z^{r}
\end{align}


The last identity is straightforward recovered by using Pascal Triangle Identity.

