Find the value of the following $n \times n$ determinantes Find the value of the following $n \times n$ determinantes


*

*$$\begin{vmatrix}
a_1+x & x & x & \ldots & x \\ 
x & a_2+x & x & \ldots & x \\ 
x & x & a_3+x & \ldots & x \\ 
\vdots & \vdots& &\ddots& \vdots\\
x & x & x & \ldots & a_n+x \\ 
\end{vmatrix}$$

*$$\begin{vmatrix}
a_1+x & a_2 & a_3 & \ldots & a_n \\ 
a_1 & a_2+x & a_3 & \ldots & a_n \\ 
a_1 & a_2 & a_3+x & \ldots & a_n \\ 
\vdots & \vdots& &\ddots& \vdots\\
a_1 & a_2 & a_3 & \ldots & a_n+x \\ 
\end{vmatrix}$$


Both seem to be equally complicated to solve, I reckon that it's needed to subtract the $x$ from the diagonal in each term. I tried by subtracting the $(k-1)$-th row from the $k$-th row, however that doesn't really lead me to anything more comfortable whatsoever. So help is greatly appreciated, also perhaps a link to some methods on solving these kind of problems, would also be helpful. 
 A: For 2) Let $$A=\begin{bmatrix} a_1 & a_2 & .. &a_n \\
a_1 & a_2 & .. &a_n \\
a_1 & a_2 & .. &a_n \\
...&...&...&...\\
a_1 & a_2 & .. &a_n \\
\end{bmatrix}$$
Then $A$ has rank $1$ and hence $\lambda=0$ is an eigenvalue with geometric multiplicity $n-1$, and hence has algebraic multiplicity at least $n-1$.
As the trace is the sum of eigenvalues, the last eigenvalue is $a_1+a_2+..+a_n$.
Thus
$$
\det(\lambda I-A) =\lambda^n -(a_1+...+a_n) \lambda^{n-1}
$$
Now replace $\lambda$ by $-x$.
For 1) Subtract the last row from each of the previous $n-1$. You get
$$\begin{vmatrix}
a_1+x & x & x & \ldots & x \\ 
x & a_2+x & x & \ldots & x \\ 
x & x & a_3+x & \ldots & x \\ 
\vdots & \vdots& &\ddots& \vdots\\
x & x & x & \ldots & a_n+x \\ 
\end{vmatrix}=\begin{vmatrix}
a_1 & 0 & 0 & \ldots & -a_n \\ 
0 & a_2 & 0 & \ldots & -a_n \\ 
0 & 0 & a_3 & \ldots & -a_n \\ 
\vdots & \vdots& &\ddots& \vdots\\
x & x & x & \ldots & a_n+x \\ 
\end{vmatrix}$$
This determinant is a linear function in $x$. Therefore
$$\begin{vmatrix}
a_1+x & x & x & \ldots & x \\ 
x & a_2+x & x & \ldots & x \\ 
x & x & a_3+x & \ldots & x \\ 
\vdots & \vdots& &\ddots& \vdots\\
x & x & x & \ldots & a_n+x \\ 
\end{vmatrix}=ax+b$$
Now when $x=0$ we get
$$b=a_1 ... a_n$$
All you have to do next is do row expansion by the last row in
$$\begin{vmatrix}
a_1 & 0 & 0 & \ldots & -a_n \\ 
0 & a_2 & 0 & \ldots & -a_n \\ 
0 & 0 & a_3 & \ldots & -a_n \\ 
\vdots & \vdots& &\ddots& \vdots\\
x & x & x & \ldots & a_n+x \\ 
\end{vmatrix}$$
in order to find the coefficient of $x$.
For 2), without eigenvalues: Transpose the matrix, and then add all rows to the first. We get:
$$\begin{vmatrix}
a_1+x & a_2 & a_3 & \ldots & a_n \\ 
a_1 & a_2+x & a_3 & \ldots & a_n \\ 
a_1 & a_2 & a_3+x & \ldots & a_n \\ 
\vdots & \vdots& &\ddots& \vdots\\
a_1 & a_2 & a_3 & \ldots & a_n+x \\ 
\end{vmatrix}=\begin{vmatrix}
a_1+x & a_1 & a_1 & \ldots & a_1 \\ 
a_2 & a_2+x & a_2 & \ldots & a_2 \\ 
a_3 & a_3 & a_3+x & \ldots & a_3 \\ 
\vdots & \vdots& &\ddots& \vdots\\
a_n & a_n & a_n & \ldots & a_n+x \\ 
\end{vmatrix}=\begin{vmatrix}
a_1+a_2+..+a_n+x & a_1+a_2+..+a_n+x & a_1+a_2+..+a_n+x & \ldots &a_1+a_2+..+a_n+x\\ 
a_2 & a_2+x & a_2 & \ldots & a_2 \\ 
a_3 & a_3 & a_3+x & \ldots & a_3 \\ 
\vdots & \vdots& &\ddots& \vdots\\
a_n & a_n & a_n & \ldots & a_n+x \\ 
\end{vmatrix}=(a_1+a_2+..+a_n+x)\begin{vmatrix}
1 & 1 & 1 & \ldots &1\\ 
a_2 & a_2+x & a_2 & \ldots & a_2 \\ 
a_3 & a_3 & a_3+x & \ldots & a_3 \\ 
\vdots & \vdots& &\ddots& \vdots\\
a_n & a_n & a_n & \ldots & a_n+x \\ 
\end{vmatrix}$$
Now if you do each row minus $a_i$ row one you get
$$=(a_1+a_2+..+a_n+x)\begin{vmatrix}
1 & 1 & 1 & \ldots &1\\ 
0 & x & 0 & \ldots & 0 \\ 
0 & 0 & x & \ldots & 0 \\ 
\vdots & \vdots& &\ddots& \vdots\\
0& 0 & 0 & \ldots & x \\ 
\end{vmatrix}$$
A: I don't know if you are familiar with induction, but you can try it for both forms you mentioned in your question. 
For the first one the determinant is $$D_1=\prod_{j=1}^n a_j + \sum_{1\leq i_1<i_2<\cdots<i_{n-1}\leq n} a_{i_1} a_{i_2}  \cdots a_{i_{n-1}} x$$
For the second one $$ D_2= x^n +\sum_{i=1}^n a_i x^{n-1}$$
I get these formulae by trying the dterminants for $n=1,2,3,4$, you can check this and this for example, then easily you can extract such equalities for  $D_1$ and $D_2$, then by induction you prove  the result for every $n$. If you got stuck in any step of the induction, just drop a comment.
Hope this helps you.
A: Let
\begin{align}
T_n &=
\begin{vmatrix}
a_1+x & x & x & \cdots & x \\
x & a_2+x & x & \cdots & x \\
x & x & a_3+x & \cdots & x \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
x & x & x & \cdots & a_n+x
\end{vmatrix} \\
 &=
\begin{vmatrix}
a_1+x & x & x & \cdots & x \\
-a_1 & a_2 & 0 & \cdots & 0 \\
-a_1 & 0 & a_3 & \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
-a_1 & 0 & 0 & \cdots & a_n
\end{vmatrix}
\end{align}
Expand $T_n$ with the last column, and we can get
$$
T_n = x a_1 a_2 \cdots a_{n-1} + a_n T_{n-1}
$$
It's obvious that
$$
T_1 = a_1 + x
$$
By induction, we can get
$$
T_n = x \sum^n_{j=1} \prod^n_{\scriptstyle i=1 \atop \scriptstyle i\ne j} a_i + \prod^n_{i=1} a_i
$$
