# Find the determinant of $n\times n$ matrix [closed]

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)$?

## closed as off-topic by user21820, Paul Frost, Mars Plastic, Daniele Tampieri, JaviAug 18 at 13:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – user21820, Paul Frost, Mars Plastic, Daniele Tampieri, Javi
If this question can be reworded to fit the rules in the help center, please edit the question.

• What is your try? – Rajat Sep 24 '15 at 10:51
• Up to $(-1)^n$, it's the characteristic polynomial of $M(0)$, if that helps. – lhf Sep 24 '15 at 11:07
• Trying low values of $n$ will give you good idea of the general form. – lhf Sep 24 '15 at 11:08

## 4 Answers

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]$$

• Concise and simple! +1  – user1551 Sep 24 '15 at 11:39

Let $D=-\operatorname{diag}(x+a_1,\,\ldots,\,x+a_n)$. Then $M=D+ea^T$. Using the rank-1 update formula for determinant, we have $\det M=(1+a^TD^{-1}e)\det(D)$. After some work, you should be able to prove that the determinant is $$(-1)^n\left[\prod_i (x+a_i)-\sum_ia_i\prod_{j\ne i}(x+a_j)\right].$$

The empirical formula I got from considering $n=2,3,4$ in Wolfram Alpha is $$(-1)^n(x^n-\sum_{k=2}^n (k-1)\sigma_k x^{n-k})$$ where $\sigma_k$ is the $k$-th elementary symmetric polynomial in $a_1,\dots,a_n$.

I don't see how this follows at once from the other answers.

• even I also got the similar formula by using wolfram Mathematica, but I don't know how to write a proof. – L S B. user255259 Sep 24 '15 at 13:33

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

• I thought the exact same thing, but it's not. For $n=2$, the polynomial is $x^2-a_1a_2$. And for $n=1$, it's $-x$, not $x+a_1$. – lhf Sep 24 '15 at 11:15
• I also tripped over this. For some reason, when I set the first $x$ to $a_1$, I subconsciously substituted the other $x$s by $a_2$ up to $a_n$, and mistakenly thought that the columns became linearly dependent. I could realise what was wrong only after I stared at the matrix for five minutes. – user1551 Sep 24 '15 at 11:47