Using generating functions, Find a closed formula to next expression: $\sum_{k=0}^m{k(k+2)}$ Using generating functions, Find a closed formula to next expression: 
$\sum_{k=0}^m{k(k+2)}$
If i use calculus power series rules, The question is fairly simple. But how can i find the proper relation with generating functions?

Let the desired sum be given by 
\begin{align}
S_{m} = \sum_{k=0}^{m} k(k+2).
\end{align}
Using the generating function method it is seen that the expression to calculate is
\begin{align}
\sum_{m=0}^{\infty} S_{m} \, t^{m}.
\end{align}
The calculation of this series is as follows. 
\begin{align}
\sum_{m=0}^{\infty} S_{m} \, t^{m} &= \sum_{m=0}^{\infty} \sum_{k=0}^{m} k(k+2) t^{m} \nonumber\\
&= \sum_{m=0}^{\infty} \sum_{k=0}^{\infty} k(k+2) t^{m+k} \nonumber\\
&= \sum_{m=0}^{\infty} t^{m} \cdot \sum_{k=0}^{\infty} k(k+2) t^{k} 
= \frac{1}{t(1-t)} \sum_{k=0}^{\infty} k(k+2) t^{k+1} \nonumber\\
&= \frac{1}{t(1-t)} \partial_{t} \, \sum_{k=0}^{\infty} k \, t^{k+2} 
= \frac{1}{t(1-t)} \partial_{t} \left[ t^{3} \sum_{k=0}^{\infty} k t^{k-1} \right] \\
&= \frac{1}{t(1-t)} \partial_{t} \left[ t^{3} \partial_{t} \sum_{k=0}^{\infty}
t^{k} \right] 
= \frac{1}{t(1-t)} \partial_{t} \left[ t^{3} \partial_{t} \left( \frac{1}{1-t} \right) \right] \\
&= \frac{1}{t(1-t)} \left[ \frac{2 t^{3}}{(1-t)^{3}} + \frac{3 t^{2}}{(1-t)^{2}} \right] =  \frac{2t^{2}}{(1-t)^{4}} + \frac{3 t}{(1-t)^{3}}. \\
\end{align}
Since $t = 1-(1-t)$ and $t^{2} =1-2(1-t) + (1-t)^{2}$ then the last result becomes
\begin{align}
\sum_{m=0}^{\infty} S_{m} t^{m} = \frac{2}{(1-t)^{4}} - \frac{1}{(1-t)^{3}} - \frac{1}{(1-t)^{2}}.
\end{align}
Now using the standard series
\begin{align}
\frac{1}{(1-t)^{2}} &= \sum_{m=0}^{\infty} (m+1) t^{m} \\
\frac{1}{(1-t)^{3}} &= \frac{1}{2} \sum_{m=0}^{\infty} (m+1)(m+2) t^{m} \\
\frac{1}{(1-t)^{4}} &= \frac{1}{6} \sum_{m=0}^{\infty} (m+1)(m+2)(m+3) t^{m}
\end{align}
then 
\begin{align}
\sum_{m=0}^{\infty} S_{m} t^{m} &= \sum_{m=0}^{\infty} (m+1) \left[ \frac{1}{6}
(m+2)(m+3) - \frac{1}{2} (m+2) - 1 \right] t^{m} \\
&= \sum_{m=0}^{\infty} \left[ \frac{m(m+1)(2m+7)}{6} \right] \, t^{m}
\end{align}
and upon equating the coefficients of both sides it is seen that
\begin{align}
S_{m} = \sum_{k=0}^{m} k(k+2) = \frac{m(m+1)(2m+7)}{6} = \frac{1}{6} (2m^{3}+ 9m^{2} +7m).
\end{align}
This result may be verified by combining the two series,
\begin{align}
\sum_{k=0}^{n} k &= \frac{1}{2}(n^{2} +n) \\
\sum_{k=0}^{n} k^{2} &= \frac{1}{6}(2n^{3}+3n^{2}+n),
\end{align}
in the desired way. This provides
\begin{align}
\sum_{k=0}^{n} k(k+2) = \frac{1}{6} ( 2n^{3}+9n^{2}+7n ).
\end{align}
This example shows that the generating function method yields the desired result.
