TITLE: Calculate a determinant.
QUESTION [9 upvotes]: Let $a_{1},  \cdots, a_{n}$ and $b$ be real numbers. I like to know the determinant of the matrix
$$\det\begin{pmatrix}
  a_{1}+b & b & \cdots & b \\
 b & a_{2}+b & \cdots & b \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  b & b & \cdots & a_{n}+b
 \end{pmatrix}=?$$
I guess the answer is $$a_{1} \cdots a_{n}+ \sum_{i=1}^{n} a_{1} \cdots a_{i-1} b a_{i+1}\cdots a_{n} $$ after some direct calculations  for $n=2,3$. The question is how to calculate it for general $n$. Thanks!

REPLY [5 votes]: My solution is less elegant, but only involves basic properties of the determinant. Since the determinant is invariant under column operations, you have
$$\Delta := \det\begin{pmatrix}
  a_{1}+b & b & \cdots & b \\
 b & a_{2}+b & \cdots & b \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  b & b & \cdots & a_{n}+b
 \end{pmatrix}= 
\det\begin{pmatrix}
  a_{1} & 0 & 0 & \cdots & b \\
  -a_2 & a_{2} & 0 & \cdots & b \\
  0 & -a_{3} & a_3 & \cdots & b \\
  \vdots  & \vdots  &\vdots & \ddots & \vdots  \\
  0 & 0 & 0 &\cdots & a_{n}+b
 \end{pmatrix},$$
by subtracting the second column from the first, the third column from the second, ...
Using Laplace expansion of the last column you get
$$ 
\Delta 
= 
\sum_{k=1}^{n-1} \left[(-1)^{n+k}b\right] 
\left[\prod\limits_{i=1}^{k-1} a_i \right]
\left[\prod\limits_{i=k+1}^n (-1)a_i \right] 
+ (a_n+b) \left[\prod\limits_{i=1}^{n-1} a_i \right]. 
$$
Simplifying the first summand yields
$$ 
\Delta 
= 
\sum_{k=1}^{n-1} \left[(-1)^{n+k}(-1)^{n-k}b\right]  \prod\limits_{\substack{i=1\\i\neq k}}^{n} a_i  
+ (a_n+b) \prod\limits_{i=1}^{n-1} a_i, $$
Which finally gives the desired formula
$$ 
\Delta 
= 
b \sum_{k=1}^{n} \prod\limits_{\substack{i=1\\i\neq k}}^{n} a_i  
+ \prod\limits_{i=1}^{n} a_i. 
$$