An algorithm for solving a special class of tridiagonal systems of linear equations

An algorithm is presented for solving a system of linear equations <italic>Bu</italic> = <italic>k</italic> where <italic>B</italic> is tridiagonal and of a special form. This form arises when discretizing the equation - d/d<italic>x</italic> (<italic>p</italic>(<italic>x</italic>) <italic>du</italic>/<italic>dx</italic>) = <italic>k</italic>(<italic>x</italic>) (with appropriate boundary conditions) using central differences. It is shown that this algorithm is almost twice as fast as the Gaussian elimination method usually suggested for solving such systems. In addition, explicit formulas for the inverse and determinant of the matrix <italic>B</italic> are given.