Diagonalizing the matrix $\begin{bmatrix}2&-1&0&0\\-1&2&-1&0\\0&-1&2&-1\\0&0&-1&2\end{bmatrix}$ 
Evaluate the eigenvalues of the matrix $\begin{bmatrix}2&-1&0&0\\-1&2&-1&0\\0&-1&2&-1\\0&0&-1&2\end{bmatrix}$

In my reference it is given that eigenvalues of the matrix all have the form $2-2\cos\theta=4\sin^2(\theta/2)$. The $n$ different angles $\theta$ are equally spaced, $\theta=\dfrac{\pi}{2n+1},\dfrac{3\pi}{3n+1},\cdots\cdots,\dfrac{(2n-1)\pi}{2n+1}$.
I have got no idea where does these $\theta$ comes in for the eigenvalues of the given matrix ?
Exact description in the reference:

Reference: Page 368, Chapter 7-The Singular Value Decomposition (SVD), Introduction to Linear Algebra, Gilbert Strang, 5th Edition
 A: This is one of my favorite collections of matrices.
Let's define
$$
U_n(x)=\det
\left(\begin{array}{cccccc}
2x&-1&0&0&\cdots&0\\
-1&2x&-1&0&\cdots&0\\
0&-1&2x&-1&\cdots&0\\
\vdots&\vdots&\ddots&\ddots&\cdots&\vdots\\
0&\cdots&\cdots&-1&2x&-1\\
0&\cdots&\cdots&0&-1&2x
\end{array}\right),
$$
where $n$ is the number of rows.
Expanding this along the bottom row gives the recurrency relation of depth two
$$
U_{n+1}(x)=2x U_n(x)-U_{n-1}(x).
$$
And we also have
$$
U_0(x)=1,\qquad U_1(2x).
$$
This means that the polynomials $U_n(x)$ are exactly the Chebyshev polynomials of the second kind.
Meaning that
$$
U_n(\cos\theta)=\frac{\sin((n+1)\theta)}{\sin\theta}.
$$
The proof for this is standard (see loc. linked).
For example the familiar trig formula
$$
\sin 2x=2\cos x\sin x
$$
is equivalent to $U_1(\cos x)=2\cos x$.
Anyway, we know that $\sin((n+1)\theta)=0$ when $\theta=\theta_k=k\pi/(n+1)$ for $k=1,2,\ldots,n$, but
$\sin \theta_k\neq0$ for all $k$. Therefore
$$
U_n(\cos \theta_k)=0
$$
for all $k=1,2,\ldots, n$. Cosine is a decreasing function in the interval $[0,\pi]$, so the numbers $x_k=\cos\theta_k$, $k=1,2,\ldots,n$, are exactly the zeros of $U_n(x)$.

If $\chi_n(T)=\det(M_n-TI_n)$ is the characteristic polynomial of your matrix $M_n$ (the version with $n$ rows), then
$$
\chi_n(2-2x)=U_n(x).
$$
It follows that the eigenvalues of $M_n$ are the numbers
$$
\lambda_k=2-2x_k=2-2\cos\frac{k\pi}{n+1},\quad k=1,2,\ldots,n
$$
