Let B = \left [ \begin{matrix} 2 & 1 & -1 \\ -4 & 3 & 3 \\ 6 & 8 & -3 \end{matrix} \right ] and \vec{b} = \left [ \begin{matrix} 3 \\ -13 \\ 4 \end{matrix} \right ] . Use an LU-decomposition of B to solve B\vec{x} = \vec{b}.
Let B = \left [ \begin{matrix} 2 & 1 & -1 \\ -4 & 3 & 3 \\ 6 & 8 & -3 \end{matrix} \right ] and \vec{b} = \left [ \begin{matrix} 3 \\ -13 \\ 4 \end{matrix} \right ] . Use an LU-decomposition of B to solve B\vec{x} = \vec{b}.
In Example 3.7.2 we found an LU-decomposition of B. We write B\vec{x} = \vec{b} as LU\vec{x} = \vec{b} and take \vec{y} = U\vec{x}. Writing out the system L\vec{y} = \vec{b}, we get
y_{1} = 3
-2y_{1} + y_{2} = -13
3y_{1} + y_{2} + y_{3} = 4
Using forward-substitution, we find that y_{1} = 3, so y_{2} = -13 + 2(3) = -7 and y_{3} = 4 – 3(3) – (-7) = 2. Hence, \vec{y} = \left [ \begin{matrix} 3 \\ -7 \\ 2 \end{matrix} \right ] .
Thus, our system U\vec{x} = \vec{y} is
2x_{1} + x_{2} – x_{3} = 3
5x_{2} + x_{3} = -7
-x_{3} = 2
Using back-substitution, we get x_{3} = -2, 5x_{2} = -7 – (-2) ⇒ x_{2} = -1 and 2x_{1} = 3 – (-1) + (-2) ⇒ x_{1} = 1. Thus, the solution is \vec{x} = \left [ \begin{matrix} 1 \\ -1 \\ -2 \end{matrix} \right ] .