<s>[INST] calculate generally the determinant of $A = a_{ij} = \begin{cases}a & i \neq j \\ 1 & i=j \end{cases}$ calculate generally the determinant of $A = a_{ij} = \begin{cases}a & i \neq j \\ 1 & i=j \end{cases} = \begin{pmatrix}
1 & a & a & · & a \\
· & · & · & · \\
a & a & a & · & 1 \\
\end{pmatrix}$
Any hints?
 [/INST] First add all collumns to the first one and so $ \displaystyle{ C_1 \to \left((n-1)a+1, (n-1)a+1 , \cdots , (n-1)a+1 \right)^T }$
now the determinant $\det A=[(n-1)a+1] \cdot$
\begin{pmatrix}
1 & a & a & \cdots & a \\
1& 1& a & \cdots &a \\
· & · & · & · \\
1 & a & a & \cdots & 1 \\
\end{pmatrix}
 subtracking now from each row the first row you get an upper triangular matrix with principal diagonal $\displaystyle{\operatorname{diag} (1, 1-a, 1-a, \cdots ,1-a)}$  so we get that 
$$ \det A= [(n-1)a +1] (1-a)^{n-1}.$$
P.S Can someone fix the latex and write the coefficinent $[(n-1)a+1]$ in front of the determinant? Thank's!
</s>