# Solve the matrices equation AX=B (tridiagonal matrices)

Solve this equation AX=B \begin{align} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 \\ 0 & 1 & 1 & \ddots & 1 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ \vdots & \ddots & \ddots & 1 & 1 \\ 0 & \cdots & \cdots & 0 & 1 \end{bmatrix} \cdot X = \begin{bmatrix} 2 & 1 & 0 & \cdots & 0 \\ 1 & 2 & 1 & \ddots & \vdots \\ 0 & 1 & 2 & \ddots & 0 \\ \vdots & \ddots & \ddots & 2 & 1 \\ 0 & \cdots & 0 & 1 & 2 \end{bmatrix} \end{align} I have never found inverse of a nxn tridiagonal matrix and multiplied them before ($$X = A^{-1}\cdot B$$) Thanks for your help

$$\begin{bmatrix} 1 & 1 & 1 & \cdots & 1 \\ 0 & 1 & 1 & \ddots & 1 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ \vdots & \ddots & \ddots & 1 & 1 \\ 0 & \cdots & \cdots & 0 & 1 \end{bmatrix}^{-1}=\begin{bmatrix} 1 & -1 & 0 & \cdots & 0 \\ 0 & 1 & -1 & \ddots & 0 \\ \vdots & \ddots & \ddots & \ddots & \vdots \\ \vdots & \ddots & \ddots & 1 & -1 \\ 0 & \cdots & \cdots & 0 & 1 \end{bmatrix}$$
• We need to solve $AX=B \implies X=A^{-1}B$. Once we know $A^{-1}$ we can just multiply $A^{-1}B$ with the ordinary rules for matrix multiplication.