
@inreference{noauthor_tridiagonal_2025,
	title = {Tridiagonal matrix algorithm},
	rights = {Creative Commons Attribution-{ShareAlike} License},
	url = {https://en.wikipedia.org/w/index.php?title=Tridiagonal_matrix_algorithm&oldid=1306920126},
	abstract = {In numerical linear algebra, the tridiagonal matrix algorithm, also known as the Thomas algorithm (named after Llewellyn Thomas), is a simplified form of Gaussian elimination that can be used to solve tridiagonal systems of equations. A tridiagonal system for n unknowns may be written as

  
    
      
        
          a
          
            i
          
        
        
          x
          
            i
            −
            1
          
        
        +
        
          b
          
            i
          
        
        
          x
          
            i
          
        
        +
        
          c
          
            i
          
        
        
          x
          
            i
            +
            1
          
        
        =
        
          d
          
            i
          
        
        ,
      
    
    \{{\textbackslash}displaystyle a\_\{i\}x\_\{i-1\}+b\_\{i\}x\_\{i\}+c\_\{i\}x\_\{i+1\}=d\_\{i\},\}
  

where 
  
    
      
        
          a
          
            1
          
        
        =
        0
      
    
    \{{\textbackslash}displaystyle a\_\{1\}=0\}
  
 and 
  
    
      
        
          c
          
            n
          
        
        =
        0
      
    
    \{{\textbackslash}displaystyle c\_\{n\}=0\}
  
.

  
    
      
        
          
            [
            
              
                
                  
                    b
                    
                      1
                    
                  
                
                
                  
                    c
                    
                      1
                    
                  
                
                
                
                
                  0
                
              
              
                
                  
                    a
                    
                      2
                    
                  
                
                
                  
                    b
                    
                      2
                    
                  
                
                
                  
                    c
                    
                      2
                    
                  
                
                
                
              
              
                
                
                  
                    a
                    
                      3
                    
                  
                
                
                  
                    b
                    
                      3
                    
                  
                
                
                  ⋱
                
                
              
              
                
                
                
                  ⋱
                
                
                  ⋱
                
                
                  
                    c
                    
                      n
                      −
                      1
                    
                  
                
              
              
                
                  0
                
                
                
                
                  
                    a
                    
                      n
                    
                  
                
                
                  
                    b
                    
                      n
                    
                  
                
              
            
            ]
          
        
        
          
            [
            
              
                
                  
                    x
                    
                      1
                    
                  
                
              
              
                
                  
                    x
                    
                      2
                    
                  
                
              
              
                
                  
                    x
                    
                      3
                    
                  
                
              
              
                
                  ⋮
                
              
              
                
                  
                    x
                    
                      n
                    
                  
                
              
            
            ]
          
        
        =
        
          
            [
            
              
                
                  
                    d
                    
                      1
                    
                  
                
              
              
                
                  
                    d
                    
                      2
                    
                  
                
              
              
                
                  
                    d
                    
                      3
                    
                  
                
              
              
                
                  ⋮
                
              
              
                
                  
                    d
                    
                      n
                    
                  
                
              
            
            ]
          
        
        .
      
    
    \{{\textbackslash}displaystyle \{{\textbackslash}begin\{bmatrix\}b\_\{1\}\&c\_\{1\}\&\&\&0{\textbackslash}{\textbackslash}a\_\{2\}\&b\_\{2\}\&c\_\{2\}\&\&{\textbackslash}{\textbackslash}\&a\_\{3\}\&b\_\{3\}\&{\textbackslash}ddots \&{\textbackslash}{\textbackslash}\&\&{\textbackslash}ddots \&{\textbackslash}ddots \&c\_\{n-1\}{\textbackslash}{\textbackslash}0\&\&\&a\_\{n\}\&b\_\{n\}{\textbackslash}end\{bmatrix\}\}\{{\textbackslash}begin\{bmatrix\}x\_\{1\}{\textbackslash}{\textbackslash}x\_\{2\}{\textbackslash}{\textbackslash}x\_\{3\}{\textbackslash}{\textbackslash}{\textbackslash}vdots {\textbackslash}{\textbackslash}x\_\{n\}{\textbackslash}end\{bmatrix\}\}=\{{\textbackslash}begin\{bmatrix\}d\_\{1\}{\textbackslash}{\textbackslash}d\_\{2\}{\textbackslash}{\textbackslash}d\_\{3\}{\textbackslash}{\textbackslash}{\textbackslash}vdots {\textbackslash}{\textbackslash}d\_\{n\}{\textbackslash}end\{bmatrix\}\}.\}
  

For such systems, the solution can be obtained in 
  
    
      
        O
        (
        n
        )
      
    
    \{{\textbackslash}displaystyle O(n)\}
  
 operations instead of 
  
    
      
        O
        (
        
          n
          
            3
          
        
        )
      
    
    \{{\textbackslash}displaystyle O(n{\textasciicircum}\{3\})\}
  
 required by Gaussian elimination. A first sweep eliminates the 
  
    
      
        
          a
          
            i
          
        
      
    
    \{{\textbackslash}displaystyle a\_\{i\}\}
  
's, and then an (abbreviated) backward substitution produces the solution. Examples of such matrices commonly arise from the discretization of 1D Poisson equation and natural cubic spline interpolation.
Thomas' algorithm is not stable in general, but is so in several special cases, such as when the matrix is diagonally dominant (either by rows or columns) or symmetric positive definite; for a more precise characterization of stability of Thomas' algorithm, see Higham Theorem 9.12. If stability is required in the general case, Gaussian elimination with partial pivoting ({GEPP}) is recommended instead.},
	booktitle = {Wikipedia},
	urldate = {2025-08-28},
	date = {2025-08-20},
	langid = {english},
	note = {Page Version {ID}: 1306920126},
	file = {Snapshot:/home/lars/Zotero/storage/LJCAC2BT/index.html:text/html},
}
