1 2 1 5
2 - 1 2 15
3 1 – 1 8
The diagonal field of the 1st line is already 1.
With the 1st row, all other rows in the 1st column are set to 0.
To the 2nd row the -2-fold of the 1st row is added:
1 2 1 5
0 - 5 0 5
3 1 - 1 8
The -3-fold of the 1st line is added to the 3rd line:
1 2 1 5
0 - 5 0 5
0 - 5 - 4 - 7
By dividing the 2nd line by -5 the diagonal element is made to 1:
1 2 1 5
0 1 0 - 1
0 - 5 - 4 - 7
With the 2nd row, all other rows in the 2nd column are set to 0.
The 2nd line is added to the 1st line by a factor of -2:
1 0 1 7
0 1 0 - 1
0 - 5 - 4 - 7
The 5-fold of the 2nd line is added to the 3rd line:
1 0 1 7
0 1 0 - 1
0 0 - 4 - 12
By dividing the 3rd line by -4 the diagonal element is made to 1:
1 0 1 7
0 1 0 - 1
0 0 1 3
With the 3rd row, all other rows in the 3rd column are set to 0.
To the 1st line the -1x of the 3rd line is added:
1 0 0 4
0 1 0 - 1
0 0 1 3
The last column contains the solutions.