TITLE: Proof of Generalized Cayley's formula
QUESTION [7 upvotes]: I'd like to prove the equation following: 
$$x_1x_2x_3...x_n(x_1 + x_2 + ... x_n)^{n-2} = \sum_Tx_1^{d_{T(1)}}x_2^{d_{T(2)}}...x_n^{d_{T(n)}}\tag 1$$
where the sum is over all spanning trees $T$ in $K_n$ and $d_{T(i)}$ is the degree of $i$ in $T$

I heard this's called Cayley's generalized formula, which is the number of $trees$ in $n$ vertices:
$n^{n-2} \tag 2$
Only the morphological similarity between $(1)$ and $(2)$ is the power $n-2$.
I think in this case induction might work well, but honestly $induction$ itself is not a productive way of proving something to reveal one's mathematical identity to me including this case, proof of $(1)$.
Any hint to prove this equation in combinatoric and algebraic way?

REPLY [3 votes]: Let's divide both sides of $(1)$ by $x_1\dots x_n$, then we have to prove
$$
(x_1 + x_2 + \dots + x_n)^{n-2} = \sum_{T}x_1^{d_{T(1)}-1}x_2^{d_{T(2)}-1}\dots x_n^{d_{T(n)}-1}.
$$
But now the argument is basically the same as Prüfer's proof. Note that each vertex $T(i)$ occurs $d_{T(i)}-1$ times (the number of steps in Prüfer's algorithm it takes for $T(i)$ to become a leaf) in the corresponding Prüfer's sequence, which has total length $n-2$. On the other hand, each term in the Prüfer's sequence can take any value from $1$ to $n$, so it corresponds to a factor of $x_1+\dots+x_n$. We have $n-2$ such factors, which yields the left-hand side. To derive $(2)$ from $(1)$, simply let $x_1=\dots=x_n=1$.