Proving the determinant of a tridiagonal matrix with $-1, 2, -1$ on diagonal. Let $A_n$ denote an $n \times n$ tridiagonal matrix. 
$$A_n=\begin{pmatrix}2 & -1 & & & 0 \\ -1 & 2 & -1 & & \\ & \ddots & \ddots & \ddots & \\ & & -1 & 2 & -1 \\ 0 & & & -1 & 2 \end{pmatrix} \quad\text{for }n \ge 2$$
Set $D_n = \det(A_n)$
Prove that $D_n = 2D_{n-1} - D_{n-2}$ for $n \ge 4$. 
 A: Expand with respect to the first column: you get
$$
D_n
=2 \times
\begin{vmatrix}2 & -1 & & & 0 \\ -1 & 2 & -1 & & \\ & \ddots & \ddots & \ddots & \\ & & -1 & 2 & -1 \\ 0 & & & -1 & 2 \end{vmatrix}_{(n-1)}
- (-1) \times
\begin{vmatrix}-1 & 0 & & & 0 \\
-1 & 2 & -1 & & 0 \\
 & \ddots & \ddots & \ddots & \\ & & -1 & 2 & -1 \\ 0 & & & -1 & 2 \end{vmatrix}_{(n-1)}
$$
Now expand according to the first line the second determinant: you get
$$
=2 \times
\begin{vmatrix}2 & -1 & & & 0 \\ -1 & 2 & -1 & & \\ & \ddots & \ddots & \ddots & \\ & & -1 & 2 & -1 \\ 0 & & & -1 & 2 \end{vmatrix}_{(n-1)}
- (-1)^2\times
\begin{vmatrix}2 & -1 & & & 0 \\ -1 & 2 & -1 & & \\ & \ddots & \ddots & \ddots & \\ & & -1 & 2 & -1 \\ 0 & & & -1 & 2 \end{vmatrix}_{(n-2)}
$$
Conclusion:
$$
D_n = 2D_{n-1} - D_{n-2}
$$
A: Here is a way to compute the determinant without using induction. Multiply the matrix $A_n$ to the left by the $n\times n$ upper triangular matrix $U_n$ with all entries on and above the diagonal equal to$~1$:
$$
  \begin{pmatrix}1&1&1&\ldots&1\\ 0&1&1&\ddots&\vdots\\0&0&1&\ddots&1\\
  \vdots & \ddots & \ddots & \ddots & 1 \\0&0& \ldots &0 & 1
 \end{pmatrix}
 \begin{pmatrix}2 & -1 & & & 0 \\ -1 & 2 & -1 & & \\
 & \ddots & \ddots & \ddots & \\ & & -1 & 2 & -1 \\
 0 & & & -1 & 2 \end{pmatrix} =
\begin{pmatrix}1&0&0&\ldots&0&1\\ -1&1&0&\ddots&0&1\\0&-1&1&\ddots&0&1\\
  \vdots & \ddots & \ddots & \ddots & 0&1 \\
  \vdots & \ddots & \ddots & -1 & 1&1 \\0&0& \ldots &0&-1 & 2
 \end{pmatrix}.
$$
Since $\det(U_n)=1$, we shall get $\det(A_n)$ as the determinant of our resulting matrix$~R$.
Now recognise  that $R=I-C_P$ where $C_P$ is the companion matrix of the polynomial $P=X^n+X^{n-1}+\cdots+X^2+X^1+X^0$. Since it is well known that $P$ is the characteristic polynomial $\det(IX-C_p)$ of $C_P$ we get
$$
 \det(A_n)=\det(R)=\det(I-C_P)=\det(IX-C_P)[X:=1]=P[X:=1]=n+1.
$$
