# Lesson Video: Solving a System of Three Equations Using a Matrix Inverse Mathematics • 10th Grade

In this video, we will learn how to solve a system of three linear equations using the inverse of the matrix of coefficients.

17:27

### Video Transcript

In this video, we’ll learn how to solve a system of three linear equations using the inverse of the matrix of coefficients. Now, actually, by this stage, you probably have a number of methods that you might use to help you solve systems of linear equations. One of those is the elimination method, which involves adding or subtracting equations with the aim of eliminating a variable and then solving that leftover equation for the variable that remains. That can, however, be quite long-winded when it comes to working with more than two variables.

And so we have an alternative. This alternative involves writing the system of equations in matrix form. And we end up then with the equation 𝐴𝐱 equals 𝐛, where for a system of three equations 𝐴 is a three-by-three matrix. And then 𝐱 can be our column matrices or column vectors. We then multiply both sides of this equation by the inverse of 𝐴, remembering of course the order in which we do this matters. Then, recalling that the product of a matrix and its inverse is the identity matrix, we then find that 𝐼𝐱 is equal to the inverse of 𝐴 times 𝐛. In other words, 𝐱 is equal to the inverse of 𝐴 times 𝐛.

Now, here 𝐱 is the column matrix that contains the variables we’re looking to find the values of. So what we need to do is figure out how we set up these equations so that this process works. Let’s take a system of three linear equations. Now, we could generalize this, but actually we’re only interested in three linear equations in this video. The unknowns here or the variables are 𝑥, 𝑦, and 𝑧. Then, the coefficients are 𝑎 with our subscripts. 𝐴 is then the coefficient matrix. And it’s made up of the elements 𝑎 sub one one, 𝑎 sub one two, 𝑎 sub one three, all the way through to 𝑎 sub three three. The vector 𝐱 is then 𝑥, 𝑦, 𝑧. It contains our variables. And then the vector 𝐛 is 𝑏 sub one, 𝑏 sub two, and 𝑏 sub three. It’s these values.

Now, the reason that we can use these matrices and vectors is that when we then go back and multiply the matrix 𝐴 with the vector 𝐱, we’re essentially finding the dot product of the elements in the first row of our matrix and then the first column or the only column of vector 𝐱, which gives us this first linear equation. Then, we go back and we multiply the second row of matrix 𝐴 with the column vector 𝐱. And we get our second linear equation. Finally, we repeat that with our third row, multiplying each element by the vector 𝐱. And we get our third linear equation. So now that we know how to write the system of equations in matrix form, let’s just practice that process.

Consider the system of equations. Express the system as a single matrix equation.

Remember, a matrix equation can be used to help us solve systems of linear equations. It will be of the form 𝐴𝐱 equals 𝐛, where 𝐴 is called the coefficient matrix, 𝐱 is a column vector containing the variables of our equation, and 𝐛 contains all of the constants in the equation. So let’s identify first the coefficient matrix. That’s the matrix that we’re going to call 𝐴. We have three equations with three variables. And so matrix 𝐴 is going to be a three-by-three matrix. The elements in the first row of matrix 𝐴 are the coefficients of 𝑝, 𝑞, and 𝑟, respectively in our first equation.

We see that the coefficients are two, two, and four. And so that is the first row of our matrix. The elements in the second row of matrix 𝐴 are the coefficients of 𝑝, 𝑞, and 𝑟 in our second equation. Those are negative one, negative one, and negative one. And so those are the elements in the second row of our matrix. We’re going to repeat this process for the third row of our matrix, looking for the coefficients of 𝑝, 𝑞, and 𝑟 in our third equation. We now see that those are two, five, and six. And so we’ve identified our coefficient matrix. It’s two, two, four; negative one, negative one, negative one; and two, five, six.

We’re then going to look at the vector 𝐱. It’s a variable vector. And so we need to list the variables in our equation. Those are 𝑝, 𝑞, and 𝑟. And it is in fact really important that we write them in that order. We need it to be the case that when we multiply the matrix 𝐴 by the column vector 𝐱, we end up with the original expressions two 𝑝 plus two 𝑞 plus four 𝑟, negative 𝑝 negative 𝑞 negative 𝑟, and so on. If we were to mix these variables around, we’re not going to end up with the exact same equation.

Finally, we’re interested in the constant vector 𝐛 that contains all of the constants from our equations. Once again, we need to give them in the correct order. And so we find vector 𝐛 is four, 14, 10. We write this as a single matrix equation by putting it back into the form 𝐴𝐱 equals 𝐛. And when we do, we see that the matrix equation we need is two, two, four; negative one, negative one, negative one; two, five, six times the vector 𝑝, 𝑞, 𝑟 equals the vector four, 14, 10.

So now that we’ve seen how to actually express the system as a matrix equation, let’s look at how we can use the inverse matrix to solve a system of three equations.

Solve the given matrix equation using the inverse of a matrix.

Remember, given a matrix equation 𝐴𝐱 equals 𝐛, where 𝐱 and 𝐛 are column vectors, we can solve by multiplying both sides by the inverse of 𝐴. Now, of course, order does matter when multiplying, so we write this as shown. But since the inverse of 𝐴 times 𝐴 is just the identity matrix, we find that this becomes 𝐱 equals the inverse of 𝐴 times 𝐛. And so let’s define the matrix 𝐴 to be this square matrix in our question. The column vector 𝐱 is the variable vector, and 𝐛 is a constant vector. And this means we can solve this equation by finding the inverse of our matrix 𝐴. So how do we find the inverse of a three-by-three matrix?

One method we have is to augment matrix 𝐴 with the identity matrix. When we do, it looks a little something like this. And our job is to perform elementary row operations until matrix 𝐴 becomes the identity matrix. Note of course that this isn’t the only method we can choose to find the inverse of a matrix. It’s very much personal preference and as long as we get the same value for the inverse, no matter which method we choose, then it really doesn’t matter.

So we define each of our rows as shown. And remember, we’re allowed to add or subtract the rows or multiply them by scalars. We can even swap rows. And this is usually a little bit like solving a puzzle. There isn’t necessarily just one route we can take. The first thing that we’re going to do is add the values in the row 𝑟 two to all of the values in the row 𝑟 one. And so the values in 𝑟 two and 𝑟 three are actually going to remain unchanged for now. One plus one is two, negative one plus one is zero, and negative one plus negative one is negative two. Of course, we need to do the same on the right-hand side. One plus zero is one, zero plus one is one, and zero plus zero is zero.

Next, we’re going to subtract each of the elements in row two from the elements in row three. This will have the effect of making this element and this element equal to zero. And it will make this element equal to one, which is really useful. That is the identity matrix’s final row.

Now, of course, in this occasion, 𝑟 one and 𝑟 two remain unchanged. One minus one is zero, one minus one is zero, and zero minus negative one is one. Then, on the right-hand side, we get zero, negative one, and one. Now, we might notice that if we double each of the elements in row three and add them to the elements in row one, we’re going to get rid of two of the elements. This element will remain zero, and this will become zero. Two add two lots of zero is two, zero add two lots of zero is zero, and negative two add two lots of one is zero. We repeat the process on the right-hand side. We get one here, negative one here, and two here.

Now, this looks really good so far. We notice that our bottom row already looks like the identity matrix. And we might notice that if we halve all of the elements in the top row, that will look like the identity matrix too. So let’s do that step now. When we perform this step, we get one, zero, zero as the first row on the left-hand side. And then we halve each of the elements on the right-hand side. We get a half, negative a half, and then a half of two is just one. So the first row and last row look great.

Let’s deal with the middle row. We might spot that if we subtract row one from row two, this element will become zero. But also if we add row three to row two, this element will also become zero. That gives us the middle row we require on the left-hand side. Let’s repeat the process on the right-hand side. The first element on this row will be zero minus a half plus zero, which is negative one-half. Then we get one minus negative a half plus negative one, which is a half. And finally, we have zero minus one plus one, which is zero.

And now we have the identity matrix on the left-hand side. So the matrix we have on the right-hand side is the inverse of 𝐴. And we’re now ready to solve the equation. Let’s clear some space. We know that the variable vector 𝐱 will be equal to the inverse of 𝐴 times the constant vector 𝐛. So that’s as shown. We can now say that 𝑥 will be equal to the dot product of the elements in the first row in our matrix inverse 𝐴 and the elements in the column vector 𝐛. So 𝑥 will be a half times nine plus negative a half times negative 11 plus one times six, which is equal to 4.5 plus 5.5 plus six, or 16.

We can then do the same for 𝑦. It’s the dot product of the elements on the second row and our column vector 𝐛. So it’s negative a half times nine plus a half times negative 11 plus zero times six. That’s negative 4.5 minus 5.5, which of course is negative 10. We now do this one more time to find the value of 𝑧. It’s the dot product of these elements in this row with these elements in this vector. That’s zero times nine plus negative one times negative 11 plus one times six, which is 11 plus six, or 17. And so we’ve solved our equation. We found 𝑥 is equal to 16, 𝑦 is equal to negative 10, and 𝑧 is equal to 17.

In our final example, we’re going to look at combining these two examples to help us use matrices to solve a system of equations.

Use matrices to solve the following system of equations.

Remember, if we can write our system of equations in the form 𝐴𝐱 equals 𝐛, where 𝐴 is the coefficient matrix, 𝐱 is the column vector that contains all of the variables, and 𝐛 is the constant vector, then we can multiply both sides of this equation by the inverse of 𝐴. And when we do, we find that the variable vector 𝐱 is equal to the inverse of 𝐴 times 𝐛.

And so to solve our system of equations, we need to set it up in this form and then find the inverse of our coefficient matrix. We have three equations with three variables. And so vector 𝐴 is going to be three by three. We’re going to list the coefficients of our variables in order from our first equation. It’s negative one, eight, and negative three. These are simply the coefficients shown.

In our second equation, they’re four, negative three, and eight. And in our third equation, there’re six, negative 12, and 19. Then the vector 𝐱 contains all of our variables. It’s 𝑥, 𝑦, 𝑧. And of course our constant vector contains our constants negative 10, 12, and 18. So our first job is to find the inverse of the matrix 𝐴.

There are of course a number of ways to do this. One is to augment it with the identity matrix and perform elementary row operations. We might even choose to use a calculator. But let’s recall how we can use the minors, cofactors, and adjugate method. We begin by finding the matrix of minors. We ignore the values on the row and column we’re looking at and calculate the determinant of the remaining values. So for the first element on the first row, we’re going to do negative three times 19 minus eight times negative 12, which is 39. We then ignore all elements on the first row and second column. And we work out four times 19 minus eight times six, which is 28. Finally, we ignore elements on the first row and third column. And we work out four times negative 12 minus negative three times six. And we get negative 30.

Continuing the process, and the matrix of minors is as shown. We then find the matrix of cofactors using that sort of checkerboard pattern. This involves changing the sign of the second element in the first row, the first and third elements in our second row, and the second element in our third row. Next, we find the adjugate. The elements on a diagonal stay the same, and then we simply swap the positions of all of the rest. We go directly across that diagonal. So we swap negative 116 and negative 28, 55 and negative 30, and negative four and 36.

Then our final step is to multiply this by one over the determinant of 𝐴. We can use the values of the matrix of minors to do so. We’re going to multiply each of the elements in the top row of our original matrix by the cofactor for the same location. So we multiply negative one by 39. We then subtract the product of eight and 28. And then we add the product of negative three and negative 30. And so the determinant of 𝐴 is negative 173. And so we find the inverse of 𝐴 is negative one over 173 times that adjugate.

Let’s clear some space, and we’re now able to solve our system of equations. 𝐱 is therefore equal to the inverse of 𝐴 times 𝐛, which is as shown. Now, we could multiply each of the elements inside the inverse of 𝐴 by negative one over 173. Or we can do that right at the end. Let’s begin by finding the dot product of the elements in the first row of our inverse and the vector 𝐛. When we do, we get negative one over 173 times 39 times negative 10 minus 116 times 12 plus 55 times 18, which is negative 792. So 𝑥 is negative one over 173 times negative 792, which is the same as 792 over 173.

We then do the same for 𝑦, this time finding the dot product of the elements on this row with our vector, giving us negative one over 173 times 196, which is negative 196 over 173. Let’s do this for 𝑧 by finding the dot product of the elements on the third row of the inverse and the column vector 𝐛. And this time, we get negative one over 173 times 210 or negative 210 over 173.

And so we’ve found the values of 𝑥, 𝑦, and 𝑧. Let’s put them back into vector form. It is in fact easier to do so by taking out that constant factor of one over 173. And so we’ve solved our system of equations. In vector form, we can say that 𝑥, 𝑦, 𝑧 is equal to one over 173 times the vector 792, negative 196, negative 210.

We’re now going to recap the key points from this lesson. In this lesson, we learned that we can represent a system of three equations as a matrix equation. If 𝐴 is the coefficient matrix, 𝐱 is the variable vector, and 𝐛 is the constant vector, then our equation is of the form 𝐴𝐱 equals 𝐛. And by multiplying both sides of this equation by the inverse of 𝐴, we find that 𝐱 is equal to the inverse of 𝐴 times 𝐛.

For a system of three linear equations of the form 𝑎 sub one one 𝑥 plus 𝑎 sub one two 𝑦 plus 𝑎 sub one three 𝑧 equals 𝑏 one and so on, the coefficient matrix is 𝑎 sub one one, 𝑎 sub one two, 𝑎 sub one three; 𝑎 sub two one, 𝑎 sub two two, 𝑎 sub two three; 𝑎 sub three one, 𝑎 sub three two, 𝑎 sub three three. The variable vector is 𝑥, 𝑦, 𝑧. And the constant vector is 𝑏 one, 𝑏 two, 𝑏 three.