Compute the sum $\sum_{k=0}^{n}(-1)^k k^n\binom{n}{k} $
I've seen a solution along the following lines here, page 3:
Consider $(1+x)^n=\sum_{k=0}^{n}\binom{n}{k}x^k$. ($\star$) We prove by induction that $\sum_{k=0}^{n}(-1)^k k^t\binom{n}{k}=0$ for $t< n$. We prove this by differentiating ($\star$) t times, setting $x=-1$ and using the inductive step.
Now if we differentiate $(\star)$ n times we get: $n!=\sum_{k=0}^{n} k \cdot (k-1) \dots \cdot (k-(n-1)) \binom{n}{k}x^{k-n}=\sum_{k=0}^{n} k^n\binom{n}{k}x^{k-n}$ (by the inductive step).
So $n!=\sum_{k=0}^{n} k^n\binom{n}{k}x^{k-n}$ and by setting $x=-1$ and multiplying by $(-1)^n$ we get $\sum_{k=0}^{n}(-1)^k k^n\binom{n}{k}=n! (-1)^n $.
My question is, starting from $(1+x)^n=\sum_{k=0}^{n}\binom{n}{k}x^k$, if we differentiate it n times, most of the RHS terms will vanish ,leaving us with $n!=n!$, not $n!=\sum_{k=0}^{n} k \cdot (k-1) \dots \cdot (k-(n-1)) \binom{n}{k}x^{k-n}$. How is that a valid step and also how can the sum in question be evaluated?
Here is an answer based upon generating functions which might provide an alternate solution. It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series. This way we can write for instance \begin{align*} n![x^n]e^{kx}=k^n\tag{1} \end{align*}
Comment:
In (2) we apply the coefficient of operator according to (1).
In (3) we use the linearity of the coefficient of operator.
In (4) we apply the binomial theorem.
In (5) we select the coefficient of $x^n$.