<s>[INST] Finding closed forms for $\sum n z^{n}$ and $\sum n^{2} z^{n}$ 
Using the identity $\frac{1}{1-z} = 1 + z + z^2 + \ldots$ for $|z| < 1$, find closed forms for the sums $\sum n z^n$ and $\sum n^2 z^n$.

My solution: Because $\displaystyle1 + z + z^{2} + \ldots = \frac{1}{1-z}$, $\displaystyle1 + 2z + 3z^2 + \ldots = \sum_{n=1}^\infty n z^{n-1} = \frac{1}{(1-z)^2}$ and $\displaystyle\sum_{n=1}^\infty n z^n = \frac{z}{(1-z)^2}.$ Similarly, $\displaystyle\sum_{n=1}^\infty n^2 z^{n-1}=\frac{1+z}{(1-z)^3}$ and $\displaystyle\sum_{n=1}^\infty n^2 z^n=\frac{z(1+z)}{(1-z)^3}$.
Could you please improve this exercise?
 [/INST] I'd do the second one like this
$$
\begin{align}
\sum_{n=1}^\infty n^2 z^{n-1} & = z\sum_{n=2}^\infty n(n-1) z^{n-2} + \sum_{n=1}^\infty nz^{n-1} \\[10pt]
& = z\frac{d^2}{dz^2} \frac{1}{1-z} + \frac{d}{dz} \frac{1}{1-z}= \cdots\cdots
\end{align}
$$
(and then multiply by $z$).
</s>