Book Title: eTextbook: Finite Mathematics and Applied Calculus 4.2. Using Matrices to Solve Systems of Equations 4.2. Using Matrices to Solve Systems of Equations The Augmented Matrix of a System of Linear Equations In this section we describe a systematic method for solving systems of equations that makes solving large systems of equations in any number of unknowns straightforward. Although this method may seem a little cumbersome at first, it will prove immensely useful in this and the next several chapters. First, we introduce some terminology. Linear Equation A linear equation in the n variables x a1x1 + ⋯ + anxn = b The numbers a , a2, … , an 1 1, x2, … , xn has the form (a1, a2, … , an, b constants) are called the coefficients, and the number b is called the constant term, or right-hand side. 275 Quick Examples 1. 3x − 5y = 0 2. x + 2y − z = 6 4. 30x1 + 18x2 + x3 + x4 = 19 Linear equation in x and y Coef f icients: 3, −5; co Linear equation in x, y, z Coef f icients: 1, 2, −1; Linear equation in x1, x2, x3, x4 Coe NOTE When the number of variables is small, we will almost always use x, y, z, … (as in Quick Examples 1 and 2) rather than x 1, x2, x3, … as the names of the variables. Notice that a linear equation in any number of unknowns (for example, 2x − y = 3 ) is entirely determined by its coefficients and its constant term. In other words, if we were simply given the row of numbers [2 − 1 3], we could easily reconstruct the original linear equation by multiplying the first number by x , multiplying the second by y , and inserting a plus sign and an equals sign, as follows: 2 ⋅ x + (−1) ⋅ y = 3 or 2x − y = 3. Similarly, the equation −4x + 2y = 0 is represented by the row [−4 2 0], and the equation 1 −3y = 4 is represented by the row 1 [0 − 3 ]. 4 As the last example shows, the first number is always the coefficient of x , and the second is the coefficient of y . If an x or a y is missing, we write a zero for its coefficient. We shall call such a row the coefficient row of an equation. If we have a system of equations, for example, the system 2x − y = 3 −x + 2y = −4, we can put the coefficient rows together like this: 2 −1 3 [ ]. −1 276 2 −4 We call this the augmented matrix of the system of equations. The term “augmented” means that we have included the right-hand sides 3 and −4 . We will often drop the word “augmented” and simply refer to the matrix of the system. A matrix (plural: matrices) is nothing more than a rectangular array of numbers, as above. Matrix, Augmented Matrix A matrix is a rectangular array of numbers. The augmented matrix of a system of linear equations is the matrix whose rows are the coefficient rows of the equations. Quick Example 4. The augmented matrix of the system x + y = 3 x − y = 1 1 1 3 is [ ] . 1 −1 1 We’ll be studying matrices in more detail in Chapter 4. Q: What good are coefficient rows and matrices? A: Think about what we do when we multiply both sides of an equation by a number. For example, consider multiplying both sides of the equation 2x − y = 3 by −2 to get −4x + 2y = −6 . All we are really doing is multiplying the coefficients and the right-hand side by −2 . This corresponds to multiplying the row [2 − 13] by −2 , that is, multiplying every number in the row by −2 . We shall see that any manipulation we want to do with equations can be done instead with rows. This fact leads to a method of solving equations that is systematic and generalizes easily to larger systems. Here is the same operation in both the language of equations and the language of rows. (We refer to the equation here as Equation 1, or simply E for short, 1 and to the row as Row 1, or R .) 1 Equation Multiply by −2 E1: 2x − Row y = 3 [2 −1 3] R1 : (−2)E1: −4x + 2y = −6 [−4 2 −6] (−2)R1 Multiplying both sides of an equation by the number a corresponds to multiplying the coefficient row by a . Now look at what we do when we add two equations. Equation Add: E1: E2: E1 + E2: 2x − y = 3 −x + 2y = −4 x + y = −1 Row [ 2 − 1 3] R1 [−1 2 − 4] [ 1 − 1] R1 + R2 1 R2 All we are really doing is adding the corresponding entries in the rows, or adding the rows. In other words, Adding two equations corresponds to adding their coefficient rows. 277 In short, the manipulations of equations that we saw in Section 4.1 can be done more easily with rows in a matrix because we don’t have to carry x , y , and other unnecessary notation along with us; x and y can always be inserted at the end if desired. The manipulations we are talking about are known as row operations. In particular, we use three elementary row operations. Elementary Row Operations Type 1: Replacing R by aR (where a ≠ 0 ) i i In words: multiplying or dividing a row by a nonzero number. Type 2: Replacing R by aR i i ± bRj (where a ≠ 0 ) In words: multiplying a row by a nonzero number and adding or subtracting a multiple of another row. Type 3: Switching the order of the rows This corresponds to switching the order in which we write the equations; occasionally, this will be convenient. For Types 1 and 2 we write the instruction for the row operation next to the row we wish to replace. (See the Quick Examples below.) ⎢⎥ Quick Examples 5. Type 1: 1 3 −4 [ ] 0 4 6. 1 2 [ ] 0 12 Replace R2 by 3R2. 6 Type 2: 1 3 −4 [ ] 0 4 7. → 3R2 3 −4 4 0 −22 4R1 − 3R2 → 2 [ 0 4 ] Replace R1 by 4R1 − 2 Type 3: ⎡ ⎣ 1 3 −4 0 4 2 1 2 3 ⎤ ⎦ ⎡ R1 ↔ R2 → ⎣ 0 4 2 ⎤ 1 3 −4 ⎦ 1 2 3 Switch R1 and R2. Using Technology See the Technology Guide TI-83/84 Plus and Technology Guide Spreadsheet to see how to use a TI-83/84 Plus or a spreadsheet to solve this system of equations. Website www.WanerMath.com → Online Utilities → Pivot and Gauss-Jordan Tool Enter the augmented matrix in columns x1, x2, x3, … . To do a row operation, type the instruction(s) next to the row(s) you are changing as shown, and press “Do Row Ops” once. Details One very important fact about the elementary row operations is that they do not change the solutions of the corresponding system of equations. In other words, the new system of equations that we get by applying any one of these operations will have exactly the same solutions as the original system: It is easy to see that numbers that make the original equations true will also make the new equations true, because each of the elementary row operations corresponds to a valid operation on the original equations. That any solution of the new system is a solution of the old system follows from the fact that these row operations are invertible: The effects of a row operation can be reversed by applying another row operation, called its inverse. Here are some examples of this invertibility. (Try them out in Quick Examples 5, 6, and 7.) Operation Inverse Operation Replace R by 3R 2 2 Replace R by 1 R2 2 Replace R by 4R 1 1 − 3R2 Switch and R .and R . 1 2 . 3 . Replace R by 1 3 R1 + 1 4 R2 . 4 Switch R and R . 1 2 Our objective, then, is to use row operations to change the system we are given into one with exactly the same set of solutions in which it is easy to see what the solutions are.