We start by considering the following matrix as the augmented matrix of a linear system:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
2 \amp 2 \amp -1 \amp 8 \\
-3 \amp -2 \amp 2 \amp -12 \\
5 \amp 0 \amp 4 \amp 11
\end{array}\right]\text{.}
\end{equation*}
We first scale the first row by \(\frac{1}{2}\) to produce a 1 in the \((1,1)\) entry:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 1 \amp -\frac{1}{2} \amp 4 \\[3pt]
-3 \amp -2 \amp 2 \amp -12 \\
5 \amp 0 \amp 4 \amp 11
\end{array}\right]\text{.}
\end{equation*}
We then replace the second row with the sum of the second row and three times the first row:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 1 \amp -\frac{1}{2} \amp 4 \\[3pt]
0 \amp 1 \amp \frac{1}{2} \amp 0 \\[3pt]
5 \amp 0 \amp 4 \amp 11
\end{array}\right]\text{.}
\end{equation*}
We will again use the 1 in the \((1,1)\) entry to βeliminateβ the 5 in the \((3,1)\) entry. We replace the third row with \(-5\) times the first row plus the third:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 1 \amp -\frac{1}{2} \amp 4 \\[3pt]
0 \amp 1 \amp \frac{1}{2} \amp 0 \\[3pt]
0 \amp -5 \amp \frac{13}{2} \amp -9
\end{array}\right]\text{.}
\end{equation*}
Now that we have βcleared outβ the entries under the \((1,1)\) entry, we can do the same for the 1 in the \((2,2)\) entry. (In future examples we may need to scale first to have a \(1\) here.) We replace the third row with 5 times the second row plus the third:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 1 \amp -\frac{1}{2} \amp 4 \\[3pt]
0 \amp 1 \amp \frac{1}{2} \amp 0 \\[3pt]
0 \amp 0 \amp 9 \amp -9
\end{array}\right]\text{.}
\end{equation*}
We can now scale the third row by \(\frac{1}{9}\) to produce 1s along the main diagonal:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 1 \amp -\frac{1}{2} \amp 4 \\[3pt]
0 \amp 1 \amp \frac{1}{2} \amp 0 \\[3pt]
0 \amp 0 \amp 1 \amp -1
\end{array}\right]\text{.}
\end{equation*}
We are halfway done, as we have 0s below the main diagonal. We now need to use elementary row operations to produce 0s above the main diagonal. We first replace the second row with \(-\frac{1}{2}\) times the third row plus the second:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 1 \amp -\frac{1}{2} \amp 4 \\[3pt]
0 \amp 1 \amp 0 \amp \frac{1}{2} \\[3pt]
0 \amp 0 \amp 1 \amp -1
\end{array}\right]\text{.}
\end{equation*}
We can again use the 1 in the \((3,3)\) position to produce a 0 in the \((1,3)\) position. We replace the first row with \(\frac{1}{2}\) times the third row plus the first:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 1 \amp 0 \amp \frac{7}{2} \\[3pt]
0 \amp 1 \amp 0 \amp \frac{1}{2} \\[3pt]
0 \amp 0 \amp 1 \amp -1
\end{array}\right]\text{.}
\end{equation*}
Finally, we use the 1 in the \((2,2)\) entry to produce a 0 in the \((1,2)\) entry. We replace the first row with \(-1\) times the second row plus the first:
\begin{equation*}
\left[\begin{array}{@{}ccc|c@{}}
1 \amp 0 \amp 0 \amp 3 \\
0 \amp 1 \amp 0 \amp \frac{1}{2} \\[3pt]
0 \amp 0 \amp 1 \amp -1
\end{array}\right]\text{.}
\end{equation*}
We now have the matrix in the form we wanted, because we can read off the solution: \(x=3\text{,}\) \(y=\frac{1}{2}\text{,}\) and \(z=-1\text{.}\)