<s>[INST] How to compute the determinant of a tridiagonal matrix with constant diagonals? How to show that the determinant of the following $(n\times n)$ matrix
$$\begin{pmatrix}
5 & 2 & 0 & 0 & 0 & \cdots & 0 \\
2 & 5 & 2 & 0 & 0 & \cdots & 0 \\
0 & 2 & 5 & 2 & 0 & \cdots & 0 \\
\vdots & \vdots& \vdots& \vdots & \vdots & \vdots & \vdots \\
0 & \cdots & \cdots & 0 & 2 & 5 & 2 \\
0 & \cdots & \cdots & \cdots & \cdots & 2 & 5
\end{pmatrix}$$
is equal to $\frac13(4^{n+1}-1)$?

More generally:

How does one compute the determinant of the following tridiagonal matrix (where the three diagonals are constant)?
$$M_n(a,b,c) = \begin{pmatrix}
a & b & 0 & 0 & 0 & \cdots & 0 \\
c & a & b & 0 & 0 & \cdots & 0 \\
0 & c & a & b & 0 & \cdots & 0 \\
\vdots & \vdots& \vdots& \vdots & \vdots& \vdots & \vdots \\
0 & \cdots & \cdots & 0 & c & a & b \\
0 & \cdots & \cdots & \cdots & \cdots & c & a
\end{pmatrix}$$
Here $a,b,c$ can be taken to be real numbers, or complex numbers.

In other words, the matrix $M_n(a,b,c) = (m_{ij})_{1 \le i,j \le n}$ is such that
$$m_{ij} = \begin{cases}
a & i = j, \\
b & i = j - 1, \\
c & i = j + 1, \\
0 & \text{otherwise.}
\end{cases}$$
There does not seem to be an easy pattern to use induction: the matrix is not a diagonal block matrix of the type $M = \bigl(\begin{smallmatrix} A & C \\ 0 & B \end{smallmatrix}\bigr)$ (where we could use $\det(M) = \det(A) \det(B)$ for the induction step), and there are no lines or columns with only one nonzero entry, so Laplace expansion gets complicated quickly.
Is there a general pattern that one could use? Or is the answer only known on a case-by-case basis? It's possible to compute the determinant by hand for small $n$:
$$\begin{align}
\det(M_1(a,b,c)) & = \begin{vmatrix} a \end{vmatrix} = a  \\
\det(M_2(a,b,c)) & = \begin{vmatrix} a & b \\ c & a \end{vmatrix} = a^2 - bc \\
\det(M_3(a,b,c)) & = \begin{vmatrix} a & b & 0 \\ c & a & b \\ 0 & c & a \end{vmatrix} = a^3 - 2abc
\end{align}$$
But there is no readily apparent pattern and the computation becomes very difficult when $n$ gets large.
 [/INST] Your determinant is equal to
$$
2^n\det\begin{bmatrix}2x & 1 & 0 & 0 & 0 & \cdots & 0\\ 1 & 2x & 1 & 0 & 0 & \cdots & 0\\ 0 & 1 & 2x & 1 & 0 & \cdots & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & \ddots &\vdots\\ 0 & 
\cdots & 0 & 1 & 2x & 1 & 0\\ 0 & \cdots & 0 & 0 & 1 & 2x & 1\\ 0 & \cdots & 0 & 0 & 0 & 1 & 2x\end{bmatrix}=:2^nD_n(x),
$$
with $x=5/4$.  As in Calvin Lin's answer, $D_n(x)$ satisfies a recurrence, namely $D_n(x)=2xD_{n-1}(x)-D_{n-2}(x)$, which can be obtained by expanding $D_n(x)$ by minors on its first row and then expanding the $(n-1)$-by-$(n-1)$ determinant one gets in the second term by minors on its first column.  This is the defining recurrence for the Chebyshev polynomials of the first and second kinds, which are denoted $T_n(x)$ and $U_n(x)$.  Furthermore, $U_0(x)=1=D_0(x)$ and $U_1(x)=2x=D_1(x)$.  So $D_n(x)=U_n(x)$.
The Chebyshev Polynomials are related to expansions of trigonometric or hyperbolic functions.  In the case of polynomials of the second kind,
$$
\begin{aligned}
U_n(\cos t)&=\frac{\sin (n+1)t}{\sin t},\\
U_n(\cosh t)&=\frac{\sinh (n+1)t}{\sinh t}.
\end{aligned}
$$
Using the second of these, we let $\cosh t=\frac{5}{4}$ and find that $e^t=\frac{1}{2}$ or $2$.  Choosing one of these solutions, say $e^t=2$, one can evaluate both $\sinh (n+1)t$ and $\sinh t$.  The end result is the given formula.
This works for general $x,$ but as noted in Marc van Leeuwen's comment to user17762's answer, special care is required when $x=\pm1.$  Solving $\cosh t=x$ or $e^t+e^{-t}=2x$ we find $e^t=x\pm\sqrt{x^2-1},$ which yields
$$
\begin{aligned}
U_n(x)=U_n(\cosh t)&=\frac{(x+\sqrt{x^2-1})^{n+1}-(x-\sqrt{x^2-1})^{n+1}}{x+\sqrt{x^2-1}-(x-\sqrt{x^2-1})}\\
&=\frac{(x+\sqrt{x^2-1})^{n+1}-(x-\sqrt{x^2-1})^{n+1}}{2\sqrt{x^2-1}}.
\end{aligned}
$$
This clearly reduces to a polynomial in $x,$ but is more useful than the polynomial form for evaluation.  When $x=\pm1,$ which is equivalent to $t=im\pi,$ l'Hôpital's rule is needed in the evaluation:
$$
\begin{aligned}
U_n(\pm1)=U_n(\cosh im\pi)&=\lim_{t\to im\pi}\frac{e^{(n+1)t}-e^{-(n+1)t}}{e^t-e^{-t}}\\
&=\lim_{t\to im\pi}\frac{(n+1)e^{(n+1)t}+(n+1)e^{-(n+1)t}}{e^t+e^{-t}}=(n+1)(\pm1)^n.
\end{aligned}
$$
Revised question: The method can be adapted to handle the more general form in the revised question of February 2015.  If $bc=0$ the determinant is clearly $a^n.$  Otherwise, let $g$ be a solution to $g^2=bc$ and define $x:=\frac{a}{2g},$ $y:=\frac{b}{g}.$  Since $\frac{c}{g}=\frac{g}{b}=y^{-1},$ the more general determinant is equal to
$$
g^n\det\begin{bmatrix}2x & y & 0 & 0 & 0 & \cdots & 0\\ y^{-1} & 2x & y & 0 & 0 & \cdots & 0\\ 0 & y^{-1} & 2x & y & 0 & \cdots & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & \ddots &\vdots\\ 0 & 
\cdots & 0 & y^{-1} & 2x & y & 0\\ 0 & \cdots & 0 & 0 & y^{-1} & 2x & y\\ 0 & \cdots & 0 & 0 & 0 & y^{-1} & 2x\end{bmatrix}=:g^nD_n(x,y).
$$
But $D_n(x,y)$ satisfies the same recurrence as $D_n(x)$ and the same initial conditions, and so $D_n(x,y)$ also equals $U_n(x).$  (It is independent of $y.$)
</s>