Determinant of a specially structured matrix ($a$'s on the diagonal, all other entries equal to $b$) [duplicate]
Solution 1:
Add row 2 to row 1, add row 3 to row 1,..., add row $n$ to row 1, we get $$\det(A)=\begin{vmatrix} a+(n-1)b & a+(n-1)b & a+(n-1)b & \cdots & a+(n-1)b \\ b & a & b &\cdots & b \\ b & b & a &\cdots & b \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ b & b & b & \ldots & a \\ \end{vmatrix}$$ $$=(a+(n-1)b)\begin{vmatrix} 1 & 1 & 1 & \cdots & 1 \\ b & a & b &\cdots & b \\ b & b & a &\cdots & b \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ b & b & b & \ldots & a \\ \end{vmatrix}.$$ Now add $(-b)$ of row 1 to row 2, add $(-b)$ of row 1 to row 3,..., add $(-b)$ of row 1 to row $n$, we get $$\det(A)=(a+(n-1)b)\begin{vmatrix} 1 & 1 & 1 & \cdots & 1 \\ 0 & a-b & 0 &\cdots & 0 \\ 0 & 0 & a-b &\cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \ldots & a-b \\ \end{vmatrix}=(a+(n-1)b)(a-b)^{n-1}.$$
Solution 2:
SFAICT this route hasn't been mentioned yet, so:
Consider the decomposition
$$\small\begin{pmatrix}a&b&\cdots&b\\b&a&\cdots&b\\\vdots&&\ddots&\vdots\\b&\cdots&b&a\end{pmatrix}=\begin{pmatrix}a-b&&&\\&a-b&&\\&&\ddots&\\&&&a-b\end{pmatrix}+\begin{pmatrix}\sqrt b\\\sqrt b\\\vdots\\\sqrt b\end{pmatrix}\cdot\begin{pmatrix}\sqrt b&\sqrt b&\cdots&\sqrt b\end{pmatrix}$$
Having this decomposition allows us to use the Sherman-Morrison-Woodbury formula for determinants:
$$\det(\mathbf A+\mathbf u\mathbf v^\top)=(1+\mathbf v^\top\mathbf A^{-1}\mathbf u)\det\mathbf A$$
where $\mathbf u$ and $\mathbf v$ are column vectors. The corresponding components are simple, and thus the formula is easily applied (letting $\mathbf e$ denote the column vector whose components are all $1$'s):
$$\begin{align*} \begin{vmatrix}a&b&\cdots&b\\b&a&\cdots&b\\\vdots&&\ddots&\vdots\\b&\cdots&b&a\end{vmatrix}&=\left(1+(\sqrt{b}\mathbf e)^\top\left(\frac{\sqrt{b}}{a-b}\mathbf e\right)\right)(a-b)^n\\ &=\left(1+\frac{nb}{a-b}\right)(a-b)^n=(a+(n-1)b)(a-b)^{n-1} \end{align*}$$
where we used the fact that $\mathbf e^\top\mathbf e=n$.
Solution 3:
Define $\mathbf{1} = \begin{bmatrix} 1 \\ \vdots \\ 1 \end{bmatrix}$. Take $P = b\mathbf{1} \mathbf{1}^T$ (outer product!) and observe that \[ A=P + (a-b) I .\]
We begin with observations on the matrix $P = b\mathbf{1} \mathbf{1}^T$:
- All rows and columns are equal and $b>0$, so P is a rank $1$ matrix. Thus $\lambda_1=0$ is an eigenvalue of multiplicity $n-1$.
- $P \mathbf{1} = b\mathbf{1} \mathbf{1}^T\mathbf{1} = n b \mathbf{1}$. Thus $\lambda_2 = nb$ is an eigenvalue of multiplicity $1$.
We now use the following theorem:
Theorem: If $r$ is an eigenvalue of $T$, then $r+s$ is an eigenvalue of $T+sI$.
Proof: Since $r$ is an eigenvalue of $T$, there exists $\mathbf{v}$ such that $ T \mathbf{v} = r \mathbf{v}$. Then \[ (T + sI)\mathbf{v} = T \mathbf{v} + sI \mathbf{v} = r \mathbf{v} + s \mathbf{v} = (r + s) \mathbf{v}. \quad \text{qed}\]
Thus the eigenvalues of $P+(a-b)I$ will be $\lambda_1 = (0+(a-b))$ with multiplicity $n-1$ and $\lambda_2 = nb + (a-b)$ with multiplicity one. Since the determinant is the product of the eigenvalues, we have that $$ \det(A) =\begin{vmatrix} a & b & \ldots & b\\ b & a & \ldots & b\\ \vdots & \vdots & \ddots & \vdots\\ b & b & \ldots & a\end{vmatrix} = \det(P+(a-b)I) = (a-b)^{n-1} (nb+a-b) . $$