I have been taking the Numerical Analysis this year. And the lecturer asked us to show the eigenvalue of following matrix satisfies certain equation and he gave pretty good hint. $A = \left[\begin{array}{ccccc} a & b & & & \\ b & a & b & & \\ & \ddots & \ddots & \ddots & \\ & & b & a & b\\ & & & b & a \end{array}\right]_{N \times N} B = \left[\begin{array}{ccccc} a & c & & & \\ b & a & c & & \\ & \ddots & \ddots & \ddots & \\ & & b & a & c\\ & & & b & a \end{array}\right]_{N \times N}$
For $A$ I have already developed a quite good solution as follows.
First we consider the continuous eigenvalue problem. \begin{equation} \left\{\begin{array}{l} u'' = \lambda u\\ u (0) = u (1) = 0 \end{array}\right. \label{eq:1} \end{equation}
The general solution of the above problem is $u = c_1 e^{\sqrt{\lambda} x} + c_2 e^{- \sqrt{\lambda} x}$.
Substitute the solution into boundary condition, we get \begin{equation} \left\{\begin{array}{l} c_1 + c_2 = 0\\ c_1 e^{\sqrt{\lambda}} + c_2 e^{- \sqrt{\lambda}} = 0 \end{array}\right. \label{eq:2} \end{equation}
Since (2) admits a non-zero solution $u (x) \neq 0$. \begin{equation} \left|\begin{array}{cc} 1 & 1\\ e^{\sqrt{\lambda}} & e^{- \sqrt{\lambda}} \end{array}\right| = e^{- \sqrt{\lambda}} - e^{\sqrt{\lambda}} = 0 \label{eq:3} \end{equation}
From above we can know that \begin{equation} \lambda = - k^2 \pi^2 \text{ where } k = 1, 2, \ldots \end{equation}
Substitute $\lambda_k$ into the equation we have $u_k = \sin (k \pi x)$.
Now for the matrix version, we can guess the eigenvector has a similar form and verify it.
Denote $k_{th}$ eigenvector as $v_k$. \begin{equation} v_k = \left[\begin{array}{c} \sin (k \pi x_1)\\ \ldots .\\ \sin (k \pi x_n) \end{array}\right] = \left[\begin{array}{c} \sin (k \pi h)\\ \ldots\\ \sin (Nk \pi h) \end{array}\right] = \left[\begin{array}{c} \sin (\theta_k)\\ \ldots\\ \sin (N \theta_k) \end{array}\right] \end{equation}
Now plug our $v_k$ back to the matrix.
First consider $Av_k = \lambda_k v_k$. \begin{equation} \left\{\begin{array}{l} a \sin (\theta_k) + b \sin (2 \theta_k) = \lambda_k \sin (\theta_k)\\ b \sin ((j - 1) \theta_k) + a \sin (j \theta_k) + b \sin ((j + 1) \theta_k) = \lambda_k \sin (j \theta_k)\\ b \sin ((N - 1) \theta_k) + a \sin (N \theta_k) = \lambda_k \sin (N \theta_k) \end{array}\right. \label{eq:6} \end{equation}
Above can be simplified into one equation as $\sin (0) = \sin (k \pi) = 0$. \begin{equation} b \sin ((j - 1) \theta_k) + a \sin (j \theta_k) + b \sin ((j + 1) \theta_k) = \lambda_k \sin (j \theta_k) \quad j = 1 \ldots N \label{eq:7} \end{equation}
By sum-to-product identity of trignometric functions. We have \begin{eqnarray*} 2 b \sin (j \theta_k) \cos (\theta_k) + a \sin (j \theta_k) & = & \lambda_k \sin (j \theta_k)\\ 2 b \sin (j \theta_k) \cos \left( \frac{k \pi}{N + 1} \right) + a \sin (j \theta_k) & = & \lambda_k \sin (j \theta_k)\\ \lambda_k & = & a + 2 b \cos \left( \frac{k \pi}{N + 1} \right) \quad k = 1 \ldots N \end{eqnarray*}
We have solved $\lambda_k$ for $A$.
Here is my problem. Will the same procedure work on $B$? I've tried a bit. but it always got stuck at the trignometric part.
By a standard procedure well described here : https://en.wikipedia.org/wiki/Tridiagonal_matrix#Similarity_to_symmetric_tridiagonal_matrix with an explicit solution you will find here : https://math.stackexchange.com/q/1148874