Currently, I am working on solving a PDE using the finite element method (FEM) and facing the problem of finding the inverse of the following Toeplitz tridiagonal matrix
$$\mathbf{M} = \begin{pmatrix} a & b & & & & & 0 \\ b & a & b & & & & \\ & b & a & b & & & \\ & & b & a & & & \\ & & & & \ddots & & \\ & & & & & a & b \\ 0 & & & & & b & a \\ \end{pmatrix}$$
Basically, this matrix has diagonal elements are all $a \in \mathbb{R}$ and every elements adjacent to the diagonal elements are $b \in \mathbb{R}$, the rest are all zeros.
I tried using Newton's method (the inverse matrix of $\mathbf{M}$ is determined by the limit of $\mathbf{X}_n$ where $n$ to infinity of the sequence $\mathbf{X}_{n+1} = \mathbf{X}_n(2\mathbf{I} - \mathbf{M}\mathbf{X}_n)$) but this method is not very good with large matrix (or perhaps my coding skill is terrible). So I was wondering is there another method to find the inversion of this type of matrix?
For more detail about FEM (on 1D case), you can visit here
Edit: Fixed $u|{\partial\Omega} = g$ to $u|{\partial\Omega} = 0$
– Bakkune Mar 13 '22 at 11:55