This is “Matrices and Gaussian Elimination”, section 3.5 from the book Advanced Algebra (v. 1.0). For details on it (including licensing), click here.

For more information on the source of this book, or why it is available for free, please see the project's home page. You can browse or download additional books there. You may also download a PDF copy of this book (41 MB) or just this chapter (4 MB), suitable for printing or most e-readers, or a .zip file containing this book's HTML files (for use in a web browser offline).

Has this book helped you? Consider passing it on:
Creative Commons supports free culture from music to education. Their licenses helped make this book available to you.
DonorsChoose.org helps people like you help teachers fund their classroom projects, from art supplies to books to calculators.

3.5 Matrices and Gaussian Elimination

Learning Objectives

  1. Use back substitution to solve linear systems in upper triangular form.
  2. Convert linear systems to equivalent augmented matrices.
  3. Use matrices and Gaussian elimination to solve linear systems.

Back Substitution

Recall that a linear system of equations consists of a set of two or more linear equations with the same variables. A linear system consisting of three equations in standard form arranged so that the variable x does not appear in any equation after the first and the variable y does not appear in any equation after the second is said to be in upper triangular formA linear system consisting of equations with three variables in standard form arranged so that the variable x does not appear after the first equation and the variable y does not appear after the second equation.. For example,

Notice that the system forms a triangle where each successive equation contains one less variable. In general,

LinearSystemsinUpperTriangularForm{a1x+b1y=c1b2y=c2   {a1x+b1y+c1z=d1b2y+c2z=d2c3z=d3

If a linear system is in this form, we can easily solve for one of the variables and then back substitute to solve for the remaining variables.

Example 1

Solve: {3xy=72y=2.

Solution:

Recall that solutions to linear systems with two variables, if they exist, are ordered pairs (x, y). We can determine the y-value easily using the second equation.

2y=2y=1

Next, use the first equation 3xy=7 and the fact that y=1 to find x.

3xy=73x(1)=73x+1=73x=6x=2

Answer: (2,1)

Example 2

Solve: {x6y+2z=163y9z=5z=1.

Solution:

Recall that solutions to linear systems with three variables, if they exist, are ordered triples (x, y, z). Use the second equation 3y9z=5 and the fact that z=1 to find y.

3y9z=53y9(1)=53y+9=53y=4y=43

Next substitute y and z into the first equation.

x6y+2z=16x6(43)+2(1)=16x+82=16x+6=16x=10

Answer: (10,43,1)

Try this! Solve: {4xy+3z=12y9z=23z=2.

Answer: (14,2,23)

Matrices and Gaussian Elimination

In this section the goal is to develop a technique that streamlines the process of solving linear systems. We begin by defining a matrixA rectangular array of numbers consisting of rows and columns., which is a rectangular array of numbers consisting of rows and columns. Given a linear system in standard form, we create a coefficient matrixThe matrix of coefficients of a linear system in standard form written as they appear lined up without the variables or operations. by writing the coefficients as they appear lined up without the variables or operations as follows.

LinearSystemCoefficientMatrix{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3  [a1b1c1a2b2c2a3b3c3]

The rows represent the coefficients in the equations and the columns represent the coefficients of each variable. Furthermore, if we include a column that represents the constants we obtain what is called an augmented matrixThe coefficient matrix with the column of constants included.. For a linear system with two variables,

LinearSystemAugmentedMatrix{a1x+b1y=c1a2x+b2y=c2  [a1b1|c1a2b2|c2]

And for a linear system with three variables we have

LinearSystemAugmentedMatrix{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3  [a1b1c1|d1a2b2c2|d2a3b3c3|d3]

Note: The dashed vertical line provides visual separation between the coefficient matrix and the column of constants. In other algebra resources that you may encounter, this is sometimes omitted.

Example 3

Construct the augmented matrix that corresponds to: {9x6y=0x+2y=1.

Solution:

This system consists of two linear equations in standard form; therefore, the coefficients in the matrix appear as they do in the system.

{9x6y=0x+2y=1  [96|012|1]

Example 4

Construct the augmented matrix that corresponds to: {x+2y4z=52x+y6z=84xy12z=13.

Solution:

Since the equations are given in standard form, the coefficients appear in the matrix as they do in the system.

{x+2y4z=52x+y6z=84xy12z=13  [124|5216|84112|13]

A matrix is in upper triangular form if all elements below the leading nonzero element in each successive row are zero. For example,

Notice that the elements below the main diagonal are zero and the coefficients above form a triangular shape. In general,

UpperTriangularForm[a1b10b2][a1b1c10b2c200c3]

This is important because in this section we outline a process by which certain operations can be made to produce an equivalent linear system in upper triangular form so that it can be solved by using back substitution. An overview of the process is outlined below:

Once the system is in upper triangular form, we can use back substitution to easily solve it. It is important to note that the augmented matrices presented here represent linear systems of equations in standard form.

The following elementary row operationsOperations that can be performed to obtain equivalent linear systems. result in augmented matrices that represent equivalent linear systems:

  1. Any two rows may be interchanged.
  2. Each element in a row can be multiplied by a nonzero constant.
  3. Any row can be replaced by the sum of that row and a multiple of another.

Note: These operations are consistent with the properties used in the elimination method.

To efficiently solve a system of linear equations first construct an augmented matrix. Then apply the appropriate elementary row operations to obtain an augmented matrix in upper triangular form. In this form, the equivalent linear system can easily be solved using back substitution. This process is called Gaussian eliminationSteps used to obtain an equivalent linear system in upper triangular form so that it can be solved using back substitution., named in honor of Carl Friedrich Gauss (1777–1855).

Figure 3.1

Carl Friedrich Gauss (Wikipedia)

The steps for solving a linear equation with two variables using Gaussian elimination are listed in the following example.

Example 5

Solve using matrices and Gaussian elimination: {9x6y=0x+2y=1.

Solution:

Ensure that the equations in the system are in standard form before beginning this process.

Step 1: Construct the corresponding augmented matrix.

{9x6y=0x+2y=1  [96|012|1]

Step 2: Apply the elementary row operations to obtain upper triangular form. In this case, we need only to eliminate the first element of the second row, −1. To do this, multiply the second row by 9 and add it to the first row.

Now use this to replace the second row.

[96|0012|9]

This results in an augmented matrix in upper triangular form.

Step 3: Convert back to a linear system and solve using back substitution. In this example, we have

[96|0012|9]  {9x6y=012y=9

Solve the second equation for y,

12y=9y=912y=34

Substitute this value for y into the first equation to find x,

9x6y=09x6(34)=09x92=09x=92x=12

Answer: (12,34)

The steps for using Gaussian elimination to solve a linear equation with three variables are listed in the following example.

Example 6

Solve using matrices and Gaussian elimination: {x+2y4z=52x+y6z=84xy12z=13.

Solution:

Ensure that the equations in the system are in standard form before beginning this process.

Step 1: Construct the corresponding augmented matrix.

{x+2y4z=52x+y6z=84xy12z=13  [124|5216|84112|13]

Step 2: Apply the elementary row operations to obtain upper triangular form. We begin by eliminating the first element of the second row, 2 in this case. To do this multiply the first row by −2 and then add it to the second row.

[124|5216|84112|13]×(2)24810+21680322

Use this to replace the second row.

[124|5032|24112|13]

Next, eliminate the first element of the third row, 4 in this case, by multiplying the first row by −4 and adding it to the third row.

[124|5032|24112|13]×(4)481620+4112130947

Use this to replace the third row.

[124|5032|2094|7]

This results in an augmented matrix where the elements below the first element of the first row are zero. Next eliminate the second element in the third row, in this case −9. Multiply the second row by −3 and add it to the third row.

Use this to replace the third row and we can see that we have obtained a matrix in upper triangular form.

[124|5032|2002|1]

Step 3: Convert back to a linear system and solve using back substitution. In this example, we have

[124|5032|2002|1]  {x+2y4z=53y+2z=22z=1

Answer: It is left to the reader to verify that the solution is (5,1,12).

Note: Typically, the work involved in replacing a row by multiplying and adding is done on the side using scratch paper.

Example 7

Solve using matrices and Gaussian elimination: {2x9y+3z=18x2y3z=84x+23y+12z=47.

Solution:

We begin by converting the system to an augmented coefficient matrix.

{2x9y+3z=18x2y3z=84x+23y+12z=47  [293|18123|842312|47]

The elementary row operations are streamlined if the leading nonzero element in a row is 1. For this reason, begin by interchanging row one and two.

Replace row two with the sum of −2 times row one and row two.

Replace row three with the sum of 4 times row one and row three.

Next divide row 3 by 15.

Interchange row three with row two.

Next replace row 3 with the sum of 5 times row two and row three.

This results in a matrix in upper triangular form. A matrix is in row echelon formA matrix in triangular form where the leading nonzero element of each row is 1. if it is in upper triangular form where the leading nonzero element of each row is 1. We can obtain this form by replacing row three with the results of dividing it by 9.

Convert to a system of linear equations and solve by back substitution.

[123|8010|1001|13]  {x2y3z=8y=1z=13

Here y = 1 and z=13. Substitute into the first equation to find x.

x2y3y=8x2(1)3(13)=8x21=8x3=8x=5

Answer: Therefore the solution is (5,1,13).

Technology note: Many modern calculators and computer algebra systems can perform Gaussian elimination. First you will need to find out how to enter a matrix. Then use the calculator’s functions to find row echelon form. You are encouraged to conduct some web research on this topic for your particular calculator model.

Try this! Solve using Gaussian elimination: {x3y+2z=164x11yz=692x5y4z=36.

Answer: (6, −4, −1)

Recall that some consistent linear systems are dependent, that is, they have infinitely many solutions. And some linear systems have no simultaneous solution; they are inconsistent systems.

Example 8

Solve using matrices and Gaussian elimination: {x2y+z=42x3y+4z=74x7y+6z=15.

Solution:

We begin by converting the system to an augmented coefficient matrix.

{x2y+z=42x3y+4z=74x7y+6z=15  [121|4234|7476|15]

Replace row two with 2(row1)+(row2) and replace row three with 4(row1)+(row3).

[121|4012|1012|1]

Replace row three with 1(row2)+(row3).

[121|4012|1000|0]

The last row indicates that this is a dependent system because converting the augmented matrix back to equations we have,

{x2y+z=4y+2z=10x+0y+0z=0

Note that the row of zeros corresponds to the following identity,

0x+0y+0z=00=0

In this case, we can express the infinitely many solutions in terms of z. From the second row we have the following:

y+2z=1y=2z1

And from the first equation,

x2y+z=4x2(2z1)+z=4x+5z+2=4x=5z+2

The solutions take the form (x,y,z)=(5z+2,2z1,z) where z is any real number.

Answer: (5z+2,2z1,z)

Dependent and inconsistent systems can be identified in an augmented coefficient matrix when the coefficients in one row are all zero.

If a row of zeros has a corresponding constant of zero then the matrix represents a dependent system. If the constant is nonzero then the matrix represents an inconsistent system.

Try this! Solve using matrices and Gaussian elimination: {5x2y+z=310xy+3z=015x+9y2z=17.

Answer: Ø

Key Takeaways

  • A linear system in upper triangular form can easily be solved using back substitution.
  • The augmented coefficient matrix and Gaussian elimination can be used to streamline the process of solving linear systems.
  • To solve a system using matrices and Gaussian elimination, first use the coefficients to create an augmented matrix. Apply the elementary row operations as a means to obtain a matrix in upper triangular form. Convert the matrix back to an equivalent linear system and solve it using back substitution.

Topic Exercises

    Part A: Back Substitution

      Solve using back substitution.

    1. {5x3y=2y=1
    2. {3x+2y=1y=3
    3. {x4y=12y=3
    4. {x5y=310y=6
    5. {4x3y=167y=0
    6. {3x5y=104y=8
    7. {2x+3y=13y=2
    8. {6xy=34y=3
    9. {xy=02y=0
    10. {2x+y=23y=0
    11. {x+3y4z=1y3z=2z=3
    12. {x5y+4z=1y7z=10z=2
    13. {x6y+8z=23y4z=42z=1
    14. {2xy+3z=92y+6z=23z=2
    15. {10x3y+z=1311y3z=92z=6
    16. {3x2y+5z=244y+5z=34z=12
    17. {xy+2z=12y+z=13z=1
    18. {x+2yz=2y3z=16z=1
    19. {x9y+5z=32y=103z=27
    20. {4xz=33y2z=12z=8

    Part B: Matrices and Gaussian Elimination

      Construct the corresponding augmented matrix (do not solve).

    1. {x+2y=34x+5y=6
    2. {6x+5y=43x+2y=1
    3. {x2y=12xy=1
    4. {xy=2x+y=1
    5. {x+8y=32y=2
    6. {3x2y=4y=5
    7. {3x2y+7z=84x5y10z=6x3y+2z=1
    8. {xyz=02xy+3z=1x+4y3z=2
    9. {x9y+5z=32y=103z=27
    10. {4xz=33y2z=12z=8
    11. {8x+2y=132y+z=112x5z=18
    12. {x3z=2y+6z=42x+3y=12

      Solve using matrices and Gaussian elimination.

    1. {x5y=22xy=1
    2. {x2y=1x+y=1
    3. {10x7y=152x+3y=3
    4. {9x10y=23x+5y=1
    5. {3x+5y=82x3y=18
    6. {5x3y=147x+2y=1
    7. {9x+15y=53x+5y=7
    8. {6x8y=13x+4y=1
    9. {x+y=0xy=0
    10. {7x3y=03x7y=0
    11. {2x3y=410x+15y=20
    12. {6x10y=203x+5y=10
    13. {x+y2z=1x+2yz=1xy+z=2
    14. {xy+z=2x+2yz=6x+y2z=3
    15. {2xy+z=2xy+z=22x+2yz=1
    16. {3xy+2z=7x+2y+z=6x+3y2z=1
    17. {x3y+z=6xy+2z=42x+y+z=3
    18. {4xy+2z=12x3y+2z=72x+3y+4z=16
    19. {2x4y+6z=43x2y+5z=25xy+2z=1
    20. {3x+6y+9z=62x2y+3z=03x+18y12z=5
    21. {x+yz=23x2y+5z=13x5yz=3
    22. {x+2y+3z=43x+8y+13z=212x+5y+8z=16
    23. {2x4y5z=3x+y+z=13x4y5z=4
    24. {5x3y2z=43x6y+4z=6x+2yz=2
    25. {2x3y+12z=44x5y10z=1x3y+2z=0
    26. {3x2y+5z=104x+3y3z=6x+y+z=2
    27. {x+2y+z=3x+6y+3z=7x+4y+2z=2
    28. {2xy+z=14xy+3z=52x+y+3z=7
    29. {2x+3y4z=03x5y+3z=105x2y+5z=4
    30. {3x2y+9z=22x5y4z=35x3y+3z=15
    31. {8x+2y=132y+z=112x5z=18
    32. {x3z=2y+6z=42x+3y=12
    33. {9x+3y11z=62x+y3z=17x+2y8z=3
    34. {3xyz=45x+y+2z=36x2y2z=8
    35. {2x4y+3z=153x5y+2z=185x+2y6z=0
    36. {3x4y3z=144x+2y+5z=125x+8y4z=3

    Part C: Discussion Board

    1. Research and discuss the history of Gaussian Elimination. Who is credited for first developing this process? Post something that you found interesting relating to this story.

    2. Research and discuss the history of modern matrix notation. Who is credited for the development? In what fields are they used today? Post your findings on the discussion board.

Answers

  1. (15,1)
  2. (5,32)
  3. (−4, 0)

  4. (32,23)
  5. (0, 0)

  6. (−8, 7, 3)

  7. (6,2,12)
  8. (85,0,3)
  9. (73,23,13)
  10. (−3, 5, 9)

  1. [12|345|6]
  2. [12|121|1]
  3. [18|302|2]
  4. [327|84510|6132|1]
  5. [195|3020|10003|27]
  6. [820|13021|11205|18]
  7. (13,13)
  8. (32,0)
  9. (6, −2)

  10. Ø

  11. (0, 0)

  12. (x,23x43)
  13. (2, 3, 3)

  14. (0, 1, 3)

  15. (1, −1, 2)

  16. (12,12,12)
  17. Ø

  18. (−7, −13, 7)

  19. (1,0,12)
  20. (8,12z+52,z)
  21. (1,2,1)

  22. (32,12,0)
  23. Ø

  24. (2, −2, 1)

  1. Answer may vary