4.5 solve systems of equations using matrices

13
4.5 Solve Systems of Equations Using Matrices 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 Be Prepared! Before you get started, take this readiness quiz. 1. Solve: 3(x + 2) + 4 = 4(2x − 1) + 9. If you missed this problem, review Example 2.2. 2. Solve: 0.25 p + 0.25(x + 4) = 5.20. If you missed this problem, review Example 2.13. 3. Evaluate when x = −2 and y = 3: 2x 2 xy +3y 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 × n. The matrix on the left below has 2 rows and 3 columns and so it has order 2 × 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: Chapter 4 Systems of Linear Equations 433

Upload: others

Post on 03-Apr-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

4.5 Solve Systems of Equations Using MatricesLearning ObjectivesBy the end of this section, you will be able to:

Write the augmented matrix for a system of equationsUse row operations on a matrixSolve systems of equations using matrices

Be Prepared!

Before you get started, take this readiness quiz.

1. Solve: 3(x + 2) + 4 = 4(2x − 1) + 9.If you missed this problem, review Example 2.2.

2. Solve: 0.25p + 0.25(x + 4) = 5.20.If you missed this problem, review Example 2.13.

3. Evaluate when x = −2 and y = 3: 2x2 − xy + 3y2.If you missed this problem, review Example 1.21.

Write the Augmented Matrix for a System of EquationsSolving 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. Themethod 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 × n. The matrix on the left below has 2 rows and 3 columns and soit has order 2 × 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 thecoefficients of the variables and the constant of each equation becomes a row in the matrix. Each column then would bethe coefficients of one of the variables in the system or the constants. A vertical line replaces the equal signs. We call theresulting 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 thethird column is all the constants.

EXAMPLE 4.37

Write each system of linear equations as an augmented matrix:

Chapter 4 Systems of Linear Equations 433

ⓐ⎧

⎩⎨5x − 3y = −1y = 2x − 2

ⓑ⎧

⎩⎨

6x − 5y + 2z = 32x + y − 4z = 53x − 3y + z = −1

Solution

ⓐ The second equation is not in standard form. We rewrite the second equation in standard form.y = 2x − 2

−2x + y = −2

We replace the second equation with its standard form. In the augmented matrix, the first equation gives us the first rowand the second equation gives us the second row. The vertical line replaces the equal signs.

ⓑ All three equations are in standard form. In the augmented matrix the first equation gives us the first row, the secondequation gives us the second row, and the third equation gives us the third row. The vertical line replaces the equal signs.

TRY IT : : 4.73 Write each system of linear equations as an augmented matrix:

ⓐ⎧

⎩⎨3x + 8y = −32x = −5y − 3

ⓑ⎧

⎩⎨

2x − 5y + 3z = 83x − y + 4z = 7x + 3y + 2z = −3

TRY IT : : 4.74 Write each system of linear equations as an augmented matrix:

ⓐ⎧

⎩⎨11x = −9y − 57x + 5y = −1

ⓑ⎧

⎩⎨

5x − 3y + 2z = −52x − y − z = 43x − 2y + 2z = −7

It is important as we solve systems of equations using matrices to be able to go back and forth between the system andthe 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:

⎣⎢

4 −3 31 2 −1

−2 −1 3 | −12

−4

⎦⎥.

SolutionWe remember that each row corresponds to an equation and that each entry is a coefficient of a variable or the constant.The vertical line replaces the equal sign. Since this matrix is a 4 × 3 , we know it will translate into a system of threeequations with three variables.

434 Chapter 4 Systems of Linear Equations

This OpenStax book is available for free at http://cnx.org/content/col12119/1.3

TRY IT : : 4.75

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

⎣⎢1 −1 2 32 1 −2 14 −1 2 0

⎦⎥.

TRY IT : : 4.76

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

⎣⎢1 1 1 42 3 −1 81 1 −1 3

⎦⎥.

Use Row Operations on a MatrixOnce a system of equations is in its augmented matrix form, we will perform operations on the rows that will lead us tothe solution.

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

When we solve by elimination, we often multiply one of the equations by a constant. Since each row represents anequation, and we can multiply each side of an equation by a constant, similarly we can multiply each entry in a row by anyreal 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 amultiple 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 theoriginal matrix.

1. Interchange any two rows.2. Multiply a row by any real number except 0.3. 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 therow 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. Toshow interchanging a row:

To multiply row 2 by −3 :

To multiply row 2 by −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 −2 and add to row 1.

Chapter 4 Systems of Linear Equations 435

⎣⎢6 −5 22 1 −43 −3 1 | 3

5−1

⎦⎥

Solution

ⓐ We interchange rows 2 and 3.

ⓑ We multiply row 2 by 5.

ⓒ We multiply row 3 by −2 and add to row 1.

TRY IT : : 4.77 Perform the indicated operations on the augmented matrix:

ⓐ Interchange rows 1 and 3.

ⓑ Multiply row 3 by 3.

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

⎣⎢

5 −2 −24 −1 −4

−2 3 0 | −24

−1

⎦⎥

TRY IT : : 4.78 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.

⎣⎢2 −3 −24 1 −35 0 4 | −4

2−1

⎦⎥

Now that we have practiced the row operations, we will look at an augmented matrix and figure out what operation wewill use to reach a goal. This is exactly what we did when we did elimination. We decided what number to multiply a rowby 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.

436 Chapter 4 Systems of Linear Equations

This OpenStax book is available for free at http://cnx.org/content/col12119/1.3

EXAMPLE 4.40

Perform the needed row operation that will get the first entry in row 2 to be zero in the augmented matrix:⎡⎣1 −14 −8 | 2

0⎤⎦.

SolutionTo make the 4 a 0, we could multiply row 1 by −4 and then add it to row 2.

TRY IT : : 4.79

Perform the needed row operation that will get the first entry in row 2 to be zero in the augmented matrix:⎡⎣1 −13 −6 | 2

2⎤⎦.

TRY IT : : 4.80

Perform the needed row operation that will get the first entry in row 2 to be zero in the augmented matrix:⎡⎣

1 −1−2 −3 | 3

2⎤⎦.

Solve Systems of Equations Using MatricesTo solve a system of equations using matrices, we transform the augmented matrix into a matrix in row-echelon formusing row operations. For a consistent and independent system of equations, its augmented matrix is in row-echelonform 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 leftof 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 readthe value of at least one variable. We then substitute this value in another equation to continue to solve for the othervariables. 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:⎧

⎩⎨3x + 4y = 5x + 2y = 1

.

Solution

Chapter 4 Systems of Linear Equations 437

TRY IT : : 4.81Solve the system of equations using a matrix:

⎩⎨2x + y = 7x − 2y = 6

.

TRY IT : : 4.82Solve the system of equations using a matrix:

⎩⎨2x + y = −4x − y = −2

.

The steps are summarized here.

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

HOW TO : : SOLVE A SYSTEM OF EQUATIONS USING MATRICES.

Write the augmented matrix for the system of equations.

Using row operations get the entry in row 1, column 1 to be 1.Using row operations, get zeros in column 1 below the 1.Using row operations, get the entry in row 2, column 2 to be 1.

Continue the process until the matrix is in row-echelon form.

Write the corresponding system of equations.Use substitution to find the remaining variables.Write the solution as an ordered pair or triple.

Check that the solution makes the original equations true.

Step 1.

Step 2.Step 3.Step 4.

Step 5.

Step 6.Step 7.Step 8.

Step 9.

438 Chapter 4 Systems of Linear Equations

This OpenStax book is available for free at http://cnx.org/content/col12119/1.3

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

EXAMPLE 4.42

Solve the system of equations using a matrix:⎧

⎩⎨

3x + 8y + 2z = −52x + 5y − 3z = 0x + 2y − 2z = −1

.

Solution

Write the augmented matrix for the equations.

Interchange row 1 and 3 to get the entry inrow 1, column 1 to be 1.

Using row operations, get zeros in column 1 below the 1.

The entry in row 2, column 2 is now 1.

Continue the process until the matrixis in row-echelon form.

Chapter 4 Systems of Linear Equations 439

The matrix is now in row-echelon form.

Write the corresponding system of equations.

Use substitution to find the remaining variables.

Write the solution as an ordered pair or triple.

Check that the solution makes the original equations true. We leave the check for you.

TRY IT : : 4.83

Solve the system of equations using a matrix:⎧

⎩⎨

2x − 5y + 3z = 83x − y + 4z = 7x + 3y + 2z = −3

.

TRY IT : : 4.84

Solve the system of equations using a matrix:⎧

⎩⎨

−3x + y + z = −4−x + 2y − 2z = 12x − y − z = −1

.

So far our work with matrices has only been with systems that are consistent and independent, which means they haveexactly 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:⎧

⎩⎨

x + y + 3z = 0x + 3y + 5z = 02x + 4z = 1

.

Solution

Write the augmented matrix for the equations.

The entry in row 1, column 1 is 1.

Using row operations, get zeros in column 1 below the 1.

440 Chapter 4 Systems of Linear Equations

This OpenStax book is available for free at http://cnx.org/content/col12119/1.3

Continue the process until the matrix is in row-echelon form.

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

At this point, we have all zeros on the left of row 3.

Write the corresponding system of equations.

Since 0 ≠ 1 we have a false statement. Just as when we solved a system using other methods, this tells uswe have an inconsistent system. There is no solution.

TRY IT : : 4.85

Solve the system of equations using a matrix:⎧

⎩⎨

x − 2y + 2z = 1−2x + y − z = 2x − y + z = 5

.

TRY IT : : 4.86

Solve the system of equations using a matrix:⎧

⎩⎨

3x + 4y − 3z = −22x + 3y − z = −12x + y − 2z = 6

.

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

EXAMPLE 4.44

Solve the system of equations using a matrix:⎧

⎩⎨

x − 2y + 3z = 1x + y − 3z = 73x − 4y + 5z = 7

.

Solution

Write the augmented matrix for the equations.

The entry in row 1, column 1 is 1.

Chapter 4 Systems of Linear Equations 441

Using row operations, get zeros in column 1 below the 1.

Continue the process until the matrix is in row-echelon form.

Multiply row 2 by −2 and add it to row 3.

At this point, we have all zeros in the bottom row.

Write the corresponding system of equations.

Since 0 = 0 we have a true statement. Just as when we solved by substitution, this tells us we have adependent system. There are infinitely many solutions.

Solve for y in terms of z in the second equation.

Solve the first equation for x in terms of z.

Substitute y = 2z + 2.

Simplify.

Simplify.

Simplify.

The system has infinitely many solutions (x, y, z), where x = z + 5; y = 2z + 2; z is any real number.

TRY IT : : 4.87

Solve the system of equations using a matrix:⎧

⎩⎨

x + y − z = 02x + 4y − 2z = 63x + 6y − 3z = 9

.

TRY IT : : 4.88

Solve the system of equations using a matrix:⎧

⎩⎨

x − y − z = 1−x + 2y − 3z = −43x − 2y − 7z = 0

.

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

• Gaussian Elimination (https://openstax.org/l/37GaussElim)

442 Chapter 4 Systems of Linear Equations

This OpenStax book is available for free at http://cnx.org/content/col12119/1.3

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.

196.

ⓐ⎧

⎩⎨3x − y = −12y = 2x + 5

ⓑ⎧

⎩⎨

4x + 3y = −2x − 2y − 3z = 72x − y + 2z = −6

197.

ⓐ⎧

⎩⎨2x + 4y = −53x − 2y = 2

ⓑ⎧

⎩⎨

3x − 2y − z = −2−2x + y = 55x + 4y + z = −1

198.

ⓐ⎧

⎩⎨3x − y = −42x = y + 2

ⓑ⎧

⎩⎨

x − 3y − 4z = −24x + 2y + 2z = 52x − 5y + 7z = −8

199.

ⓐ⎧

⎩⎨2x − 5y = −34x = 3y − 1

ⓑ⎧

⎩⎨

4x + 3y − 2z = −3−2x + y − 3z = 4

−x − 4y + 5z = −2

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

200.⎡⎣2 −11 −3 | 4

2⎤⎦ 201.

⎡⎣2 −43 −3 | −2

−1⎤⎦ 202.

⎣⎢1 0 −31 −2 00 −1 2 | −1

−23

⎦⎥

203.⎡

⎣⎢2 −2 00 2 −13 0 −1 | −1

2−2

⎦⎥

Use Row Operations on a MatrixIn the following exercises, perform the indicated operations on the augmented matrices.

204.⎡⎣6 −43 −2 | 3

1⎤⎦

ⓐ Interchange rows 1 and 2

ⓑ Multiply row 2 by 3

ⓒ Multiply row 2 by −2 and addto row 1.

205.⎡⎣4 −63 2 | −3

1⎤⎦

ⓐ Interchange rows 1 and 2

ⓑ Multiply row 1 by 4

ⓒ Multiply row 2 by 3 and add torow 1.

206.⎡

⎣⎢1 −3 −22 2 −14 −2 −3 | 4

−3−1

⎦⎥

ⓐ Interchange rows 2 and 3

ⓑ Multiply row 1 by 4

ⓒ Multiply row 2 by −2 and addto row 3.

207.⎡

⎣⎢6 −5 22 1 −43 −3 1 | 3

5−1

⎦⎥

ⓐ Interchange rows 2 and 3

ⓑ Multiply row 2 by 5

ⓒ Multiply row 3 by −2 and addto row 1.

208. Perform the needed rowoperation that will get the firstentry in row 2 to be zero in theaugmented matrix:⎡⎣

1 2−3 −4 | 5

−1⎤⎦.

209. Perform the needed rowoperations that will get the firstentry in both row 2 and row 3 tobe zero in the augmented matrix:⎡

⎣⎢1 −2 33 −1 −22 −3 −4 | −4

5−1

⎦⎥.

4.5 EXERCISES

Chapter 4 Systems of Linear Equations 443

Solve Systems of Equations Using Matrices

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

210.⎧

⎩⎨2x + y = 2x − y = −2

211.⎧

⎩⎨3x + y = 2x − y = 2

212.⎧

⎩⎨−x + 2y = −2x + y = −4

213.⎧

⎩⎨−2x + 3y = 3x + 3y = 12

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

214.⎧

⎩⎨

2x − 3y + z = 19−3x + y − 2z = −15x + y + z = 0

215.⎧

⎩⎨

2x − y + 3z = −3−x + 2y − z = 10x + y + z = 5

216.⎧

⎩⎨

2x − 6y + z = 33x + 2y − 3z = 22x + 3y − 2z = 3

217.⎧

⎩⎨

4x − 3y + z = 72x − 5y − 4z = 33x − 2y − 2z = −7

218.⎧

⎩⎨

x + 2z = 04y + 3z = −22x − 5y = 3

219.⎧

⎩⎨

2x + 5y = 43y − z = 34x + 3z = −3

220.⎧

⎩⎨

2y + 3z = −15x + 3y = −67x + z = 1

221.⎧

⎩⎨

3x − z = −35y + 2z = −64x + 3y = −8

222.⎧

⎩⎨

2x + 3y + z = 12x + y + z = 93x + 4y + 2z = 20

223.⎧

⎩⎨

x + 2y + 6z = 5−x + y − 2z = 3x − 4y − 2z = 1

224.⎧

⎩⎨

x + 2y − 3z = −1x − 3y + z = 12x − y − 2z = 2

225.⎧

⎩⎨

4x − 3y + 2z = 0−2x + 3y − 7z = 12x − 2y + 3z = 6

226.⎧

⎩⎨

x − y + 2z = −42x + y + 3z = 2−3x + 3y − 6z = 12

227.⎧

⎩⎨

−x − 3y + 2z = 14−x + 2y − 3z = −43x + y − 2z = 6

228.⎧

⎩⎨

x + y − 3z = −1y − z = 0

−x + 2y = 1

229.⎧

⎩⎨

x + 2y + z = 4x + y − 2z = 3−2x − 3y + z = −7

Writing Exercises

230. Solve the system of equations⎧

⎩⎨x + y = 10x − y = 6

ⓐ by

graphing and ⓑ by substitution. ⓒ Which method doyou prefer? Why?

231. Solve the system of equations⎧

⎩⎨3x + y = 12x = y − 8

by

substitution and explain all your steps in words.

444 Chapter 4 Systems of Linear Equations

This OpenStax book is available for free at http://cnx.org/content/col12119/1.3

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?

Chapter 4 Systems of Linear Equations 445