3.4 Solving Matrix Equations with Inverses Question 1: How do you write a system of equations as a matrix equation? Question 2: How do you solve a matrix equation using the matrix inverse? Multiplicative inverses are useful for solving simple algebraic equations. For instance, the equation 2 x 6 may be solved by multiplying both sides of the equation by the multiplicative inverse of 2. When we do this, we get 1 2 2 x 12 6 . Since 1 2 2 1 , the solution of the equation is x 3 . In this section, we’ll learn how to write a system of linear equations as a matrix equation AX B . This matrix equation is solved by multiplying both sides by an inverse matrix. This allows us to solve systems of equations with a strategy different from the matrix methods we used in Chapter 2. 1 Question 1: How do you write a system of equations as a matrix equation? In section 3.2, you learned how to multiply two matrices. This process involved multiplying the entries in the row of one matrix by the columns of another matrix and then adding those products. For instance, suppose we multiply 1 2 5 3 4 6 Since we are multiplying a 2 x 2 matrix by a 2 x 1 matrix, the product is a 2 x 1 matrix. Working out the product, we get 1 2 5 1 5 2 6 3 4 6 3 5 4 6 When the product is written this way, we can easily identify the product of the numbers in the rows of the first matrix with the numbers in the second matrix as well as the sum. Instead of multiplying the first matrix by a constant column matrix, let’s try multiplying by a matrix containing two variables x and y, x y When we carry out the multiplication now, we get 1 2 x 1x 2 y 3 4 y 3 x 4 y The entries in the product look a lot like the part of a system of equations. In fact, if we set this equal to a 2 x 1 matrix with constants, 1 2 x 17 3 4 y 39 we can write the matrix equation as an equivalent system of equations. These matrices are equal when the corresponding entries are equal or when 2 1x 2 y 17 3 x 4 y 39 In other words, 1x 2 y 17 1 2 x 17 3 4 y 39 is the same as 3 x 4 y 39 When a system of equations is written in terms of matrices, we call it a matrix equation. In this matrix equation, the three matrices are typically called A, X and B. 1 2 x 17 3 4 y 39 A X B The matrix A is called the coefficient matrix and it entries are the coefficients on the variables when they are written in the same order in each equation. The matrix X is called the variable matrix and contains the two variables in the problem. The matrix B is called the constant matrix and contains the constants from the right hand side of the matrix equation. To match the different matrices with their entries, each equation must have the variables on the left side with the variable terms listed in the same order. The constants must be on the right side. Once each equation has this format, we can read the entries in each matrix. Example 1 Write a Linear System as a Matrix Equation Write the system of linear equations x y 5 3x 4 y 1 as the matrix equation AX B . 3 Solution The system is in the proper format to determine the coefficient matrix and the constant matrix. The variable matrix for this system is x X y Using the coefficients on the variables, define the coefficient matrix and constant matrix as 1 1 A 3 4 5 B 1 With these definitions, the product AX is equal to 1 1 x x y AX 3 4 y 3 x 4 y When this matrix is set equal to the constant matrix B, we get x y 5 3 x 4 y 1 These matrices are equal when x y 5 and 3 x 4 y 1 . This means the matrix equation AX B is equivalent to the original system of equations. We can use the same strategy to write larger systems of equations as matrix equations. This leads to larger matrices. We incorporate different variable names into the variable matrix X as shown in the next example. 4 Example 2 Write a Linear System as a Matrix Equation Write the system of linear equations x1 x2 x3 2 2 x1 2 x2 3x3 1 2 x3 7 x1 as a matrix equation AX B . Solution Before we can define the matrices, we need to put each equation in the proper format. In the first and second equations, all variable terms are on one side of the equation and the constant terms are on the other side of the equations. In the third equation, there are variable terms on both sides of the equation. We can put the third equation in the proper format by subtracting x1 from both sides of the equation, 2 x3 x1 7 x1 x1 x1 2 x3 7 This leads to the system x1 x2 x3 2 2 x1 2 x2 3 x3 1 x1 2 x3 7 The variable matrix is x1 X x2 x3 The coefficients on the variables give the coefficient matrix, 5 1 1 1 A 2 2 3 1 0 2 Note that any signs are included in the coefficients and variables that are missing correspond to a coefficient of zero. The constant matrix, 2 B 1 7 matches the constants on the right hand of the system. We can check to see that the matrix equation AX B is equivalent to the system by carrying out the product AX : 1 1 1 x1 x1 x2 x3 AX 2 2 3 x2 2 x1 2 x2 3 x3 1 0 2 x3 x1 2 x3 If we set this matrix equal to B, x1 x2 x3 2 2 x 2 x 3 x 1 2 3 1 x1 2 x3 7 the corresponding entries must be equal. This is equivalent to the original system after it had been modified to put it into the proper format. 6 Once a system of linear equations is written as a matrix equation AX B , we can use the inverse of the matrix A to find the solution to the system. In the next question, we’ll learn how to do this and use it to solve an application. 7 Question 2: How do you solve a matrix equation using the matrix inverse? In the previous question, we wrote systems of equations as a matrix equation AX B . In this format, the matrix A contains the coefficients on the variables, matrix X contains the variables, and matrix B contains the constants. Solving the system of equations means that we need to solve for the variable matrix X. This is accomplished by multiplying both sides of the matrix equation by the inverse of the coefficient matrix, A1 . A1 A X A1 B The product of a matrix A and its inverse is the identity matrix I. This means we can simplify the matrix equation to IX A1 B The product of an identity matrix with X is simply X, so the solution to the matrix equation is X A 1 B How To Solve a System of Linear Equations with Inverses 1. Make sure the system is in proper format with variable terms on the left side of the equation and constants on the right side. The variable terms should be listed in the same order in each equation. Identify the coefficient matrix A, the variable matrix X, and the constant matrix B. 3. Compute the inverse A1 . If the matrix is not invertible, it is not possible to solve the system with inverses. 4. Compute the product A1 B . 8 5. The solution to the matrix equation AX B is X A1 B . The corresponding solution for the system of linear equations is found by matching the variables in X with the corresponding entries in the product A1 B . Example 3 Solve a Linear System with the Inverse Solve the system of linear equations using the inverse of the coefficient matrix. x y 5 3x 4 y 1 Solution In 0, we wrote this system as the matrix equation AX B , where 1 1 A , 3 4 x 5 X , and B y 1 In section 3.3, we found the inverse of A, 4 1 A1 3 1 We can use the inverse to compute the solution to the system. The solution is found by multiplying the inverse of A times the constant matrix B, 9 X A1 B 4 1 5 3 1 1 Insert the matrices. The product of a 2 x 2 matrix and a 2 x 1 matrix is a 2 x 1 matrix 4 5 11 3 5 1 1 Multiply the row entries in the inverse times the corresponding column entries in B 21 16 Since the individual entries in X correspond to the variables x and y, this tells us that x 21 and y 16 . We can check these values in the original system to make sure they solve the system: 21 Example 4 16 5 TRUE 3 21 4 16 1 TRUE Solve a Linear System with the Inverse Solve the system of linear equations with the inverse of the coefficient matrix. x1 x2 x3 2 2 x1 2 x2 3 x3 1 x1 2 x3 7 Solution This system of equations is equivalent to the matrix equation AX B where 1 1 1 A 2 2 3 , 1 0 2 x 2 X y , and B 1 z 7 10 The variable matrix may be solved for using the inverse of the coefficient matrix, X A1 B . We found the inverse of this coefficient matrix in Example 5 of section 3.3. X A1 B 4 2 1 2 1 1 1 1 2 1 0 7 A1 was computed in Example 5 of section 3.3 4 2 2 1 1 7 1 2 1 1 1 7 2 2 1 1 0 7 Multiply the entries in the rows of A the entries in the column of B 1 by 3 4 5 Equating the entries in the variable matrix with the entries in this product, we observe that x 3 , y 4 , and z 5 . For systems of linear equations with unique solutions, we can use inverses to solve for the variables. Many of the applications in Chapter 2 may be solved using this strategy. Example 5 Mixing Ethanol Blends In Example 12 of section 2.2 we created a system of equations to describe a mix of E10 and E85 ethanol, E10 E85 10 0.10 E10 0.85 E85 2 where E10 is the amount of 10% ethanol pumped in gallons and E85 is the amount of 85% ethanol pumped in gallons. The first equation describes the total amount in the mixture, 10 gallons. The second 11 equation describes the total amount of ethanol in the mixture, 20% of 10 gallons or 2 gallons. a. Solve this system of equations by finding the inverse of the coefficient matrix. Solution This system of equations was solved in Chapter 2 using the Substitution Method. In this section we’ll solve the same system by writing the system as a matrix equation. We can write this system of equations as the matrix equation AX B by identifying the matrices, 1 1 A , 0.10 0.85 E10 10 X , and B E85 2 The solution to the matrix equation is X A1 B and requires the inverse of the matrix A. We begin the process of finding the inverse of A by placing the coefficient matrix in a new matrix alongside a 2 x 2 identity matrix. 1 1 0 1 0.10 0.85 0 1 Since the entry in the first row, first column is already a 1, we’ll make the rest of the column into zeros using row operations. To do this, multiply the first row by -0.10 and add it to the second row. Place the sum in the second row: 0.10 R1 : R2 : 0.10 0.10 0.10 0 0.10 0.85 0 1 0 0.75 0.10 1 0.10 R1 R2 becomes R2 1 1 0 1 0 0.75 0.10 1 12 With the first column transformed, proceed to the second column and use row operations to create a 1 in the second row, second column. We put a 1 in the second row, second column by multiplying the second row by 1 3 4 . Since 0.75 , this is the same as multiplying by : 4 0.75 3 0 0.75 .10 1 1 0.75 0 1 2 15 1 0.75 R2 becomes R2 4 3 1 1 1 0 1 2 15 0 4 3 Now multiply the second row by -1 and add it to the first row. Place the result in the first row: 1R2 : R1 : 0 1 2 15 1 1 1 1 0 17 15 4 3 0 4 3 1R2 R1 becomes R1 17 4 1 0 15 3 4 0 1 2 15 3 4 17 15 3 The inverse matrix is the right hand side of this matrix, A1 4 2 15 3 The solution to the original system of equations is 13 X 17 15 2 15 A1 B 4 3 10 4 2 3 Multiply the entries in the rows of A the entries in the column of B 17 4 15 10 3 2 2 4 15 10 3 2 1 by Combine the terms in each entry and simplify all fractions 26 3 4 3 E10 Since the variable matrix X represents , this means that the E85 amount of E10 needed is 26 gallons and the amount of E85 needed is 3 4 gallons. 3 b. If the number of gallons in the mixture should be 12 gallons, how much 10% ethanol and 85% ethanol must be pumped? Solution If the total number of gallons in the mixture is increased to 12 gallons, the total amount of ethanol in the mixture is .20 12 or 2.4 gallons. The system of equations becomes E10 E85 12 0.10 E10 0.85 E85 2.4 The only change to the system of equations is in the constants, not the coefficients. 14 This means that we may use the existing coefficient matrix A and the corresponding inverse A 1 to find the solution of this system, E10 E85 12 0.10 E10 0.85 E85 2.4 The constant matrix for this system is 12 B 2.4 and the solution is X A1 B 4 17 15 3 12 4 2.4 2 15 3 17 4 15 12 3 2.4 2 4 15 12 3 2.4 52 5 8 5 Use the same inverse as in part a Multiply the entries in the rows of A by the entries in the column of B 1 Combine the terms in each entry and simplify all fractions Since the coefficients in the system have not changed, there is no need to recompute the inverse. We may use the inverse from part a to calculate the product. We must mix 52 8 gallons of E10 and gallons of 5 5 E85. 15 This example illustrated the power of using inverses to solve a system of linear equations. As long as the coefficient matrix does not change, the same inverse may be used to solve several different problems with different constant matrices. The solutions are simply the product of the inverse of the coefficient matrices and the different 10 constants. For part a, the constant was B and for part b the constant was 2 12 B . There was no need to recomputed the inverse for the different parts. 2.4 16