TITLE: Prove that $\sum _{k=1}^{n-1} \binom{n-1}{k} k^{k-1} (n-k)^{n-k-1}=n^{n-1}-n^{n-2}$
QUESTION [6 upvotes]: How to prove the combinatoric identity
$$\sum _{k=1}^{n-1} \binom{n-1}{k} k^{k-1} (n-k)^{n-k-1}=n^{n-1}-n^{n-2}$$
My bet is on binomial theorem but I don't know how. I've also considered to transform it into an integral but the $k^k$ term is annoying. Any help will be appreciated.

REPLY [5 votes]: An algebraic  proof somewhat  similar in spirit to the nice answer of @MarkoRiedel.  Considering the binomial  identity $\binom{n}{k}=\binom{n-1}{k}\frac{n}{n-k}$ we multiply OPs  identity  with  $n$ and show  the  following  is valid:
\begin{align*}
\sum_{k=1}^{n-1}\binom{n}{k}k^{k-1}(n-k)^{n-k}=n^n-n^{n-1}\qquad\qquad n\geq  2\tag{1}
\end{align*}

We use an exponential generating  function  approach to show (1).  The  right  hand    side  of (1) indicates as starting point:
  \begin{align*}
A(z)=\sum_{n=1}^\infty n^{n-1}\frac{z^n}{n!}\qquad\qquad
A^{\prime}(z)=\sum_{n=1}^\infty   n^n\frac{z^{n-1}}{n!}\tag{2}
\end{align*}
A generating function of the right-hand side of (1) is according to (2)
  \begin{align*}
zA^{\prime}(z)-A(z)&=\sum_{n=1}^\infty  n^n\frac{z^n}{n!}-\sum_{n=1}^\infty n^{n-1}\frac{z^n}{n!}\\
&=\sum_{n=1}^\infty   \left(\color{blue}{n^n-n^{n-1}}\right)\frac{z^n}{n!}\tag{3}
\end{align*}
The left-hand side of (1) is the coefficient of a convolution of two exponential generating functions. We obtain 
  \begin{align*}
A(z)\cdot zA^{\prime}(z)&=\left(\sum_{k=1}^\infty k^{k-1}\frac{z^k}{k!}\right)\left(\sum_{l=1}^\infty l^l\frac{z^l}{l!}\right)\\
&=\sum_{n=2}^\infty \left(\sum_{{k+l=n}\atop{k,l\geq 1}}\frac{k^{k-1}}{k!}\,\frac{l^l}{l!}\right)z^n\\
&=\sum_{n=2}^\infty \left(\sum_{k=1}^{n-1}\frac{k^{k-1}}{k!}\,\frac{(n-k)^{n-k}}{(n-k)!}\right)z^n\\
&=\sum_{n=2}^\infty \left(\color{blue}{\sum_{k=1}^{n-1}\binom{n}{k}k^{k-1}\,(n-k)^{n-k}}\right)\frac{z^n}{n!}\tag{4}\\
\end{align*}

We want to show the equality of (3) and (4) i.e. the validity of the functional equation
\begin{align*}
zA^{\prime}(z)-A(z)=A(z)\cdot zA^{\prime}(z)\tag{5}
\end{align*}
We recall the series representation of the Lambert W-function $W(-z)=-\sum_{n=1}^\infty n^{n-1}\frac{z^n}{n!}$. The functional equation $z=W(z)e^{W(z)}$ indicates the approach
\begin{align*}
A(z)=ze^{A(z)}\tag{6}
\end{align*}

We obtain
  \begin{align*}
\color{blue}{zA^{\prime}(z)-A(z)}&=z\left(ze^{A(z)}\right)^{\prime}(z)-A(z)\tag{*}\\
&=z\left(e^{A(z)}+zA^{\prime}(z)e^{A(z)}\right)-A(z)\\
&=ze^{A(z)}+z^2A^{\prime}(z)e^{A(z)}-A(z)\\
&=A(z)+zA^{\prime}(z)A(z)-A(z)\tag{*}\\
&\,\,\color{blue}{=zA^{\prime}(z)A(z)}
\end{align*}
showing (5) and so the validity of (1). Here we use in (*) the relationship (6).