# How do i find the determinant of this nxn matrix?

I have the following matrix with dimensions nxn: $$\begin{bmatrix} -2 & x & x & \cdots & x \\ x & -2 & x & \cdots & x \\ x & x & -2 & \cdots & x \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ x & x & x & \cdots & -2 \\ \end{bmatrix}$$

I need to find the determinant of it. I'm in the cofactors & cramer rule section, so i think i need to make use of them.

Here's a solution with row operations and cofactors, as requested.

Subtract the bottom row from all other rows, then expand the determinant using the first column. There are two terms, one involving the determinant of an upper triangular matrix, which is the product of the diagonal elements, and another involving the determinant of a similar matrix with decremented dimension, for which you can use induction. (The formula derived in my other answer can help you work out the induction.)

• Thank you very much, this was exactly what i was looking for – agos46 Sep 30 '15 at 0:11

Denote the dimension of the matrix by $n$. Adding $x+2$ on the diagonal yields a matrix with an $(n-1)$-fold eigenvalue of $0$, so $-(x+2)$ is an $(n-1)$-fold eigenvalue. Also, subtracting $(n-1)x-2$ yields a degenerate matrix (since its columns sum to $0$), so this is the $n$-th eigenvalue. The determinant is the product of the eigenvalues, $((n-1)x-2)(-(x+2))^{n-1}$.

• Thanks for your answer!, but i'm really starting linear algebra so i think i must solve this problem with row operations, cofactors or factorization – agos46 Sep 29 '15 at 23:43
• @agos46: OK; I posted another answer that uses only row operations and cofactors (and induction). – joriki Sep 29 '15 at 23:52

The simplest is in two steps:

• substract the last row to the $n-1$ first row; the yields the determinant: $$\begin{vmatrix} -(x+2)&0&0&\dots&0& x+2 \\ 0&-(x+2)&0&\dots&0& x+2 \\ 0&0&-(x+2)&\dots&0& x+2 \\ \vdots&&&&&\vdots\\ 0&0&0&\dots&-(x+2)& x+2\\ x&x&x&\dots&x&-2 \end{vmatrix}$$
• add each of the $n-1$ first columns to the last one: $$\begin{vmatrix} -(x+2)&0&0&\dots&0& 0 \\ 0&-(x+2)&0&\dots&0& 0 \\ 0&0&-(x+2)&\dots&0& 0 \\ \vdots&&&&&\vdots\\ 0&0&0&\dots&-(x+2)& 0\\ x&x&x&\dots&x&(n-1)x-2 \end{vmatrix}$$ Finally, you obtain a lower triangular determinant. Such determinany=ts are equal to the product of the elemnts on the diagonal. If you're not supposed to kniw that, just develop the determinant along the last column. You get $$(-1)^{n-1}(x+2)^{n-1}\bigl((n-1)x-2\bigr).$$