Find determinant for a matrix with $x$ on the diagonal

determinantlinear algebramatrices

Find determinant for a matrix with $x$ on the diagonal and $-1$ at the end of the first row and $-1$ at first of the last row other elements are $0$.

{ x  0 0 -1 
  0  x 0  0 
  .  0 x 
  .  0 0  x 
  -1 0 .  .  x 
}

$$
\pmatrix{x & 0 & \cdots & 0 & -1\\
0 & x & \ddots & \vdots & 0\\
\vdots & \ddots & \ddots & 0 &\vdots\\
0& \cdots & 0 & x&0\\
-1&0&\cdots & 0 & x}
$$

I know if i add 1/xR1 to R2 the determinat will be $(x^{n-1})(x-1/x)$. I asked my professor she said what if $x$ is zero. Now i don't know what to do.

Best Answer

Your approach is perfectly fine. What you have shown is that in the case that $x \neq 0$, Your matrix $M$ satisfies $$ \det M = x^{n-1}(x - 1/x) = x^{n-2}(x^2 - 1). $$ All that remains is to show that this equation holds for $x = 0$ as well.

There are a few approaches to handle the case of $x = 0$. One is to note that $\det(M)$ must be a polynomial over $x$; since $\det(M) = x^{n-2}(x^2 - 1)$ holds for all $x \neq 0$ and polynomials are continuous, the equation must hold for $x = 0$ as well.

Alternatively, we can simply plug in $x = 0$. For the case of $n=2$, we have $$ \det(M) = \det \pmatrix{0&-1\\-1&0} = 0^2 - (-1)^2 = -1, $$ which agrees with the result of plugging $x = 0$ into $x^{2-2}(x^2 - 1) = x^2 - 1$, since $0^2 - 1 = -1$. For the case of $n > 2$, we see that $x = 0$ leads to a second row of zeros, which means that the determinant of $M$ is zero. This agrees with the result $x^{n-2}(x^2 - 1) = 0^{n-2}(0^2 - 1) = 0$.


One fast approach is to use the W-A (AKA Sylvester) identity. This matrix can be written as $M = xI + AB$, where $$ A = \pmatrix{1&0\\0&0\\ \vdots & \vdots \\ 0&0\\0&1}, \quad B = -\pmatrix{0&0&\cdots & 0& 1\\1 & 0 & \cdots & 0 & 0}. $$ For all $x \neq 0$, we have $$ \begin{align} \det(M) &= \det(xI_n + AB) = x^n \det(I_n + x^{-1}AB) \\ & = x^n \det(I_2 + x^{-1}BA) \\ & = x^{n-2} \det(x I_2 + BA) = x^{n-2} \det \pmatrix{x & -1\\-1 & x} = x^{n-2} (x^2 - 1). \end{align} $$