<s>[INST] Finding the determinant of a matrix with $0$s on the diagonal, $1$s in the first row and column, and $x$ elsewhere. How do you attempt to solve the deterimnant of
$$D_n=\begin{vmatrix}
0 & 1 & 1 & 1 & \cdots & 1 \\
1 & 0 & x & x & \cdots & x \\
1 & x & 0 & x & \cdots & x \\
1 & x & x & 0 & \ddots & \vdots \\
\vdots & \vdots & \vdots & x & \ddots & x \\
1 & x & x & \cdots & x & 0
\end{vmatrix}$$
My approach is to try and create a similar matrix with finite dimensions (something like a $4\times 4$) and then try and simplify it, but I always get stuck in the process of simplifying...
In general, how do you approach these types of questions?
 [/INST] We have $$x^2D_n = \begin{vmatrix}
0 & x & x & \cdots & x \\
x & 0 & x & \cdots & x \\
x & x & 0 & \cdots & x \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
x & x & x & \cdots & 0
\end{vmatrix}  = x^n\begin{vmatrix}
0 & 1 & 1 & \cdots & 1 \\
1 & 0 & 1 & \cdots & 1 \\
1 & 1 & 0 & \cdots & 1 \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
1 & 1 & 1 & \cdots & 0
\end{vmatrix} = x^n\det(J-I)$$
where $J$ is the matrix with all entries equal to $1$. We know that $J$ has eigenvalues $0,0, \ldots, 0, n$ with multiplicity. Indeed, the respective basis of eigenvectors are $$e_2-e_1, e_3-e_2,\ldots, e_n-e_{n-1}, e_1+e_2+\cdots+e_n.$$The matrix $J-I$ therefore has eigenvalues $-1,-1, \ldots, -1, n-1$ with multiplicity. Determinant is the product of eigenvalues so $$\det(J-I)=(-1)^{n-1}(n-1)$$
We conclude $D_n = (-1)^{n-1}(n-1)x^{n-2}$.
</s>