When solving a set of linear equations, we try to combine these equations via multiplication or addition to isolate a single variable and its scalar value. This method is similar to the one below known as Gaussian Elimination.
In mathematics, the Gaussian Elimination method is known as the row-reduction algorithm for solving linear equations systems. It consists of a sequence of operations performed on the corresponding matrix of coefficients to achieve 0s on the lower left-hand corner of the matrix as much as possible. The obtained matrix is said to be in its row echelon form where it is upper triangular (bottom left triangle is filled with 0s
To solve the following linear system using Gaussian elimination:
$$ \begin{cases} x-2y+z = 0 \space (L_1)\\ 2x+y-3z=5 \space (L_2)\\ 4x-7y+z=-1 \space (L_3) \end{cases} $$
We can obtain its coefficient matrix $A$ and a column vector $B$ containing its right hand side constants, i.e.
$$ A =\left[ \begin{matrix} 1 & -2 & 1\\ 2 & 1 & -3\\ 4 & -7 & 1\\ \end{matrix} \right], B =\left[ \begin{matrix} 0\\ 5\\ -1\\ \end{matrix} \right] $$
The augmented matrix $(A|B)$ which represents this system is
$$ \left[ \begin{matrix} 1 & -2 & 1\\ 2 & 1 & -3\\ 4 & -7 & 1\\ \end{matrix} \left| \ \begin{matrix} 0\\ 5\\ -1\\ \end{matrix} \right. \right] $$
We now want to transform the coefficient matrix into its row echelon form. We start by eliminating the $x$ variable from all equations below $L_1$ . This is done by taking
$$ L_2 - 2L_1 \rightarrow L_2 \\ L_3 - 4L_1 \rightarrow L_3 $$
such that we get the augmented matrix
$$ \left[ \begin{matrix} 1 & -2 & 1\\ 0 & 5 & -5\\ 0 & 1 & -3\\ \end{matrix} \left| \ \begin{matrix} 0\\ 5\\ -1\\ \end{matrix} \right. \right] $$
We then eliminate the $y$ variable from all equations below $L_2$ . This is done by taking
$$ L_3 - \frac{1}{5}L_2 \rightarrow L_3 \\
$$
such that we get
$$ \left[ \begin{matrix} 1 & -2 & 1\\ 0 & 5 & -5\\ 0 & 0 & -2\\ \end{matrix} \left| \ \begin{matrix} 0\\ 5\\ -2\\ \end{matrix} \right. \right] $$
We have now obtained the coefficient in its row echelon form; it is a upper triangular.
We now have the linear system