A tridiagonal matrix is a matrix that is both upper and lower Hessenberg matrix.2 In particular, a tridiagonal matrix is a direct sum of p 1-by-1 and q 2-by-2 matrices such that p + q/2 = n — the dimension of the tridiagonal. Although a general tridiagonal matrix is not necessarily symmetric or Hermitian, many of those that arise when solving linear algebra problems have one of these properties. Furthermore, if a real tridiagonal matrix A satisfies ak,k+1 ak+1,k > 0 for all k, so that the signs of its entries are symmetric, then it is similar to a Hermitian matrix, by a diagonal change of basis matrix. Hence, its eigenvalues are real. If we replace the strict inequality by ak,k+1 ak+1,k ≥ 0, then by continuity, the eigenvalues are still guaranteed to be real, but the matrix need no longer be similar to a Hermitian matrix.3
The set of all n × n tridiagonal matrices forms a 3n-2 dimensional vector space.
Many linear algebra algorithms require significantly less computational effort when applied to diagonal matrices, and this improvement often carries over to tridiagonal matrices as well.
Main article: Continuant (mathematics)
The determinant of a tridiagonal matrix A of order n can be computed from a three-term recurrence relation.4 Write f1 = |a1| = a1 (i.e., f1 is the determinant of the 1 by 1 matrix consisting only of a1), and let
The sequence (fi) is called the continuant and satisfies the recurrence relation
with initial values f0 = 1 and f−1 = 0. The cost of computing the determinant of a tridiagonal matrix using this formula is linear in n, while the cost is cubic for a general matrix.
The inverse of a non-singular tridiagonal matrix T
is given by
where the θi satisfy the recurrence relation
with initial conditions θ0 = 1, θ1 = a1 and the ϕi satisfy
with initial conditions ϕn+1 = 1 and ϕn = an.56
Closed form solutions can be computed for special cases such as symmetric matrices with all diagonal and off-diagonal elements equal7 or Toeplitz matrices8 and for the general case as well.910
In general, the inverse of a tridiagonal matrix is a semiseparable matrix and vice versa.11 The inverse of a symmetric tridiagonal matrix can be written as a single-pair matrix (a.k.a. generator-representable semiseparable matrix) of the form1213
( α 1 − β 1 − β 1 α 2 − β 2 ⋱ ⋱ ⋱ ⋱ ⋱ − β n − 1 − β n − 1 α n ) − 1 = ( a 1 b 1 a 1 b 2 ⋯ a 1 b n a 1 b 2 a 2 b 2 ⋯ a 2 b n ⋮ ⋮ ⋱ ⋮ a 1 b n a 2 b n ⋯ a n b n ) = ( a min ( i , j ) b max ( i , j ) ) {\displaystyle {\begin{pmatrix}\alpha _{1}&-\beta _{1}\\-\beta _{1}&\alpha _{2}&-\beta _{2}\\&\ddots &\ddots &\ddots &\\&&\ddots &\ddots &-\beta _{n-1}\\&&&-\beta _{n-1}&\alpha _{n}\end{pmatrix}}^{-1}={\begin{pmatrix}a_{1}b_{1}&a_{1}b_{2}&\cdots &a_{1}b_{n}\\a_{1}b_{2}&a_{2}b_{2}&\cdots &a_{2}b_{n}\\\vdots &\vdots &\ddots &\vdots \\a_{1}b_{n}&a_{2}b_{n}&\cdots &a_{n}b_{n}\end{pmatrix}}=\left(a_{\min(i,j)}b_{\max(i,j)}\right)}
where { a i = β i ⋯ β n − 1 δ i ⋯ δ n b n b i = β 1 ⋯ β i − 1 d 1 ⋯ d i {\displaystyle {\begin{cases}\displaystyle a_{i}={\frac {\beta _{i}\cdots \beta _{n-1}}{\delta _{i}\cdots \delta _{n}\,b_{n}}}\\\displaystyle b_{i}={\frac {\beta _{1}\cdots \beta _{i-1}}{d_{1}\cdots d_{i}}}\end{cases}}} with { d n = α n , d i − 1 = α i − 1 − β i − 1 2 d i , i = n , n − 1 , ⋯ , 2 , δ 1 = α 1 , δ i + 1 = α i + 1 − β i 2 δ i , i = 1 , 2 , ⋯ , n − 1. {\displaystyle {\begin{cases}d_{n}=\alpha _{n},\quad d_{i-1}=\alpha _{i-1}-{\frac {\beta _{i-1}^{2}}{d_{i}}},&i=n,n-1,\cdots ,2,\\\delta _{1}=\alpha _{1},\quad \delta _{i+1}=\alpha _{i+1}-{\frac {\beta _{i}^{2}}{\delta _{i}}},&i=1,2,\cdots ,n-1.\end{cases}}}
Main article: tridiagonal matrix algorithm
A system of equations Ax = b for b ∈ R n {\displaystyle b\in \mathbb {R} ^{n}} can be solved by an efficient form of Gaussian elimination when A is tridiagonal called tridiagonal matrix algorithm, requiring O(n) operations.14
When a tridiagonal matrix is also Toeplitz, there is a simple closed-form solution for its eigenvalues, namely:1516
A real symmetric tridiagonal matrix has real eigenvalues, and all the eigenvalues are distinct (simple) if all off-diagonal elements are nonzero.17 Numerous methods exist for the numerical computation of the eigenvalues of a real symmetric tridiagonal matrix to arbitrary finite precision, typically requiring O ( n 2 ) {\displaystyle O(n^{2})} operations for a matrix of size n × n {\displaystyle n\times n} , although fast algorithms exist which (without parallel computation) require only O ( n log n ) {\displaystyle O(n\log n)} .18
As a side note, an unreduced symmetric tridiagonal matrix is a matrix containing non-zero off-diagonal elements of the tridiagonal, where the eigenvalues are distinct while the eigenvectors are unique up to a scale factor and are mutually orthogonal.19
For unsymmetric or nonsymmetric tridiagonal matrices one can compute the eigendecomposition using a similarity transformation. Given a real tridiagonal, nonsymmetric matrix
where b i ≠ c i {\displaystyle b_{i}\neq c_{i}} . Assume that each product of off-diagonal entries is strictly positive b i c i > 0 {\displaystyle b_{i}c_{i}>0} and define a transformation matrix D {\displaystyle D} by20
The similarity transformation D − 1 T D {\displaystyle D^{-1}TD} yields a symmetric tridiagonal matrix J {\displaystyle J} by:2122
Note that T {\displaystyle T} and J {\displaystyle J} have the same eigenvalues.
A transformation that reduces a general matrix to Hessenberg form will reduce a Hermitian matrix to tridiagonal form. So, many eigenvalue algorithms, when applied to a Hermitian matrix, reduce the input Hermitian matrix to (symmetric real) tridiagonal form as a first step.23
A tridiagonal matrix can also be stored more efficiently than a general matrix by using a special storage scheme. For instance, the LAPACK Fortran package stores an unsymmetric tridiagonal matrix of order n in three one-dimensional arrays, one of length n containing the diagonal elements, and two of length n − 1 containing the subdiagonal and superdiagonal elements.
The discretization in space of the one-dimensional diffusion or heat equation
using second order central finite differences results in
with discretization constant Δ x {\displaystyle \Delta x} . The matrix is tridiagonal with a i = − 2 {\displaystyle a_{i}=-2} and b i = c i = 1 {\displaystyle b_{i}=c_{i}=1} . Note: no boundary conditions are used here.
Thomas Muir (1960). A treatise on the theory of determinants. Dover Publications. pp. 516–525. /wiki/Thomas_Muir_(mathematician) ↩
Horn, Roger A.; Johnson, Charles R. (1985). Matrix Analysis. Cambridge University Press. p. 28. ISBN 0521386322. 0521386322 ↩
Horn & Johnson, page 174 ↩
El-Mikkawy, M. E. A. (2004). "On the inverse of a general tridiagonal matrix". Applied Mathematics and Computation. 150 (3): 669–679. doi:10.1016/S0096-3003(03)00298-4. /wiki/Doi_(identifier) ↩
Da Fonseca, C. M. (2007). "On the eigenvalues of some tridiagonal matrices". Journal of Computational and Applied Mathematics. 200: 283–286. doi:10.1016/j.cam.2005.08.047. https://doi.org/10.1016%2Fj.cam.2005.08.047 ↩
Usmani, R. A. (1994). "Inversion of a tridiagonal jacobi matrix". Linear Algebra and Its Applications. 212–213: 413–414. doi:10.1016/0024-3795(94)90414-6. https://doi.org/10.1016%2F0024-3795%2894%2990414-6 ↩
Hu, G. Y.; O'Connell, R. F. (1996). "Analytical inversion of symmetric tridiagonal matrices". Journal of Physics A: Mathematical and General. 29 (7): 1511. Bibcode:1996JPhA...29.1511H. doi:10.1088/0305-4470/29/7/020. /wiki/Bibcode_(identifier) ↩
Huang, Y.; McColl, W. F. (1997). "Analytical inversion of general tridiagonal matrices". Journal of Physics A: Mathematical and General. 30 (22): 7919. Bibcode:1997JPhA...30.7919H. doi:10.1088/0305-4470/30/22/026. /wiki/Bibcode_(identifier) ↩
Mallik, R. K. (2001). "The inverse of a tridiagonal matrix". Linear Algebra and Its Applications. 325 (1–3): 109–139. doi:10.1016/S0024-3795(00)00262-7. https://doi.org/10.1016%2FS0024-3795%2800%2900262-7 ↩
Kılıç, E. (2008). "Explicit formula for the inverse of a tridiagonal matrix by backward continued fractions". Applied Mathematics and Computation. 197: 345–357. doi:10.1016/j.amc.2007.07.046. /wiki/Doi_(identifier) ↩
Raf Vandebril; Marc Van Barel; Nicola Mastronardi (2008). Matrix Computations and Semiseparable Matrices. Volume I: Linear Systems. JHU Press. Theorem 1.38, p. 41. ISBN 978-0-8018-8714-7. 978-0-8018-8714-7 ↩
Meurant, Gerard (1992). "A review on the inverse of symmetric tridiagonal and block tridiagonal matrices". SIAM Journal on Matrix Analysis and Applications. 13 (3): 707–728. doi:10.1137/0613045. https://doi.org/10.1137/0613045 ↩
Bossu, Sebastien (2024). "Tridiagonal and single-pair matrices and the inverse sum of two single-pair matrices". Linear Algebra and Its Applications. 699: 129–158. arXiv:2304.06100. doi:10.1016/j.laa.2024.06.018. https://authors.elsevier.com/a/1jOTP5YnCtZEc ↩
Golub, Gene H.; Van Loan, Charles F. (1996). Matrix Computations (3rd ed.). The Johns Hopkins University Press. ISBN 0-8018-5414-8. 0-8018-5414-8 ↩
Noschese, S.; Pasquini, L.; Reichel, L. (2013). "Tridiagonal Toeplitz matrices: Properties and novel applications". Numerical Linear Algebra with Applications. 20 (2): 302. doi:10.1002/nla.1811. /wiki/Doi_(identifier) ↩
This can also be written as a + 2 b c cos ( k π / ( n + 1 ) ) {\displaystyle a+2{\sqrt {bc}}\cos(k\pi /{(n+1)})} because cos ( x ) = − cos ( π − x ) {\displaystyle \cos(x)=-\cos(\pi -x)} , as is done in: Kulkarni, D.; Schmidt, D.; Tsui, S. K. (1999). "Eigenvalues of tridiagonal pseudo-Toeplitz matrices" (PDF). Linear Algebra and Its Applications. 297 (1–3): 63–80. doi:10.1016/S0024-3795(99)00114-7. https://hal.archives-ouvertes.fr/hal-01461924/file/KST.pdf ↩
Parlett, B.N. (1997) [1980]. The Symmetric Eigenvalue Problem. Classics in applied mathematics. Vol. 20. SIAM. ISBN 0-89871-402-8. OCLC 228147822. 0-89871-402-8 ↩
Coakley, E.S.; Rokhlin, V. (2012). "A fast divide-and-conquer algorithm for computing the spectra of real symmetric tridiagonal matrices". Applied and Computational Harmonic Analysis. 34 (3): 379–414. doi:10.1016/j.acha.2012.06.003. https://doi.org/10.1016%2Fj.acha.2012.06.003 ↩
Dhillon, Inderjit Singh (1997). A New O(n2) Algorithm for the Symmetric Tridiagonal Eigenvalue/Eigenvector Problem (PDF) (PhD). University of California, Berkeley. p. 8. CSD-97-971, ADA637073. http://www.cs.utexas.edu/~inderjit/public_papers/thesis.pdf ↩
Kreer, M. (1994). "Analytic birth-death processes: a Hilbert space approach". Stochastic Processes and Their Applications. 49 (1): 65–74. doi:10.1016/0304-4149(94)90112-0. /wiki/Doi_(identifier) ↩
Meurant, Gérard (October 2008). "Tridiagonal matrices" (PDF) – via Institute for Computational Mathematics, Hong Kong Baptist University. http://www.math.hkbu.edu.hk/ICM/LecturesAndSeminars/08OctMaterials/1/Slide3.pdf ↩
Eidelman, Yuli; Gohberg, Israel; Gemignani, Luca (2007-01-01). "On the fast reduction of a quasiseparable matrix to Hessenberg and tridiagonal forms". Linear Algebra and Its Applications. 420 (1): 86–101. doi:10.1016/j.laa.2006.06.028. ISSN 0024-3795. https://doi.org/10.1016%2Fj.laa.2006.06.028 ↩