Q:

Computing determinant of a specific matrix.

How to calculate the determinant of
$$ A=(a_{i,j})_{n \times n}=\left(
\begin{array}{ccccc}
a&b&b& \cdots & b\\
b& a& b& \cdots& b\\
\vdots& \vdots& \vdots& \ddots&\cdots\\
b&b&b & \cdots&a
\end{array}
\right)? $$

A:

HINT 1:
Your matrix $A$ is $$(a-b)I + b e e^T$$
Can you now compute the determinant?
Move your mouse over the gray area below for another hint.

 HINT 2: Make use of the fact that $\det(\lambda A) = \lambda^n \det(A)$ 

Move your mouse over the gray area below for another hint.

 HINT 3: $\det(I + \alpha e e^T) = (1+n \alpha)$ where $e$ is a column vector of ones.

Move your mouse over the gray area for the complete answer.

 $$\det ((a-b)I + b e e^T) = (a-b)^n \det \left( I + \dfrac{b}{a-b} e e^T\right)$$ Hence, all we need is to find the determinant of $I + \alpha ee^T$, where $\alpha = \dfrac{b}{a-b}$ in our case. Note that $ee^T$ is a rank one matrix and its eigen values are $e^Te = n$ and $n-1$ zeros. If $\lambda$ is an eigen value of $I + \alpha ee^T$, then $$\det (I + \alpha ee^T - \lambda I) = \alpha^n \det \left(ee^T + \dfrac{(1-\lambda)}{\alpha}I \right) = 0$$ This means that $-\dfrac{(1-\lambda)}{\alpha}$ are the eigenvalues of $ee^T$. Hence, we get that $$-\dfrac{(1-\lambda)}{\alpha} = n \text{ or }0 \text{ ($n-1$ times)}.$$ Hence, we get that $$\lambda = 1 + n \alpha, 1 \text{ ($n-1$ times)}$$ Hence, $$\det ((a-b)I + b e e^T) = (a-b)^n \times \left( 1 + n \dfrac{b}{a-b} \right) = (a-b)^{n-1} (a+(n-1)b)$$

A:

We note that the sum of the elements of each column is $a+(n-1)b$ for each column, hence 
$$\det A=(a+(n-1)b)\det\pmatrix{1&1&\dots& 1&1\\
b&a&\dots&b&b\\
\vdots&\ddots&\ddots&\vdots&\vdots\\
b&b&\dots&b&a}.$$
To each row of index $\geq 2$, we do $R_j\leftarrow bR_1$ to get 
$$\det A=(a+(n-1)b)\det\pmatrix{1&1&\dots& 1&1\\
0&a-b&\dots&0&0\\
\vdots&\ddots&\ddots&\vdots&\vdots\\
0&0&\dots&0&a-b}.$$
Finally, we obtain
$$\det A=(a+(n-1)b)(a-b)^{n-1}.$$

