determinant of the $7\times7$ matrix How to find determinant of the following $7\times7$ matrix
\begin{bmatrix} 
    a&1&0&0&0&0&1&\\
    1&a&1&0&0&0&0&\\
    0&1&a&1&0&0&0&\\
    0&0&1&a&1&0&0&\\
    0&0&0&1&a&1&0&\\
    0&0&0&0&1&a&1&\\
    1&0&0&0&0&1&a&
\end{bmatrix}
 A: Let $e_0, e_1, \ldots, e_6$ be the basis column vector with entries $1$ at $q^{th}$ row and zero otherwise. i.e
$$(e_q)_p = \begin{cases}1, & p = q\\0, & \text{ otherwise }\end{cases},\quad 0 \le p, q \le 6$$
Let $A$ be the matrix at hand. Let $L = (\ell_{pq})$ and $R = (r_{pq})$ be the $7 \times 7$ matrices given by
$$\ell_{qp} = r_{pq} = \begin{cases} 1, & p = q+1 \pmod 7\\0, & \text{ otherwise }\end{cases},\quad 0 \le p, q \le 6$$
$L$ and $R$ are matrices which shift the basis vector $e_q$ to $e_{q-1 \pmod 7}$
and $e_{q+1 \pmod 7}$ respectively.
In terms of $L$ and $R$, we have
$$A = a I_7 + L + R$$
It is easy to see $R = L^{T} = L^{-1}$ and $L$ has seven eigenvectors $u_0, u_1, \ldots, u_6$ of the form
$$u_p = \sum_{q=0}^6 e^{i\frac{2\pi pq}{7}} e_q\quad\iff\quad(u_p)_q = e^{i\frac{2\pi pq}{7}},\quad 0 \le q \le 6$$
with eigenvalue $e^{i\frac{2\pi p}{7}}$. This means $A$ has eigenvalues of the form $a + 2\cos\frac{2\pi p}{7}$ and
$$\det A = \prod_{p=0}^6 \left( a + 2\cos\frac{2\pi p}{7} \right)$$
Rewrite $a$ as $2\cosh\theta = e^\theta + e^{-\theta}$, we have
$$\begin{align}\det A 
&= e^{-7\theta}
\prod_{p=0}^6 \left(e^{2\theta}+1 + 2e^\theta\cos\frac{2\pi p}{7}\right)
= e^{-7\theta}\prod_{p=0}^6 \left(e^\theta + e^{i\frac{2\pi p}{7}}\right)\left(e^\theta + e^{-i\frac{2\pi p}{7}}\right)\\
&= e^{-7\theta}(e^{7\theta} + 1)^2
= 2\cosh(7\theta) + 2 = 2T_7(\frac{a}{2}) +2\\
&= a^7-7a^5+14a^3-7a+2
\end{align}
$$
where 
$T_n(x) = \cos(n\cos^{-1}(x)) = \cosh(n\cosh^{-1}(x))$ is the Chebyshev polynomial of first kind. 
A: An elementary proof. Let $J$ be the permutation matrix $(1\rightarrow 7,2\rightarrow 1,3\rightarrow 2\cdots)$; clearly $J^7=I$. Then we consider the matrix $A=aI+J+J^{-1}$. Let $\Delta_p=J^p+J^{-p}$ and $X=J+J^{-1}$.
$X^7=2I+7\Delta_5+21\Delta_3+35\Delta_1$. We remove $\Delta_5$:
$X^5=\Delta_5+5\Delta_3+10\Delta_1$ implies $X^7-7X^5=2I-14\Delta_3-35\Delta_1$.
We remove $\Delta_3$: $X^3=\Delta_3+3\Delta_1$ implies $X^7-7X^5+14X^3=2I +7\Delta_1$, that is
$f(X)=X^7-7X^5+14X^3-7X-2I=0$. Note that $f(x)=(x-2)(x^3+x^2-2x-1)^2$ (in irreducible factors).
Clearly $2$ is an eigenvalue of $X$. Then the characteristic polynomial of $X$ is $(x-2)^4(x^3+x^2-2x-1)$ or $f(x)$; in fact, it is $f(x)$ because $trace(X)=0$.
Conclusion: the required determinant is $-f(-a)=a^7-7a^5+14a^3-7a+2$.
