Find the determinant of $n\times n$ matrix Suppose, $ M=\begin{bmatrix}\begin{array}{ccccccc}
      -x & a_2&a_3&a_4&\cdots &a_n\\
      a_{1} & -x & a_3&a_4&\cdots &a_n\\
      a_1&a_{2} & -x &a_4&\cdots &a_n\\
      \vdots&\vdots&\vdots&\vdots &\ddots&\vdots\\
      a_1&a_{2} & a_3&a_4&\cdots & -x\\
      \end{array}\end{bmatrix}$, then how to find the $\det (M)$?
Proof: First I started by taking the $a_i$ from each  $i$-th columns, then$ |M|=\prod_{i=1}^{n}{a_i} \begin{vmatrix}\begin{array}{ccccccc}
      \frac{-x}{a_1} & 1&1&1&\cdots &1\\
      {1} & \frac{-x}{a_2} & 1&1&\cdots &1\\
      1&1 & \frac{-x}{a_3} &1&\cdots &1\\
      \vdots&\vdots&\vdots&\vdots &\ddots&\vdots\\
      1&1 & 1&1&\cdots & \frac{-x}{a_n}\\
      \end{array}\end{vmatrix}$. After this is there any easiest way to find the determinant.

Subtract the first row from each of the other rows.  Most of the terms are now zero, and you can expand across the first row.  Each product misses one of the $(x+a_i)$ factors, replaced by $a_i$.  So the determinant is 
$$(-1)^n\prod_i(x+a_i)\left[\frac x{x+a_1}-\frac {a_2}{x+a_2}-\frac {a_3}{x+a_3}...\right]\\
=(-1)^n\prod_i(x+a_i)\left[1-\sum_i\frac{a_i}{x+a_i}\right]$$
