# How to solve a form of tridiagonal system of equations (with fringes?)

I have read about the Thomas algorithm. Right now, I am trying to use it to solve the following linear system

$$\begin{bmatrix} b_1 & c_1 & 0 & \dots & 0 & a_1\\ a_2 & b_ 2 & c_2 & 0 & \dots & 0\\ 0 & a_3 & b_3 & c_3 & 0 & \dots\\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots\\ c_n & 0 & \dots & 0 & a_n & b_n\end{bmatrix} \begin{bmatrix}x_1\\x_2\\x_3\\ \vdots\\x_n\end{bmatrix} = \begin{bmatrix}r_1\\r_2\\r_3\\ \vdots\\r_n\end{bmatrix}$$ I have not been able to work out an algorithm for this matrix. Can someone point me to some reference that I can read about this? Thank you.

• Does your matrix have any special properties? Is (strictly) diagonally dominant by rows or symmetric positive definite? – Carl Christian May 29 '16 at 20:56
• No. It's pretty much just a tridiagonal system of equations matrix except that the first and last row have an extra element like above. – Kane Billiot May 29 '16 at 20:58
• Can you guarantee that the $a_i$, $b_i$, $c_i$ are not zero? – mvw May 29 '16 at 21:08
• Yes. All three are non-zeroes. – Kane Billiot May 29 '16 at 21:12
• My opinion (maybe I am wrong) is that you have too few zeros (25%) to expect a "miracle" solution compared to standard methods for solving a linear system. – Jean Marie May 29 '16 at 22:06