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.

Hint: $\det(M)$ is a polynomial in $x$ and $M$ is clearly singular if $x=-a_k$ for some $k$
