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. To download a .zip file containing this book to use offline, simply click here.

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,

$Linear Systems in Upper Triangular Form{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: ${3x−y=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 $3x−y=7$ and the fact that $y=−1$ to find x.

$3x−y=73x−(−1)=73x+1=73x=6x=2$

Answer: $(2,−1)$

### Example 2

Solve: ${x−6y+2z=163y−9z=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 $3y−9z=5$ and the fact that $z=−1$ to find y.

$3y−9z=53y−9(−1)=53y+9=53y=−4y=−43$

Next substitute y and z into the first equation.

$x−6y+2z=16x−6(−43)+2(−1)=16x+8−2=16x+6=16x=10$

Answer: $(10,−43,−1)$

Try this! Solve: ${4x−y+3z=12y−9z=−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.

$Linear System Coefficient Matrix{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,

$Linear System Augmented Matrix{a1x+b1y=c1a2x+b2y=c2 ⇔ [a1b1|c1a2b2|c2]$

And for a linear system with three variables we have

$Linear System Augmented Matrix{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: ${9x−6y=0−x+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.

${9x−6y=0−x+2y=1 ⇔ [9−6|0−12|1]$

### Example 4

Construct the augmented matrix that corresponds to: ${x+2y−4z=52x+y−6z=84x−y−12z=13$.

Solution:

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

${x+2y−4z=52x+y−6z=84x−y−12z=13 ⇔ [12−4 |521−6 |84−1−12 |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,

$Upper Triangular Form [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: ${9x−6y=0−x+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.

${9x−6y=0−x+2y=1 ⇔ [9−6|0−12|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.

$[9−6|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

$[9−6|0012|9] ⇒ {9x−6y=012y=9$

Solve the second equation for y,

$12y=9y=912y=34$

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

$9x−6y=09x−6(34)=09x−92=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+2y−4z=52x+y−6z=84x−y−12z=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+2y−4z=52x+y−6z=84x−y−12z=13 ⇒ [12−4 |521−6 |84−1−12 |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.

$[12−4 |521−6 |84−1−12 |13]⇒×(−2)−2−48−10+21−680−32−2$

Use this to replace the second row.

$[12−4 |50−32 |−24−1−12 |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.

$[12−4 |50−32 |−24−1−12 |13]⇒×(−4)−4−816−20+4−1−12130−94−7$

Use this to replace the third row.

$[12−4 |50−32 |−20−94 |−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.

$[12−4 |50−32 |−200−2 |−1]$

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

$[12−4 |50−32 |−200−2 |−1] ⇒ {x+2y−4z=5−3y+2z=−2−2z=−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: ${2x−9y+3z=−18x−2y−3z=−8−4x+23y+12z=47$.

Solution:

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

${2x−9y+3z=−18x−2y−3z=−8−4x+23y+12z=47 ⇒ [2−93 |−181−2−3 |−8−42312 |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.

$[1−2−3 |−8010 |1001 |13] ⇒ {x−2y−3z=−8y=1z=13$

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

$x−2y−3y=−8x−2(1)−3(13)=−8x−2−1=−8x−3=−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: ${x−3y+2z=164x−11y−z=692x−5y−4z=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: ${x−2y+z=42x−3y+4z=74x−7y+6z=15$.

Solution:

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

${x−2y+z=42x−3y+4z=74x−7y+6z=15 ⇒ [1−21 |42−34 |74−76 |15]$

Replace row two with $−2(row 1)+(row 2)$ and replace row three with $−4(row 1)+(row 3)$.

$[1−21 |4012 |−1012 |−1]$

Replace row three with $−1(row 2)+(row 3)$.

$[1−21 |4012 |−1000 |0]$

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

${x−2y+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=−2z−1$

And from the first equation,

$x−2y+z=4x−2(−2z−1)+z=4x+5z+2=4x=−5z+2$

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

Answer: $(−5z+2,−2z−1,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: ${5x−2y+z=−310x−y+3z=0−15x+9y−2z=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.

### Part A: Back Substitution

Solve using back substitution.

1. ${5x−3y=2y=−1$
2. ${3x+2y=1y=3$
3. ${x−4y=12y=−3$
4. ${x−5y=310y=−6$
5. ${4x−3y=−167y=0$
6. ${3x−5y=−104y=8$
7. ${2x+3y=−13y=2$
8. ${6x−y=−34y=3$
9. ${x−y=02y=0$
10. ${2x+y=23y=0$
11. ${x+3y−4z=1y−3z=−2z=3$
12. ${x−5y+4z=−1y−7z=10z=−2$
13. ${x−6y+8z=23y−4z=−42z=−1$
14. ${2x−y+3z=−92y+6z=−23z=2$
15. ${10x−3y+z=1311y−3z=92z=−6$
16. ${3x−2y+5z=−244y+5z=34z=−12$
17. ${x−y+2z=12y+z=13z=−1$
18. ${x+2y−z=2y−3z=16z=1$
19. ${x−9y+5z=−32y=103z=27$
20. ${4x − z=33y−2z=−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. ${x−2y=12x−y=1$
4. ${x−y=2−x+y=−1$
5. ${−x+8y=32y=2$
6. ${3x−2y=4−y=5$
7. ${3x−2y+7z=84x−5y−10z=6−x−3y+2z=−1$
8. ${x−y−z=02x−y+3z=−1−x+4y−3z=−2$
9. ${x−9y+5z=−32y=103z=27$
10. ${4x−z=33y−2z=−12z=−8$
11. ${8x+2y=−13−2y+z=112x−5z=−18$
12. ${x−3z=2y+6z=42x+3y=12$

Solve using matrices and Gaussian elimination.

1. ${x−5y=22x−y=1$
2. ${x−2y=−1x+y=1$
3. ${10x−7y=15−2x+3y=−3$
4. ${9x−10y=23x+5y=−1$
5. ${3x+5y=82x−3y=18$
6. ${5x−3y=−147x+2y=−1$
7. ${9x+15y=53x+5y=7$
8. ${6x−8y=1−3x+4y=−1$
9. ${x+y=0x−y=0$
10. ${7x−3y=03x−7y=0$
11. ${2x−3y=4−10x+15y=−20$
12. ${6x−10y=20−3x+5y=−10$
13. ${x+y−2z=−1−x+2y−z=1x−y+z=2$
14. ${x−y+z=−2x+2y−z=6−x+y−2z=3$
15. ${2x−y+z=2x−y+z=2−2x+2y−z=−1$
16. ${3x−y+2z=7−x+2y+z=6x+3y−2z=1$
17. ${x−3y+z=6−x−y+2z=42x+y+z=3$
18. ${4x−y+2z=12x−3y+2z=7−2x+3y+4z=−16$
19. ${2x−4y+6z=−43x−2y+5z=−25x−y+2z=1$
20. ${3x+6y+9z=62x−2y+3z=0−3x+18y−12z=5$
21. ${−x+y−z=−23x−2y+5z=13x−5y−z=3$
22. ${x+2y+3z=43x+8y+13z=212x+5y+8z=16$
23. ${2x−4y−5z=3−x+y+z=13x−4y−5z=−4$
24. ${5x−3y−2z=43x−6y+4z=−6−x+2y−z=2$
25. ${−2x−3y+12z=44x−5y−10z=−1−x−3y+2z=0$
26. ${3x−2y+5z=104x+3y−3z=−6x+y+z=2$
27. ${x+2y+z=−3x+6y+3z=7x+4y+2z=2$
28. ${2x−y+z=14x−y+3z=52x+y+3z=7$
29. ${2x+3y−4z=03x−5y+3z=−105x−2y+5z=−4$
30. ${3x−2y+9z=2−2x−5y−4z=35x−3y+3z=15$
31. ${8x+2y=−13−2y+z=112x−5z=−18$
32. ${x−3z=2y+6z=42x+3y=12$
33. ${9x+3y−11z=62x+y−3z=17x+2y−8z=3$
34. ${3x−y−z=4−5x+y+2z=−36x−2y−2z=8$
35. ${2x−4y+3z=153x−5y+2z=185x+2y−6z=0$
36. ${3x−4y−3z=−144x+2y+5z=12−5x+8y−4z=−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. $[1−2 |12−1 |1]$
3. $[−18 |302 |2]$
4. $[3−27 |84−5−10 |6−1−32 |−1]$
5. $[1−95 |−3020 |10003 |27]$
6. $[820 |−130−21 |1120−5 |−18]$
7. $(13,−13)$
8. $(32,0)$
9. (6, −2)

10. Ø

11. (0, 0)

12. $(x,23x−43)$
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