Given is a linear system of the form
\begin{pmatrix}A & B & C & \bigl | &M \\
0 & D & E & \bigl | &N \\
0 & F & G & \bigl | &L
\end{pmatrix}
with the unique solution
\begin{pmatrix} {\color{red}X} \\
{\color{blue}Y} \\ Z \end{pmatrix}
.
Determine the entries
\color{red} X
=
X
\color{blue} Y
=
Y
Z
=
Z
For the row echelon form, we must generate in
\begin{pmatrix}A & B & C & \bigl | &M \\
0 & D & E & \bigl | &N \\
0 & \boxed{F} & G & \bigl | &L
\end{pmatrix}
a \fbox{\text{zero}}
.
This is achieved by replacing the {3rd row} with
negParens(F) \; \cdot
{2. row} - D \; \cdot
{3. row}.
This results in
\begin{pmatrix}A & B & C & \bigl | &M \\
0 & D & E & \bigl | &N \\
0 & \boxed{0} & F*E-D*G & \bigl | &F*N-D*L
\end{pmatrix}
and thus Z = Z
.
The second row
D Y + E Z = N
rearranged D Y = N - E Z
and Z = Z
substituting gives
{\color{blue}Y = Y}
.
Using these two values Z = Z
and {\color{blue} Y = Y}
in the first row
A X + B Y + C Z = M
rearranged A {\color{red}X} = M - B {\color{blue}Y} - C Z
gives eventually
{\color{red}X = X}
.