Find the determinant [tex]D_n=\begin{vmatrix} x_1 & a & a & \ldots & a \\ a & x_2 & a & \ldots & a \\ a & a & x_3 & \ldots & a \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ a & a & a & \ldots & x_n \end{vmatrix}[/tex] of order [tex]n[/tex], whose main diagonal consists of the numbers [tex]x_1,x_2,\ldots,x_n[/tex] and whose other entries are all equal to [tex]a[/tex].
Solution:
Let [tex]n\ge 2[/tex]. Write the first column as a sum of two columns:
[tex](x_1, a, \ldots, a)^{T}=(x_1-a, 0, \ldots, 0)^{T}+(a, a, \ldots, a)^{T}[/tex]
A determinant is linear in each column, so [tex]D_n=D'+D''[/tex], where [tex]D'[/tex] and [tex]D''[/tex] have first columns [tex](x_1-a, 0, \ldots, 0)^{T}[/tex] and [tex](a, a, \ldots, a)^{T}[/tex], respectively, and the other columns as in [tex]D_n[/tex]. Expanding [tex]D'[/tex] along its first column, we get [tex]D'=(x_1-a)D_{n-1}[/tex], where [tex]D_{n-1}[/tex] is the determinant of the same form built from [tex]x_2,\ldots,x_n[/tex].
In [tex]D''[/tex] subtract the first column (all its entries are [tex]a[/tex]) from each of the other columns. Then column [tex]j[/tex] ([tex]j\ge 2[/tex]) has [tex]x_j-a[/tex] in row [tex]j[/tex] and zeros elsewhere, i.e. [tex]D''[/tex] becomes lower triangular with diagonal [tex]a, x_2-a, \ldots, x_n-a[/tex]. Hence
[tex]D_n=(x_1-a)D_{n-1}+a\prod_{j=2}^{n}(x_j-a)[/tex]
Now we prove by induction on [tex]n[/tex] that
[tex]D_n=\prod_{i=1}^{n}(x_i-a)+a\sum_{i=1}^{n}\prod_{j\ne i}(x_j-a)[/tex]
Base case: [tex]D_1=x_1=(x_1-a)+a[/tex] (an empty product equals [tex]1[/tex]).
Inductive step: if the formula holds for [tex]x_2,\ldots,x_n[/tex], then multiplying [tex]D_{n-1}[/tex] by [tex]x_1-a[/tex] gives [tex]\prod_{i=1}^{n}(x_i-a)[/tex] and all the terms [tex]a\prod_{j\ne i}(x_j-a)[/tex] with [tex]i\ge 2[/tex], while the added term [tex]a\prod_{j\ne 1}(x_j-a)[/tex] is exactly the term with [tex]i=1[/tex]. Hence the formula holds for every [tex]n[/tex]. When all [tex]x_i\ne a[/tex], it can also be written as
[tex]D_n=\prod_{i=1}^{n}(x_i-a)\left(1+\sum_{i=1}^{n}\frac{a}{x_i-a}\right)[/tex]