### Learning Objectives

By the end of this section, you will be able to:

- Write the augmented matrix for a system of equations
- Use row operations on a matrix
- Solve systems of equations using matrices

Before you get started, take this readiness quiz.

Solve: $3(x+2)+4=4(2x-1)+9.$

If you missed this problem, review Example 2.2.

Solve: $0.25p+0.25(p+4)=5.20.$

If you missed this problem, review Example 2.13.

Evaluate when $x=\mathrm{-2}$ and $y=3\text{:}\phantom{\rule{0.2em}{0ex}}2{x}^{2}-xy+3{y}^{2}.$

If you missed this problem, review Example 1.21.

### Write the Augmented Matrix for a System of Equations

Solving a system of equations can be a tedious operation where a simple mistake can wreak havoc on finding the solution. An alternative method which uses the basic procedures of elimination but with notation that is simpler is available. The method involves using a matrix. A matrix is a rectangular array of numbers arranged in rows and columns.

### Matrix

A **matrix** is a rectangular array of numbers arranged in rows and columns.

A matrix with *m* rows and *n* columns has order $m\phantom{\rule{0.2em}{0ex}}\times \phantom{\rule{0.2em}{0ex}}n.$ The matrix on the left below has 2 rows and 3 columns and so it has order $2\phantom{\rule{0.2em}{0ex}}\times \phantom{\rule{0.2em}{0ex}}3.$ We say it is a 2 by 3 matrix.

Each number in the matrix is called an element or entry in the matrix.

We will use a matrix to represent a system of linear equations. We write each equation in standard form and the coefficients of the variables and the constant of each equation becomes a row in the matrix. Each column then would be the coefficients of one of the variables in the system or the constants. A vertical line replaces the equal signs. We call the resulting matrix the augmented matrix for the system of equations.

Notice the first column is made up of all the coefficients of *x*, the second column is the all the coefficients of *y*, and the third column is all the constants.

### Example 4.37

Write each system of linear equations as an augmented matrix:

ⓐ $\{\begin{array}{c}5x-3y=\mathrm{-1}\hfill \\ y=2x-2\hfill \end{array}$ ⓑ $\{\begin{array}{c}6x-5y+2z=3\hfill \\ 2x+y-4z=5\hfill \\ 3x-3y+z=\mathrm{-1}\hfill \end{array}$

Write each system of linear equations as an augmented matrix:

ⓐ $\{\begin{array}{c}3x+8y=\mathrm{-3}\hfill \\ 2x=\mathrm{-5}y-3\hfill \end{array}$ ⓑ $\{\begin{array}{c}2x-5y+3z=8\hfill \\ 3x-y+4z=7\hfill \\ x+3y+2z=\mathrm{-3}\hfill \end{array}$

Write each system of linear equations as an augmented matrix:

ⓐ $\{\begin{array}{c}11x=\mathrm{-9}y-5\hfill \\ 7x+5y=\mathrm{-1}\hfill \end{array}$ ⓑ $\{\begin{array}{c}5x-3y+2z=\mathrm{-5}\hfill \\ 2x-y-z=4\hfill \\ 3x-2y+2z=\mathrm{-7}\hfill \end{array}$

It is important as we solve systems of equations using matrices to be able to go back and forth between the system and the matrix. The next example asks us to take the information in the matrix and write the system of equations.

### Example 4.38

Write the system of equations that corresponds to the augmented matrix:

$[\begin{array}{ccccccccc}\hfill 4& & & \hfill \mathrm{-3}& & & \hfill 3& & \\ \hfill 1& & & \hfill 2& & & \hfill \mathrm{-1}& & \\ \hfill \mathrm{-2}& & & \hfill \mathrm{-1}& & & \hfill 3& & \end{array}|\begin{array}{ccc}& & \hfill \mathrm{-1}\\ & & \hfill 2\\ & & \hfill \mathrm{-4}\end{array}].$

Write the system of equations that corresponds to the augmented matrix: $\left[\begin{array}{cccccccccc}1\hfill & & & \hfill \mathrm{-1}& & & \hfill 2& & & \hfill 3\\ 2\hfill & & & \hfill 1& & & \hfill \mathrm{-2}& & & \hfill 1\\ 4\hfill & & & \hfill \mathrm{-1}& & & \hfill 2& & & \hfill 0\end{array}\right].$

Write the system of equations that corresponds to the augmented matrix: $\left[\begin{array}{cccccccccc}1\hfill & & & 1\hfill & & & \hfill 1& & & \hfill 4\\ 2\hfill & & & 3\hfill & & & \hfill \mathrm{-1}& & & \hfill 8\\ 1\hfill & & & 1\hfill & & & \hfill \mathrm{-1}& & & \hfill 3\end{array}\right].$

### Use Row Operations on a Matrix

Once a system of equations is in its augmented matrix form, we will perform operations on the rows that will lead us to the solution.

To solve by elimination, it doesn’t matter which order we place the equations in the system. Similarly, in the matrix we can interchange the rows.

When we solve by elimination, we often multiply one of the equations by a constant. Since each row represents an equation, and we can multiply each side of an equation by a constant, similarly we can multiply each entry in a row by any real number except 0.

In elimination, we often add a multiple of one row to another row. In the matrix we can replace a row with its sum with a multiple of another row.

These actions are called row operations and will help us use the matrix to solve a system of equations.

### Row Operations

In a matrix, the following operations can be performed on any row and the resulting matrix will be equivalent to the original matrix.

- Interchange any two rows.
- Multiply a row by any real number except 0.
- Add a nonzero multiple of one row to another row.

Performing these operations is easy to do but all the arithmetic can result in a mistake. If we use a system to record the row operation in each step, it is much easier to go back and check our work.

We use capital letters with subscripts to represent each row. We then show the operation to the left of the new matrix. To show interchanging a row:

To multiply row 2 by $\mathrm{-3}$:

To multiply row 2 by $\mathrm{-3}$ and add it to row 1:

### Example 4.39

Perform the indicated operations on the augmented matrix:

ⓐ Interchange rows 2 and 3.

ⓑ Multiply row 2 by 5.

ⓒ Multiply row 3 by $\mathrm{-2}$ and add to row 1.

Perform the indicated operations sequentially on the augmented matrix:

ⓐ Interchange rows 1 and 3.

ⓑ Multiply row 3 by 3.

ⓒ Multiply row 3 by 2 and add to row 2.

$[\begin{array}{ccccccccc}\hfill 5& & & \hfill \mathrm{-2}& & & \hfill \mathrm{-2}& & \\ \hfill 4& & & \hfill \mathrm{-1}& & & \hfill \mathrm{-4}& & \\ \hfill \mathrm{-2}& & & \hfill 3& & & \hfill 0& & \end{array}|\begin{array}{ccc}& & \hfill \mathrm{-2}\\ & & \hfill 4\\ & & \hfill \mathrm{-1}\end{array}]$

Perform the indicated operations on the augmented matrix:

ⓐ Interchange rows 1 and 2,

ⓑ Multiply row 1 by 2,

ⓒ Multiply row 2 by 3 and add to row 1.

$[\begin{array}{ccccccccc}2\hfill & & & \hfill \mathrm{-3}& & & \hfill \mathrm{-2}& & \\ 4\hfill & & & \hfill 1& & & \hfill \mathrm{-3}& & \\ 5\hfill & & & \hfill 0& & & \hfill 4& & \end{array}|\begin{array}{ccc}& & \hfill \mathrm{-4}\\ & & \hfill 2\\ & & \hfill \mathrm{-1}\end{array}]$

Now that we have practiced the row operations, we will look at an augmented matrix and figure out what operation we will use to reach a goal. This is exactly what we did when we did elimination. We decided what number to multiply a row by in order that a variable would be eliminated when we added the rows together.

Given this system, what would you do to eliminate *x*?

This next example essentially does the same thing, but to the matrix.

### Example 4.40

Perform the needed row operation that will get the first entry in row 2 to be zero in the augmented matrix: $[\begin{array}{cccccc}1\hfill & & & \hfill \mathrm{-1}& & \\ 4\hfill & & & \hfill \mathrm{-8}& & \end{array}|\begin{array}{ccc}& & \hfill 2\\ & & \hfill 0\end{array}].$

Perform the needed row operation that will get the first entry in row 2 to be zero in the augmented matrix: $[\begin{array}{cccccc}1\hfill & & & \hfill \mathrm{-1}& & \\ 3\hfill & & & \hfill \mathrm{-6}& & \end{array}|\begin{array}{ccc}& & \hfill 2\\ & & \hfill 2\end{array}].$

Perform the needed row operation that will get the first entry in row 2 to be zero in the augmented matrix: $[\begin{array}{cccccc}\hfill 1& & & \hfill \mathrm{-1}& & \\ \hfill \mathrm{-2}& & & \hfill \mathrm{-3}& & \end{array}|\begin{array}{ccc}& & \hfill 3\\ & & \hfill 2\end{array}].$

### Solve Systems of Equations Using Matrices

To solve a system of equations using matrices, we transform the augmented matrix into a matrix in row-echelon form using row operations. For a consistent and independent system of equations, its augmented matrix is in row-echelon form when to the left of the vertical line, each entry on the diagonal is a 1 and all entries below the diagonal are zeros.

### Row-Echelon Form

For a consistent and independent system of equations, its augmented matrix is in **row-echelon form** when to the left of the vertical line, each entry on the diagonal is a 1 and all entries below the diagonal are zeros.

Once we get the augmented matrix into row-echelon form, we can write the equivalent system of equations and read the value of at least one variable. We then substitute this value in another equation to continue to solve for the other variables. This process is illustrated in the next example.

### Example 4.41

#### How to Solve a System of Equations Using a Matrix

Solve the system of equations using a matrix: $\{\begin{array}{c}3x+4y=5\hfill \\ x+2y=1\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}2x+y=7\hfill \\ x-2y=6\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}2x+y=\mathrm{-4}\hfill \\ x-y=\mathrm{-2}\hfill \end{array}.$

The steps are summarized here.

### How To

#### Solve a system of equations using matrices.

- Step 1. Write the augmented matrix for the system of equations.
- Step 2. Using row operations get the entry in row 1, column 1 to be 1.
- Step 3. Using row operations, get zeros in column 1 below the 1.
- Step 4. Using row operations, get the entry in row 2, column 2 to be 1.
- Step 5. Continue the process until the matrix is in row-echelon form.
- Step 6. Write the corresponding system of equations.
- Step 7. Use substitution to find the remaining variables.
- Step 8. Write the solution as an ordered pair or triple.
- Step 9. Check that the solution makes the original equations true.

Here is a visual to show the order for getting the 1’s and 0’s in the proper position for row-echelon form.

We use the same procedure when the system of equations has three equations.

### Example 4.42

Solve the system of equations using a matrix: $\{\begin{array}{c}3x+8y+2z=\mathrm{-5}\hfill \\ 2x+5y-3z=0\hfill \\ x+2y-2z=\mathrm{-1}\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}2x-5y+3z=8\hfill \\ 3x-y+4z=7\hfill \\ x+3y+2z=\mathrm{-3}\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}\hfill \mathrm{-3}x+y+z=\mathrm{-4}\\ \hfill \text{\u2212}x+2y-2z=1\\ 2x-y-z=\mathrm{-1}\hfill \end{array}.$

So far our work with matrices has only been with systems that are consistent and independent, which means they have exactly one solution. Let’s now look at what happens when we use a matrix for a dependent or inconsistent system.

### Example 4.43

Solve the system of equations using a matrix: $\{\begin{array}{c}x+y+3z=0\hfill \\ x+3y+5z=0\hfill \\ 2x+4z=1\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}x-2y+2z=1\hfill \\ \hfill \mathrm{-2}x+y-z=2\\ x-y+z=5\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}3x+4y-3z=\mathrm{-2}\hfill \\ 2x+3y-z=\mathrm{-12}\hfill \\ x+y-2z=6\hfill \end{array}.$

The last system was inconsistent and so had no solutions. The next example is dependent and has infinitely many solutions.

### Example 4.44

Solve the system of equations using a matrix: $\{\begin{array}{c}x-2y+3z=1\hfill \\ x+y-3z=7\hfill \\ 3x-4y+5z=7\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}x+y-z=0\hfill \\ 2x+4y-2z=6\hfill \\ 3x+6y-3z=9\hfill \end{array}.$

Solve the system of equations using a matrix: $\{\begin{array}{c}x-y-z=1\hfill \\ \hfill \text{\u2212}x+2y-3z=\mathrm{-4}\\ 3x-2y-7z=0\hfill \end{array}.$

### Media

Access this online resource for additional instruction and practice with Gaussian Elimination.

### Section 4.5 Exercises

#### Practice Makes Perfect

**Write the Augmented Matrix for a System of Equations**

In the following exercises, write each system of linear equations as an augmented matrix.

ⓐ $\{\begin{array}{c}3x-y=\mathrm{-1}\hfill \\ 2y=2x+5\hfill \end{array}$

ⓑ $\{\begin{array}{c}4x+3y=\mathrm{-2}\hfill \\ x-2y-3z=7\hfill \\ 2x-y+2z=\mathrm{-6}\hfill \end{array}$

ⓐ $\{\begin{array}{c}2x+4y=\mathrm{-5}\hfill \\ 3x-2y=2\hfill \end{array}$

ⓑ $\{\begin{array}{c}3x-2y-z=\mathrm{-2}\hfill \\ \mathrm{-2}x+y=5\hfill \\ 5x+4y+z=\mathrm{-1}\hfill \end{array}$

ⓐ $\{\begin{array}{c}3x-y=\mathrm{-4}\hfill \\ 2x=y+2\hfill \end{array}$

ⓑ $\{\begin{array}{c}x-3y-4z=\mathrm{-2}\hfill \\ 4x+2y+2z=5\hfill \\ 2x-5y+7z=\mathrm{-8}\hfill \end{array}$

ⓐ $\{\begin{array}{c}2x-5y=\mathrm{-3}\hfill \\ 4x=3y-1\hfill \end{array}$

ⓑ $\{\begin{array}{c}4x+3y-2z=\mathrm{-3}\hfill \\ \hfill \mathrm{-2}x+y-3z=4\\ \hfill \text{\u2212}x-4y+5z=\mathrm{-2}\end{array}$

Write the system of equations that corresponds to the augmented matrix.

$[\begin{array}{cccc}2\hfill & & & \hfill \mathrm{-1}\\ 1\hfill & & & \hfill \mathrm{-3}\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill 4\\ \hfill 2\end{array}]$

$[\begin{array}{cccc}2\hfill & & & \hfill \mathrm{-4}\\ 3\hfill & & & \hfill \mathrm{-3}\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill \mathrm{-2}\\ \hfill \mathrm{-1}\end{array}]$

$[\begin{array}{ccccccc}1\hfill & & & \hfill 0& & & \hfill \mathrm{-3}\\ 1\hfill & & & \hfill \mathrm{-2}& & & \hfill 0\\ 0\hfill & & & \hfill \mathrm{-1}& & & \hfill 2\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill \mathrm{-1}\\ \hfill \mathrm{-2}\\ \hfill 3\end{array}]$

$[\begin{array}{ccccccc}2\hfill & & & \hfill \mathrm{-2}& & & \hfill 0\\ 0\hfill & & & \hfill 2& & & \hfill \mathrm{-1}\\ 3\hfill & & & \hfill 0& & & \hfill \mathrm{-1}\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill \mathrm{-1}\\ \hfill 2\\ \hfill \mathrm{-2}\end{array}]$

**Use Row Operations on a Matrix**

In the following exercises, perform the indicated operations on the augmented matrices.

$[\begin{array}{cccc}6\hfill & & & \hfill \mathrm{-4}\\ 3\hfill & & & \hfill \mathrm{-2}\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill 3\\ \hfill 1\end{array}]$

ⓐ Interchange rows 1 and 2

ⓑ Multiply row 2 by 3

ⓒ Multiply row 2 by $\mathrm{-2}$ and add row 1 to it.

$[\begin{array}{cccc}4\hfill & & & \hfill \mathrm{-6}\\ 3\hfill & & & \hfill 2\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill \mathrm{-3}\\ \hfill 1\end{array}]$

ⓐ Interchange rows 1 and 2

ⓑ Multiply row 1 by 4

ⓒ Multiply row 2 by 3 and add row 1 to it.

$[\begin{array}{ccccccc}4\hfill & & & \hfill \mathrm{-12}& & & \hfill \mathrm{-8}\\ 4\hfill & & & \hfill \mathrm{-2}& & & \hfill \mathrm{-3}\\ \mathrm{-6}\hfill & & & \hfill 2& & & \hfill \mathrm{-1}\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill 16\\ \hfill \mathrm{-1}\\ \hfill \mathrm{-1}\end{array}]$

ⓐ Interchange rows 2 and 3

ⓑ Multiply row 1 by 4

ⓒ Multiply row 2 by $\mathrm{-2}$ and add to row 3.

$[\begin{array}{ccccccc}6\hfill & & & \hfill \mathrm{-5}& & & \hfill 2\\ 2\hfill & & & \hfill 1& & & \hfill \mathrm{-4}\\ 3\hfill & & & \hfill \mathrm{-3}& & & \hfill 1\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill 3\\ \hfill 5\\ \hfill \mathrm{-1}\end{array}]$

ⓐ Interchange rows 2 and 3

ⓑ Multiply row 2 by 5

ⓒ Multiply row 3 by $\mathrm{-2}$ and add to row 1.

Perform the needed row operation that will get the first entry in row 2 to be zero in the augmented matrix: $[\begin{array}{cccc}\hfill 1& & & \hfill 2\\ \hfill \mathrm{-3}& & & \hfill \mathrm{-4}\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill 5\\ \hfill \mathrm{-1}\end{array}].$

Perform the needed row operations that will get the first entry in both row 2 and row 3 to be zero in the augmented matrix: $[\begin{array}{ccccccc}1\hfill & & & \hfill \mathrm{-2}& & & \hfill 3\\ 3\hfill & & & \hfill \mathrm{-1}& & & \hfill \mathrm{-2}\\ 2\hfill & & & \hfill \mathrm{-3}& & & \hfill \mathrm{-4}\end{array}\phantom{\rule{0.5em}{0ex}}|\phantom{\rule{0.5em}{0ex}}\begin{array}{c}\hfill \mathrm{-4}\\ \hfill 5\\ \hfill \mathrm{-1}\end{array}].$

**Solve Systems of Equations Using Matrices**

In the following exercises, solve each system of equations using a matrix.

$\{\begin{array}{c}2x+y=2\hfill \\ x-y=\mathrm{-2}\hfill \end{array}$

$\{\begin{array}{c}\hfill \text{\u2212}x+2y=\mathrm{-2}\\ x+y=\mathrm{-4}\hfill \end{array}$

In the following exercises, solve each system of equations using a matrix.

$\{\begin{array}{c}2x-3y+z=19\hfill \\ \hfill \mathrm{-3}x+y-2z=\mathrm{-15}\\ x+y+z=0\hfill \end{array}$

$\{\begin{array}{c}2x-y+3z=\mathrm{-3}\hfill \\ \hfill \text{\u2212}x+2y-z=10\\ x+y+z=5\hfill \end{array}$

$\{\begin{array}{c}2x-6y+z=3\hfill \\ 3x+2y-3z=2\hfill \\ 2x+3y-2z=3\hfill \end{array}$

$\{\begin{array}{c}4x-3y+z=7\hfill \\ 2x-5y-4z=3\hfill \\ 3x-2y-2z=\mathrm{-7}\hfill \end{array}$

$\{\begin{array}{c}x+2z=0\hfill \\ 4y+3z=\mathrm{-2}\hfill \\ 2x-5y=3\hfill \end{array}$

$\{\begin{array}{c}2y+3z=\mathrm{-1}\hfill \\ 5x+3y=\mathrm{-6}\hfill \\ 7x+z=1\hfill \end{array}$

$\{\begin{array}{c}3x-z=\mathrm{-3}\hfill \\ 5y+2z=\mathrm{-6}\hfill \\ 4x+3y=\mathrm{-8}\hfill \end{array}$

$\{\begin{array}{c}2x+3y+z=12\hfill \\ x+y+z=9\hfill \\ 3x+4y+2z=20\hfill \end{array}$

$\{\begin{array}{c}x+2y+6z=5\hfill \\ \hfill \text{\u2212}x+y-2z=3\\ x-4y-2z=1\hfill \end{array}$

$\{\begin{array}{c}x+2y-3z=\mathrm{-1}\hfill \\ x-3y+z=1\hfill \\ 2x-y-2z=2\hfill \end{array}$

$\{\begin{array}{c}4x-3y+2z=0\hfill \\ \hfill \mathrm{-2}x+3y-7z=1\\ 2x-2y+3z=6\hfill \end{array}$

$\{\begin{array}{c}x-y+2z=\mathrm{-4}\hfill \\ 2x+y+3z=2\hfill \\ \hfill \mathrm{-3}x+3y-6z=12\end{array}$

$\{\begin{array}{c}\hfill \text{\u2212}x-3y+2z=14\\ \hfill \text{\u2212}x+2y-3z=\mathrm{-4}\\ 3x+y-2z=6\hfill \end{array}$

$\{\begin{array}{c}x+y-3z=\mathrm{-1}\hfill \\ y-z=0\hfill \\ \hfill \text{\u2212}x+2y=1\end{array}$

$\{\begin{array}{c}x+2y+z=4\hfill \\ x+y-2z=3\hfill \\ \hfill \mathrm{-2}x-3y+z=\mathrm{-7}\end{array}$

#### Writing Exercises

Solve the system of equations $\{\begin{array}{c}x+y=10\hfill \\ x-y=6\hfill \end{array}$ ⓐ by graphing and ⓑ by substitution. ⓒ Which method do you prefer? Why?

Solve the system of equations $\{\begin{array}{c}3x+y=12\hfill \\ x=y-8\hfill \end{array}$ by substitution and explain all your steps in words.

#### Self Check

ⓐ After completing the exercises, use this checklist to evaluate your mastery of the objectives of this section.

ⓑ After looking at the checklist, do you think you are well-prepared for the next section? Why or why not?