Generating Function for $a_n = n^2c^n$ My question is how do I represent $a_n=n^2c^n$ as a closed form of a generating function.
I know that $\frac{1}{1-cz}$ gives $a_n = c^n$
Also, that $\frac{1}{(1-z)^2}$ gives $a_n = (n+1)$
Therefore, is it easy to see that $\frac{z}{(1-z)^2}$ is $a_n = n$
If we replace $z$ by $cz$, we can get $\frac{cz}{(1-cz)^2}$ to get $a_n = nc^n$
Is my latter point correct?
If so, I know for $n^2$ the generating function is $\frac{z+z^2}{(1-z)^3}$, done by expressing $n^2$ as a linear combination of binomial coefficients (using the relation between $n^m$ and Stirling numbers). Hence, is $a_n = c^n  n^2$, would it give a generating function of $(cz + c^2z^2) / (1-cz)^3$ like before where we replaced $z$ by $cz$.
Thank you.
 A: Here is another way.
As you state correctly
$$\frac{1}{1-cz}=\sum_{n\ge 0} c^nz^n$$
Now simply operate $z\mathrm{D}\equiv z\frac{\mathrm{d}}{\mathrm{d}z}$ twice on both sides
$$(z\mathrm{D})^2\left(\frac{1}{1-cz}\right)=(z\mathrm{D})^2\left(\sum_{n\ge 0} c^nz^n\right)$$
$$\implies \frac{cz+c^2z^2}{(1-cz)^3}=\sum_{n\ge 0} n^2c^nz^n$$
Therefore we can now see how to express a general series with the $z^n$ coefficient of the form $n^kc^n$ for $k\in \mathbb{N}^+$ by repeated application of $\smash{z\mathrm{D}}$ to $\smash{(1-cz)^{-1}}$. It is possible to show that the polynomial in $cz$ in the numerator of the left hand side is $cz$ multiplied by the generating function for $\smash{k^{\text{th}}}$ row of the Eulerian numbers.
In general for Eulerian numbers $A(k,j)$
$$(z\mathrm{D})^k\left(\frac{1}{1-cz}\right)=\frac{cz{\textstyle\sum_{j=0}^{k-1}A(k,j)(cz)^j}}{(1-cz)^{k+1}}=\sum_{n\ge 0}n^kc^nz^n$$
From here, taking into consideration your method, we can begin to see the relationship between Eulerian numbers and Stirling numbers of the second kind.
