Example of Gaussian Reduction

Initial set of equations in matrix form

  [ 3   4   5 ] [X1]   [  27 ]
  [ 6  12  13 ] [X2] = [  68 ]
  [ 9  20  22 ] [X3]   [ 111 ]

Usually, we abbreviate the system by leaving out the X vector

  [ 3   4   5 ]  [  27 ]
  [ 6  12  13 ]  [  68 ]
  [ 9  20  22 ]  [ 111 ]

Step 1: subtract twice the first row from the second, and three times the first row from the third. This produces 0s in the first column under the 3 entry, which is referred to as the pivot. Note that the column of constants is manipulated in the same way as the matrix columns.

  [ 3   4   5 ]  [  27 ]
  [ 0   4   3 ]  [  14 ]
  [ 0   8   7 ]  [  30 ]

Step 2: Subtract twice the second row from the third to produce a zero in the second column under the 4. The matrix now has all 0s below the main diagonal. This is referred to as upper triangular form, sometimes denoted simply as U.

  [ 3   4   5 ]  [  27 ]
  [ 0   4   3 ]  [  14 ]
  [ 0   0   1 ]  [   2 ]

Step 3: The upper triangular form allows us to find the values of the variables by progressive back substitution.

The last row represents the equation 1 * X3 = 2, from which we obtain X3 = 2 directly.

The second row represents the equation
4 * X2 + 3 * X3 = 14.
Using X3 = 2, we obtain
4 * X2 + 6 = 14 ⇒ 4 * X2 = 8 ⇒ X2 = 2.

The first row represents the equation
3 * X1 + 4 * X2 + 5 * X3 = 27.
Substituting in the previously obtained values for X2 and X3 gives
3 * X1 + 4 * 2 + 5 * 2 = 27 ⇒ 3 * X1 = 9 ⇒ X1 = 3.

This completes the solution of the system, which can be checked by substituting the values obtained back into the original system.