# Find the determinant of the following;

Find the determinant of the following matrix, and for which value of $x$ is it invertible; $$\begin{pmatrix} x & 1 & 0 & 0 & 0 & \ldots & 0 & 0 \\ 0 & x & 1 & 0 & 0 & \ldots & 0 & 0 \\ 0 & 0 & x & 1 & 0 & \ldots & 0 & 0 \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\ 0 & 0 & 0 & 0 & 0 & \ldots & x & 1 \\ 1 & 0 & 0 & 0 & 0 & \ldots & 0 & x \end{pmatrix}$$

Now I don't really know how to procees as I get find a suitable row operations that will simplify the process so I thought I would look at cases, maybe see a pattern.

$\mathbf{2 \times 2}$

$\begin{bmatrix}x & 1\\1 & x\end{bmatrix}$
This has determinant; $x^2-1$

$\mathbf{3 \times 3}$

$\begin{bmatrix}x & 1 & 0\\0 & x & 1\\1 & 0 & x\end{bmatrix}$
This has determinant $x^3+1$

So is that the pattern? determinant is $x^n-1$ if $n$ is even,
determinant is $x^n+1$ if $n$ is odd??

Develop the determinant by the first column...

$$\begin{vmatrix}\color{red}x&1&0&0&\ldots&0\\ \color{red}0&x&1&0&\ldots&0\\ \color{red}\ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\ \color{red}1&0&0&0&\ldots&x\end{vmatrix}=$$$${}$$

$$x\begin{vmatrix}x&1&0&0&\ldots&0\\ 0&x&1&0&\ldots&0\\ \ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\ 0&0&0&0&\ldots&x\end{vmatrix}+(-1)^{n-1}\begin{vmatrix}1&0&0&0&\ldots&0\\ x&1&0&0&\ldots&0\\ \ldots&\ldots&\ldots&\ldots&\ldots&\ldots\\ 0&0&0&\ldots&x&1\end{vmatrix}$$

Now check that both determinants above are triangular matrices's, so piece of cake...

I tried using Matrix Calculator to check the pattern you have mentioned. For any random value of x, it seems that your pattern is definitely correct.

Calculate the determinant of your matrix using the last raw expansion, i.e, $$\det(A)=(-1)^{n+1}+(-1)^{n+n}xx^{n-1}=x^n+(-1)^{n+1}.$$

This is exactly what you guess. If $n$ odd then $\det(A)=x^n+1$ and if $n$ even then $\det(A)=x^n-1$.

For $x=0$, the matrix is the permutation matrix for the cycle $(1,2,\dots,n)$.

Therefore, $A^n=I$, the identity matrix, and the first columns of $A^k$, for $k=0,\dots, n-1$ are the vectors of the standard basis and clearly linearly independent.

Therefore, $\lambda^n-1$ is the minimal polynomial and because of its degree $n$ the characteristic polynomial $\chi_A$ of $A$.

Your determinant is just $(-1)^n \chi_A(-x)=x^n-(-1)^n$.

It is easy to solve this problem with laplace's formula.
At first, you chose the first row for laplace's formula and get the following
(I draw $3\times 3$ matices intead of $(n-1)\times (n-1)$, because I don't know how to draw it clearly for arbitrary $n$):
$$x\cdot\begin{bmatrix}x & 1 & 0\\0 & x & 1\\0 & 0 & x\end{bmatrix}+(-1)^{n-1}\begin{bmatrix}1 & 0 & 0\\x & 1 & 0\\0 & x & 1\end{bmatrix}=x\cdot x^{n-1}+(-1)^{n-1}=x^n+(-1)^{n-1}$$