= Solution
Solve two triangular <linear systems>, rather than forming an <inverse matrix>:
$$
\boxed{Ly=b\quad\text{by forward substitution},\qquad Ux=y\quad\text{by back substitution}.}
$$
For this <LU decomposition>, <forward substitution> gives $y_1=b_1$, $y_2=b_2+2y_1$ and $y_3=b_3-3y_1+y_2$. Then <back substitution> gives
$$
x_3=-y_3,\qquad x_2=\frac{y_2-2x_3}{4},\qquad x_1=y_1-4x_2-x_3.
$$
All diagonal entries used as divisors are nonzero. The same <LU decomposition> can be reused for many right-hand <vectors>, with only these two triangular solves repeated.
Back to article page