2 The general system of three simultaneous linear equations

In the previous subsection we met systems of equations which could be solved by back-substitution alone. In this Section we meet systems which are not so amenable and where preliminary work must be done before back-substitution can be used.

Consider the system

x 1 + 3 x 2 + 5 x 3 = 14 2 x 1 x 2 3 x 3 = 3 4 x 1 + 5 x 2 x 3 = 7

We will use the solution method known as Gauss elimination , which has three stages. In the first stage the equations are written in matrix form. In the second stage the matrix equations are replaced by a system of equations having the same solution but which are in triangular form . In the final stage the new system is solved by back-substitution .

Stage 1 : Matrix Formulation

The first step is to write the equations in matrix form:

1 3 5 2 1 3 4 5 1 x 1 x 2 x 3 = 14 3 7 .

Then, for conciseness, we combine the matrix of coefficients with the column vector of right-hand sides to produce the augmented matrix :

1 3 5 14 2 1 3 3 4 5 1 7

If the general system of equations is written A X = B  then the augmented matrix is written [ A | B ] .

Hence the first equation

x 1 + 3 x 2 + 5 x 3 = 14

is replaced by the first row of the augmented matrix,

1 3 5 | 14 and so on.

Stage 1 has now been completed. We will next triangularise the matrix of coefficients by means of row operations . There are three possible row operations:

interchange two rows;

multiply or divide a row by a non-zero constant factor;

add to, or subtract from, one row a multiple of another row.

Note that interchanging two rows of the augmented matrix is equivalent to interchanging the two corresponding equations. The shorthand notation we use is introduced by example. To interchange row 1 and row 3 we write R 1 R 3 . To divide row 2 by 5 we write R 2 ÷ 5 . To add three times row 1 to row 2, we write R 2 + 3 R 1 . In the Task which follows you will see where these annotations are placed.

Note that these operations neither create nor destroy solutions so that at every step the system of equations has the same solution as the original system.

Stage 2 : Triangularisation

The second stage proceeds by first eliminating x 1 from the second and third equations using row operations.

1 3 5 14 2 1 3 3 4 5 1 7 R 2 2 × R 1 R 3 4 × R 1 1 3 5 14 0 7 13 25 0 7 21 49

In the above we have subtracted twice row (equation) 1 from row (equation) 2.

In full these operations would be written, respectively, as

( 2 x 1 x 2 3 x 3 ) 2 ( x 1 + 3 x 2 + 5 x 3 ) = 3 2 × 14 or 7 x 2 13 x 3 = 25

and

( 4 x 1 + 5 x 2 x 3 ) 4 ( x 1 + 3 x 2 + 5 x 3 ) = 7 4 × 14 or 7 x 2 21 x 3 = 49.

Now since all the elements in rows 2 and 3 are negative we multiply throughout by 1 :

1 3 5 14 0 7 13 25 0 7 21 49 R 2 × ( 1 ) R 3 × ( 1 ) 1 3 5 14 0 7 13 25 0 7 21 49

Finally, we eliminate x 3 from the third equation by subtracting equation 2 from equation 3

i.e. R 3 R 2 :

1 3 5 14 0 7 13 25 0 7 21 49 R 3 R 2 1 3 5 14 0 7 13 25 0 0 8 24

The system is now in triangular form.

Stage 3 : Back Substitution

Here we solve the equations from bottom to top. At each step of the back substitution process we encounter equations which only have a single unknown and so can be easily solved.

Task!

Now complete the solution to the above system by back-substitution.

In full the equations are

x 1 + 3 x 2 + 5 x 3 = 14 7 x 2 + 13 x 3 = 25 8 x 3 = 24

From the last equation we see that x 3 = 3 .

Substituting this value into the second equation gives

7 x 2 + 39 = 25 or 7 x 2 = 14 so that x 2 = 2 .

Finally, using these values for x 2 and x 3 in equation 1 gives x 1 6 + 15 = 14 . Hence x 1 = 5 . The solution is therefore [ x 1 , x 2 , x 3 ] T = [ 5 , 2 , 3 ] T Check that these values satisfy the original system of equations.

Task!

Solve

2 x 1 3 x 2 + 4 x 3 = 2 4 x 1 + x 2 + 2 x 3 = 2 x 1 x 2 + 3 x 3 = 3

Write down the augmented matrix for this system and then interchange rows 1 and 3:

Augmented matrix

2 3 4 2 4 1 2 2 1 1 3 3 R 1 R 3 1 1 3 3 4 1 2 2 2 3 4 2

Now subtract suitable multiples of row 1 from row 2 and from row 3 to eliminate the x 1 coefficient from rows 2 and 3:

1 1 3 3 4 1 2 2 2 3 4 2 R 2 4 R 1 R 3 2 R 1 1 1 3 3 0 5 10 10 0 1 2 4

Now divide row 2 by 5 and add a suitable multiple of the result to row 3:

1 1 3 3 0 5 10 10 0 1 2 4 R 2 ÷ 5 1 1 3 3 0 1 2 2 0 1 2 4 R 3 + R 2 1 1 3 3 0 1 2 2 0 0 4 6

Now complete the solution using back-substitution:

The equations in full are

x 1 x 2 + 3 x 3 = 3 x 2 2 x 3 = 2 4 x 3 = 6 .

The last equation reduces to x 3 = 3 2 .

Using this value in the second equation gives x 2 3 = 2 so that x 2 = 1.

Finally, x 1 1 + 9 2 = 3 so that x 1 = 1 2 .

The solution is therefore [ x 1 , x 2 , x 3 ] T = 1 2 , 1 , 3 2 T .

You should check these values in the original equations to ensure that the equations balance.

Again we emphasise that we chose a particular set of procedures in Stage 1. This was chosen mainly to keep the arithmetic simple by delaying the introduction of fractions. Sometimes we are courageous and take fewer, harder steps.

An important point to note is that when in Stage 2 we wrote R 2 2 R 1 against row 2; what we meant is that row 2 is replaced by the combination (row 2)- 2 × (row 1).

In general, the operation

row i α × row j

means replace row i by the combination

row  i α × row j .