Find the determinant of $n\times n$ matrix Suppose, $ M=\begin{bmatrix}\begin{array}{ccccccc}
      -x &amp; a_2&amp;a_3&amp;a_4&amp;\cdots &amp;a_n\\
      a_{1} &amp; -x &amp; a_3&amp;a_4&amp;\cdots &amp;a_n\\
      a_1&amp;a_{2} &amp; -x &amp;a_4&amp;\cdots &amp;a_n\\
      \vdots&amp;\vdots&amp;\vdots&amp;\vdots &amp;\ddots&amp;\vdots\\
      a_1&amp;a_{2} &amp; a_3&amp;a_4&amp;\cdots &amp; -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} &amp; 1&amp;1&amp;1&amp;\cdots &amp;1\\
      {1} &amp; \frac{-x}{a_2} &amp; 1&amp;1&amp;\cdots &amp;1\\
      1&amp;1 &amp; \frac{-x}{a_3} &amp;1&amp;\cdots &amp;1\\
      \vdots&amp;\vdots&amp;\vdots&amp;\vdots &amp;\ddots&amp;\vdots\\
      1&amp;1 &amp; 1&amp;1&amp;\cdots &amp; \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]$$
Hint: $\det(M)$ is a polynomial in $x$ and $M$ is clearly singular if $x=-a_k$ for some $k$