Mathwords logoMathwords

Tridiagonal Matrix — Definition, Formula & Examples

A tridiagonal matrix is a square matrix where the only nonzero entries lie on the main diagonal, the diagonal immediately above it (superdiagonal), and the diagonal immediately below it (subdiagonal). All other entries are zero.

An n×nn \times n matrix A=[aij]A = [a_{ij}] is tridiagonal if aij=0a_{ij} = 0 whenever ij>1|i - j| > 1. Equivalently, the matrix has bandwidth 1, meaning nonzero entries are confined to positions (i,i1)(i, i-1), (i,i)(i, i), and (i,i+1)(i, i+1).

Key Formula

A=(b1c100a2b2c200a3b3cn100anbn)A = \begin{pmatrix} b_1 & c_1 & 0 & \cdots & 0 \\ a_2 & b_2 & c_2 & \cdots & 0 \\ 0 & a_3 & b_3 & \ddots & \vdots \\ \vdots & \ddots & \ddots & \ddots & c_{n-1} \\ 0 & \cdots & 0 & a_n & b_n \end{pmatrix}
Where:
  • bib_i = Entries on the main diagonal
  • aia_i = Entries on the subdiagonal (below main diagonal)
  • cic_i = Entries on the superdiagonal (above main diagonal)

How It Works

To identify a tridiagonal matrix, check that every entry more than one position away from the main diagonal is zero. When solving a tridiagonal system Ax=bAx = b, you can use the Thomas algorithm, a simplified form of Gaussian elimination that runs in O(n)O(n) time instead of the usual O(n3)O(n^3). This efficiency comes from the sparse structure: each row has at most three nonzero entries, so elimination and back-substitution each require only a single pass through the rows.

Worked Example

Problem: Determine whether the following 4×4 matrix is tridiagonal and, if so, find its determinant.
Matrix: Consider the matrix
A=(2100121001210012)A = \begin{pmatrix} 2 & -1 & 0 & 0 \\ -1 & 2 & -1 & 0 \\ 0 & -1 & 2 & -1 \\ 0 & 0 & -1 & 2 \end{pmatrix}
Check structure: Every entry with ij>1|i - j| > 1 is zero. The nonzero entries sit only on the main diagonal (22's), the superdiagonal (1-1's), and the subdiagonal (1-1's). So the matrix is tridiagonal.
Compute determinant: For this particular tridiagonal matrix, the determinant satisfies the recurrence Dn=2Dn1Dn2D_n = 2D_{n-1} - D_{n-2} with D1=2D_1 = 2 and D2=3D_2 = 3. So D3=2(3)2=4D_3 = 2(3) - 2 = 4 and D4=2(4)3=5D_4 = 2(4) - 3 = 5.
det(A)=5\det(A) = 5
Answer: The matrix is tridiagonal, and its determinant is 55.

Why It Matters

Tridiagonal systems arise naturally when discretizing differential equations using finite differences, a core technique in numerical analysis and scientific computing. In courses on numerical methods or computational physics, recognizing tridiagonal structure lets you solve large systems thousands of times faster than general-purpose methods allow.

Common Mistakes

Mistake: Confusing tridiagonal with diagonal. Students sometimes assume a tridiagonal matrix has nonzero entries only on the main diagonal.
Correction: A diagonal matrix has entries only on the main diagonal. A tridiagonal matrix also allows nonzero entries on the two adjacent diagonals (superdiagonal and subdiagonal).