Find a determinant of a large matrix Evaluate $$\det \begin{vmatrix}
1 & 1& \dots &\ldots&1&a \\
1 & 1& \dots &\ldots&a&1 \\
\vdots & \vdots& \ddots &&\vdots&\vdots \\
\vdots & \vdots&&\ddots&\vdots&\vdots \\
1 & a& \dots &\ldots&1&1\\
a & 1& \dots &\ldots&1&1 \\
\end{vmatrix}$$
I tried cofactor expansion and it leads to
$$\det \begin{vmatrix}
 1& \dots &\ldots&a&1 \\
 \vdots& \ddots &&\vdots&\vdots \\
 \vdots&&\ddots&\vdots&\vdots \\
 a& \dots &\ldots&1&1\\
 1& \dots &\ldots&1&1 \\
\end{vmatrix} -
\det \begin{vmatrix}
1 &  \dots &\ldots&a&1 \\
\vdots &  \ddots &&\vdots&\vdots \\
\vdots & &\ddots&\vdots&\vdots \\
1 &  \dots &\ldots&1&1\\
a &  \dots &\ldots&1&1 \\
\end{vmatrix} + \ldots +(-1)^{n+1}
\det \begin{vmatrix}
1 & 1& \dots &\ldots&a \\
\vdots & \vdots& \ddots &&\vdots \\
\vdots & \vdots&&\ddots&\vdots \\
1 & a& \dots &\ldots&1\\
a & 1& \dots &\ldots&1 \\
\end{vmatrix}$$
I think, except for last term, all the terms will be cancel each other somehow although it may depend on parity of $n$. If it does depend on parity, the possibility of cancelation is going to be opposite for the cofactor expansion of the last term, and so it does for the last term of the next expansion...
I could not find out how to deal with this  branch.
 A: Add all the columns to the last one : you get
$$\det \begin{vmatrix}
1 & 1& \dots &\ldots&1&a \\
1 & 1& \dots &\ldots&a&1 \\
\vdots & \vdots& \ddots &&\vdots&\vdots \\
\vdots & \vdots&&\ddots&\vdots&\vdots \\
1 & a& \dots &\ldots&1&1\\
a & 1& \dots &\ldots&1&1 \\
\end{vmatrix} = \det \begin{vmatrix}
1 & 1& \dots &\ldots&1&a+n-1 \\
1 & 1& \dots &\ldots&a&a+n-1 \\
\vdots & \vdots& \ddots &&\vdots&\vdots \\
\vdots & \vdots&&\ddots&\vdots&\vdots \\
1 & a& \dots &\ldots&1&a+n-1\\
a & 1& \dots &\ldots&1&a+n-1 \\
\end{vmatrix}$$
Now substract the first line from all the other lines :
$$\det \begin{vmatrix}
1 & 1& \dots &\ldots&1&a+n-1 \\
1 & 1& \dots &\ldots&a&a+n-1 \\
\vdots & \vdots& \ddots &&\vdots&\vdots \\
\vdots & \vdots&&\ddots&\vdots&\vdots \\
1 & a& \dots &\ldots&1&a+n-1\\
a & 1& \dots &\ldots&1&a+n-1 \\
\end{vmatrix} = \det \begin{vmatrix}
1 & 1& \dots &\ldots&1&a+n-1 \\
0 & 0& \dots &\ldots&a-1&0 \\
\vdots & \vdots& \ddots &&\vdots&\vdots \\
\vdots & \vdots&&\ddots&\vdots&\vdots \\
0 & a-1& \dots &\ldots&0&0\\
a-1 & 0& \dots &\ldots&0&0 \\
\end{vmatrix}$$
Finally develop w.r.t. the last column. You get that
$$\det \begin{vmatrix}
1 & 1& \dots &\ldots&1&a \\
1 & 1& \dots &\ldots&a&1 \\
\vdots & \vdots& \ddots &&\vdots&\vdots \\
\vdots & \vdots&&\ddots&\vdots&\vdots \\
1 & a& \dots &\ldots&1&1\\
a & 1& \dots &\ldots&1&1 \\
\end{vmatrix} =(-1)^{\frac{n(n-1)}{2}}(a+n-1)(a-1)^{n-1}$$
A: First, you can rearrange the columns until the $a$s are on the main diagonal, possibly changing the sign of the determinant. Next, you can compute the eigenvalues of that matrix and multiply them to produce the determinant.
Hint: If you add a multiple of the identity matrix to any matrix, how does this affect the eigenvalues?
A: Hint: (1) Add all rows to the first one. (2) Extract the common factor from the first row. (3) Subtract the first row from the others. (4) The rest should be easy.
