<s>[INST] Power series expansion of a holomorphic function One must show that equality$$\sum_{n=0}^\infty n^2z^n = \frac{z(z+1)}{(1-z)^3} $$ holds for $z\in\mathbb C$ and $|z|<1$.
I tried to expand $f(z):=\frac{z(z+1)}{(1-z)^3}$ into power series where $ z_0=0$  is the center and coefficients given by $a_n=\frac{1}{2\pi i}\int_{|z|<1}\frac{f(z)}{(z-0)^{n+1}}dz$, because f is holomorphic on the open domain $D=${$z:|z|<1$}.
Is there a more easy way to show this equality?
 [/INST] $\sum_{n \ge 0} n^2z^n$ is absolutely convergent for $|z| < 1$ and so the following manipulations are valid for $|z| < 1$ :
$(1-z)^3(z+4z^2+9z^3+16z^4+\ldots) 
\\ = (1-z)^2(z-z^2+4z^2-4z^3+9z^3-9z^4+16z^4+\ldots) 
\\ = (1-z)^2(z+3z^2+5z^3+7z^4+\ldots)
\\ = (1-z)(z-z^2+3z^2-3z^3+5z^3-5z^4+7z^4+\ldots)
\\ = (1-z)(z+2z^2+2z^3+2z^4+\ldots)
\\ = z-z^2+2z^2-2z^3+2z^3-2z^4+2z^4+\ldots
\\ = z+z^2
$
This proves that $z+4z^2+9z^3+16z^4+\ldots = \frac {z+z^2}{(1-z)^3}$ when $|z| <1 $ (and $1-z \neq 0$ but this check is redundant)
</s>