Closed-form expression for $\sum_{k=0}^n\binom{n}kk^p$ for integers $n,\,p$

If you consider $p$ as fixed, then the below can be considered as closed form I suppose:

$$\sum_{k=0}^{n} \binom{n}{k} k^p = \sum_{k=1}^{p} s(p,k) n(n-1)\dots(n-k+1) 2^{n-k} \quad \quad (1)$$

where $s(k,p)$ is a stirling number of the second kind.

If 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)$$

To prove $(1)$ above, we apply $D_x$, $p$ times to $(1+x)^n$, and set $x=1$.


Let $$ f(x)=(e^x+1)^n=\sum_{k=0}^n \binom{n}{k}e^{kx}. $$

Then $$ \left(\frac{d}{dx}\right)^p f(x)=\sum_{k=0}^n\binom{n}{k}k^pe^{kx}.$$

Plug in $x=0$.


We know that $(1+x)^n=\sum_{k=0}^n \binom{n}{k}x^k$.Differentiate this, to get $n(1+x)^{n-1}=\sum_{k=0}^n \binom{n}{k} k x^{k-1}$. Multiply by $x$ to get $nx(1+x)^{n-1}=\sum_{k=0}^n \binom{n}{k} k x^k$. Take $x=1$ to get the first sum, And repeat this process for sums involving higher powers of $k$.