How do you find the determinant of this $(n-1)\times (n-1)$ matrix?

It's for a proof of Cayley's Formula, I know I'm being dumb and can't see it, how do I find the determinant of this $(n-1)\times (n-1)$ matrix where the diagonal entries are $n-1$ and the off diagonal all $-1$?

\begin{pmatrix} n-1 & -1 & \cdots & -1 \\ -1 & n-1 & \cdots & \vdots \\ \vdots & \vdots & \ddots & \vdots \\ -1 & \cdots & \cdots & n-1 \end{pmatrix}

• – achille hui Apr 16 '15 at 17:24

Replace the first column by the sum of all the columns: the wanted determinant is equal to $$\Delta_n:=\det\begin{pmatrix} 1 & -1 & \cdots & -1 \\ 1 & n-1 & \cdots & \vdots \\ \vdots & \vdots & \ddots & \vdots \\ 1 & \cdots & \cdots & n-1 \end{pmatrix}.$$ Now, for each $j\in\{2,\dots,n\}$, take the column $C_j$ and replace it by $C_j+C_1$ to obtain $$\Delta_n=\det\begin{pmatrix} 1 & 0 & \cdots & 0 \\ 1 & n & \cdots & 0\\ \vdots & \vdots & \ddots & \vdots \\ 1 & 0 & \cdots & n \end{pmatrix}.$$ The determinant of a triangular matrix is easier to compute.
Multiply the matrix by $(-1)^{n-1}$ and change $n$ into $X$: this is the characteristic matrix of the matrix $U$ with all coefficients equal to $1$, so its determinant is the characteristic polynomial of $U$.
Since the matrix $U$ has rank $1$ and $n-1$ as the only nonzero eigenvalue, the characteristic polynomial is $(n-1-X)(0-X)^{n-2}$. If we evaluate it at $X=n$, we get $(-1)(-n)^{n-2}$. Dividing by the initial $(-1)^{n-1}$ factor (which is the same as multiplying by it) we get $$(-1)^{n-1}(-1)(-1)^{n-2}n^{n-2}=n^{n-2}$$