I was messing around with the geometric series, and upon differentiating and multiplying by x I got a generating function for the natural numbers (within a radius of convergence ofc).
$$\sum^{\infty}_{n=0}nx^n=\frac{x}{(1-x)^2}$$ By differentiating and multiplying by x each time repeatedly I found that this process could be extended to arbitrary powers of n, provided I could differentiate the associated function corresponding to that infinite power series. Is there a formula that yields the result after p such differentiations?
$$\sum^{\infty}_{n=0}n^px^n=???$$ I tried directly applying the quotient rule and using partial fraction decomp. but couldn't spot an immediate pattern for the quotients in either function (I might have missed something though, as I only attempted this for a couple of powers).
If you express the power $n^p$ in terms of falling factorials,
$$ n^p=\sum_{k=0}^p\left\{p\atop k\right\}n^{\underline k}\;, $$
where $\left\{p\atop k\right\}$ is a Stirling number of the second kind and $n^{\underline k}$ is a falling factorial, and use the generating function of the falling factorials,
\begin{eqnarray} \sum_nn^{\underline k}x^n &=& x^{k}\sum_nn^{\underline k}x^{n-k} \\ &=&x^k\frac{\partial^k}{\partial x^k}\sum_nx^k \\ &=& x^k\frac{\partial^k}{\partial x^k}\frac1{1-x} \\ &=& k!\frac{x^k}{(1-x)^{k+1}}\;, \end{eqnarray}
you obtain
\begin{eqnarray} \sum_nn^px^n &=& \sum_n\sum_{k=0}^p\left\{p\atop k\right\}n^{\underline k}x^n \\ &=& \sum_{k=0}^p\left\{p\atop k\right\}\sum_nn^{\underline k}x^n \\ &=& \sum_{k=0}^p\left\{p\atop k\right\}k!\frac{x^k}{(1-x)^{k+1}}\;. \end{eqnarray}
For instance, for $p=2$, this is
$$ \sum_nn^2x^n = \sum_{k=0}^2\left\{2\atop k\right\}k!\frac{x^k}{(1-x)^{k+1}}\;, $$
and with $\left\{2\atop 0\right\}=0$ and $\left\{2\atop 1\right\}=\left\{2\atop 2\right\}=1$, the generating function for the squares is
$$ \frac x{(1-x)^2}+2\frac{x^2}{(1-x)^3}\;. $$