How to compute $\sum^n_{k=0}(-1)^k\binom{n}{k}k^n$ When trying to answer this question I arrived at
$$\int^\infty_0\frac{\sin(nx)\sin^n{x}}{x^{n+1}}dx=\frac{\pi}{2}\frac{(-1)^n}{n!}\sum^n_{k=0}(-1)^k\binom{n}{k}k^n$$
After using Wolfram Alpha to evaluate the sum for several values of $n$, it seems that
$$\sum^n_{k=0}(-1)^k\binom{n}{k}k^n\stackrel?=(-1)^nn!$$
The best I can do is to express the sum as
$$\left(x\frac{d}{dx}\right)^n(1-x)^n\Bigg{|}_{x=1}$$
but that is as far as I can go. May I know how one can compute the sum? Thanks.

Suppose that I want to count the permutations of the set $[n]=\{1,\ldots,n\}$. For each $k\in[n]$ let $A_k$ be the set of functions from $[n]$ to $[n]\setminus\{k\}$. A function from $[n]$ to $[n]$ is a permutation iff it is not in $A_1\cup\ldots\cup A_n$, so there are $n^n-|A_1\cup\ldots\cup A_n|$ permutations. By a standard inclusion-exclusion argument
$$\begin{align*}
|A_1\cup\ldots\cup A_n|&=\sum_{1\le k\le n}|A_k|\\
&\quad-\sum_{1\le k<\ell\le n}|A_k\cap A_\ell|\\
&\quad+\sum_{1\le j<k<\ell\le n}|A_j\cap A_k\cap A_\ell|\\
&\quad\;\vdots\\
&\quad+(-1)^{n+1}|A_1\cap\ldots\cap A_n|\;.
\end{align*}\tag{1}$$
Let $K\subseteq[n]$, and let $k=|K|$. Then 
$$\left|\bigcap_{i\in K}A_i\right|=(n-k)^n\;,$$
because $\bigcap_{i\in K}A_i$ is the set of functions from $[n]$ to $[n]$ whose ranges are disjoint from $K$. There are $\binom{n}k$ such sets $K$, so $(1)$ can be rewritten
$$\begin{align*}
|A_1\cup\ldots\cup A_n|&=\binom{n}1(n-1)^n\\
&\quad-\binom{n}2(n-2)^n\\
&\quad+\binom{n}3(n-3)^n\\
&\quad\;\vdots\\
&\quad+(-1)^{n+1}\binom{n}n(n-n)^n\\
&=\sum_{k=1}^n(-1)^{k+1}\binom{n}k(n-k)^n\;.
\end{align*}$$
Of course we know that the number of permutations of $[n]$ is $n!$, so
$$\begin{align*}
n!&=n^n-\sum_{k=1}^n(-1)^{k+1}\binom{n}k(n-k)^n\\
&=n^n+\sum_{k=1}^n(-1)^k\binom{n}k(n-k)^n\\
&=\sum_{k=0}^n(-1)^k\binom{n}k(n-k)^n\\
&=\sum_{k=0}^n(-1)^k\binom{n}{n-k}(n-k)^n\\
&=\sum_{k=0}^n(-1)^{n-k}\binom{n}kk^n\\
&=(-1)^n\sum_{k=0}^n(-1)^k\binom{n}kk^n\;,
\end{align*}$$
and multiplication by $(-1)^n$ yields the desired result.
