Generalizing $\sum \limits_{n=1}^{\infty }n^{2}/x^{n}$ to $\sum \limits_{n=1}^{\infty }n^{p}/x^{n}$

The general closed form is

$$\displaystyle \sum_{k=1}^{\infty} k^n x^k = \frac{1}{(1 - x)^{n+1}} \left( \sum_{m=0}^{n} A(n, m) x^{m+1} \right)$$

where $A(n, m)$ are the Eulerian numbers. When I have time I will edit with a few more details. If you only want the answer for a particular small value of $n$ then see Section 3 of my notes on generating functions. I will also mention that for a particular value of $n$ one can deduce the answer by using the identity

$$\displaystyle \sum_{k=0}^{\infty} {k+n \choose n} x^k = \frac{1}{(1 - x)^{n+1}}$$

and writing $k^n$ as a linear combination of the polynomials ${k+r \choose r}$ (in $k$), for example using a finite difference table.


Here is a different look:

The differentiating and multiplying by $x$ gives rise to Stirling Numbers of the Second Kind.

Say you denote the operator of differentiating and multiplying by $x$ as $D_{x}$

Then we have that

$$(D_{x})^{n}f(x) = \sum_{k=1}^{n} s(n,k) f^{(k)}(x) x^{k}$$

where $s(n,k)$ is the stirling number of the second kind and $f^{(k)}(x)$ is the $k^{th}$ derivative of $f(x)$.

This can easily be proven using the identity $$s(n,k) = s(n-1,k-1) + k \cdot s(n-1,k)$$

Here is a table for the Stirling numbers of the second kind (from the wiki page):

n/k   0     1     2     3     4      5      6      7      8      9
0     1
1     0     1
2     0     1     1
3     0     1     3     1
4     0     1     7     6     1
5     0     1     15    25    10     1
6     0     1     31    90    65     15     1
7     0     1     63    301   350    140    21     1
8     0     1     127   966   1701   1050   266    28     1
9     0     1     255   3025  7770   6951   2646   462    36     1

So in your case, we can start with $ f(x) = \frac{1}{1-x}$ and obtain that

$$ \sum_{k=0}^{\infty} k^{n} x^k = \sum_{r=1}^{n} r! \cdot s(n,r) \frac{x^{r}}{(1-x)^{r+1}}$$

For example, in your case for $n=3$ we get

$$\sum_{k=0}^{\infty} k^3 x^k = \frac{1! \cdot 1 \cdot x}{(1-x)^2} + \frac{2! \cdot 3 \cdot x^2}{(1-x)^3} + \frac{3! \cdot 1 \cdot x^3}{(1-x)^4}$$

$$ = \frac{x(1-x)^2 + 6x^{2}(1-x) + 6x^3}{(1-x)^4} $$

$$ = \frac{x^3 + 4x^2 + x}{(1-x)^4} $$