Welcome back, everyone. So in the last few videos, we've learned the row operations that you can do to the rows of a matrix, like swapping, multiplying, and adding. And I mentioned that we would eventually use those to solve the system of equations. Well, that's exactly what we're going to do in this video. We're going to solve the system of equations by getting a matrix in a very particular form that we'll discuss in just a second. The whole idea is that I'm going to take a system of equations, turn it into a matrix, and then use row operations to get a very particular pattern of numbers of ones and zeros. And then once I get that, I can turn it back into a system of equations and then solve it that way. Let's go ahead and take a look here. The first time you see this, it might be kind of intimidating, but I'm going to break it down for you, and we'll work out this example step by step. Let's get started here.
So, the whole idea is that we're going to use these row operations to get a matrix with ones along the diagonal. So, notice how I have this sort of diagonal here from top left to bottom right, and then I have zeros underneath the diagonal. That's really what you're trying to get, ones along the diagonal and zeros underneath. Now remember, what happens is that these coefficients really just stand for the numbers here stand for the coefficients of a variable, in a system of equations. So, the reason you want to get to this in this form, which is, by the way, called row echelon form, is because once you turn it back into a system of equations, then really what happens is that you're just going to get equations that you can substitute, and then solve for 'x' and 'y' using that method. So, it really just turns into a regular system of equations problem, which we've seen how to solve before. I want to mention here, by the way, that these numbers can actually be anything. There's no restrictions on them, so they don't have to be ones and zeros or anything like that.
Alright, so what I'm going to do is I'm actually going to break this example down. We're going to work this out together. I'm going to show you step by step how we get to this row echelon form. Alright? Let's take a look. So I've got my system of equations over here, –x + 2y = 4, x + 7y = 14. In fact, it's actually exactly the same system of equations I had over here. So, I'm really just going to start by turning it into a matrix and copying this over. So I've got my augmented matrix over here. Alright, remember, the whole goal is I want to get ones along the diagonal and zeros everywhere else. Here, I've got a negative one and seven along the diagonal, so I'm going to need to get a one in this position. And that actually brings me to the first tip here. I'm going to give you some tips for solving these types of problems, and the first one is just to go row by row and work your way top to bottom. Alright, just work one at a time, focus on one number, and just generally try to go from top to bottom like this. So let's try to get a one in this position over here. How would we do that? Well, to do that, we're going to have to look at our row operations again: swap, multiply, or add. Let's consider each one of them. Can I swap two numbers over here to get a one in this position? Well, actually, you can because notice how this is a negative one and positive one. So if you swap these 2 rows, then you'll get a one there. So that's the first thing you can do. You won't always have to do that, it's just, in this case, we can swap because we've seen that there's a one in this position. So we're going to swap row 1, and that will just become my new row 2. So, really, all that happens is that these rows just switch places. So this is 1, 7, and 14 now, negative 1, 2, and 4. And now, all of a sudden, we can see that we have a one in this position. That's one of our numbers. Alright? So now we just have to focus on these two numbers. This has to become a zero, and this has to become a one. We're going to use row operations to do it.
So you might be thinking that, well, we'll just stick with trying to get the ones along the diagonals. So might be thinking, well, it just doesn't matter. I can just focus on this one. But actually, what I'm going to show you here is that trying to get this one isn't going to be the right move. Because what happens is if you try to get this position here to be a one by multiplying this equation by, let's say, 1 half, then this will become a one, but this will become negative 1 half. And you're going to end up with a weird negative fraction here. Then later on, to try to get rid of it, you're going to have to mess up the one that you've already gotten. So instead, what happens is that kind of brings me out to my second tip. Whenever you get a one along the diagonal, you would actually want to get everything underneath it to be a zero before you move on and try to get to the next one. What do I mean by this? Now that we've gotten this first one, I'm going to focus on getting this number to be a zero before I focus on getting this to be a one. And we're going to see why that works in just a second. So how do I get this one to be a zero? Well, can we swap? Well, swapping is going to be pretty silly because we're just going to undo all the progress we've already done here. So that's not going to work. So what about multiplying? Well, the only way we could get a zero out of this is if I multiply the entire row by zero, but I can't do that because I have to multiply rows by non-zero numbers. So multiplying isn't going to work either. The only way to get a zero in these types of problems is you're going to have to add. By the way, this is always going to happen. So to get zeros, you're going to have to always add something. Alright? So here, what we're going to do is we're going to take row 2. We're going to have to add it to something to get a zero in this position. What do I have to add to this to get it to cancel out to zero? I just have to add one. And that's exactly what I have in the first row. So remember, I can multiply or I can add a multiple of a row. But, in this case, all I have to do is just add row 2 and row 1 together with no multiple, just 1 times row 1. And that's going to be my new row 2. Alright? So now what happens here is, remember, that row operation will only affect row 2, so row 1 will remain completely the same: 1, 7, and 14 doesn't change. Now what happens here is I'm going to add these coefficients down. 1 and negative one becomes zero, 7 and 2 become 9, and then 14 and 4 become 18. Now if you see what happens here, I've got a one in this position, and I've got a zero underneath it. So that's good. I've gotten two of my numbers. I really only have one thing to do left, and that's I have to turn this thing into a one.
Alright, so how does that work? Well, whenever you're trying to turn numbers into ones, you're not going to add. You're going to actually multiply. Because now what I can do in this problem is I can multiply this whole entire equation here by whatever I need, to get this to be a one. And I really just have to multiply this entire equation here by 1/ninth. So what I'm going to do is I'm going to multiply, 1/ninth times row 2. Now the reason this is helpful is because notice how multiplying this equation won't actually affect the zero because 1/ninth times zero is still zero. So this is why multiplying to get ones is going to be easier. So here what happens is this is going to be 1, 7, and 14, and this is going to be zero. So I've got zero over here. This becomes a one. And then if I multiply 18 by 1/ninth, that actually will become a two. So now if you look at this, I've got ones along the diagonal, and I've got a zero underneath the diagonal. So this is now in row echelon form. So that's what this means here. And now that we're done, we can turn this back into a system of equations and solve. What we're going to see here is we have x + y = 14, which is actually one of our original equations. And then we have 0 + y, this is just 1y, equals 2. So one of our variables is now already solved for. We have y = 2. And now all you can do is just plug this back into this equation, this 2, using substitution, and then you'll get the x value. And if you actually do that, what you're going to see here is that x + 7 times 2 equals 14. And what you're going to see here is that x is equal to zero because these things will actually end up canceling out. So this is also sometimes called back substitution in your problems. That's really what this means, is that you'll use row operations to get a matrix, and then you can just sort of backwards substitute to get your answers.
But that's really all there is to it. We use the row operations, work one at a time to get row echelon form, then turn it back into a system of equations which we've seen how to solve. That's really all there is to it, folks. Now one thing I want to mention here, by the way, is that this method of solving systems is sometimes called Gaussian elimination. So if you ever see that, that's what that means. Thanks for watching, and let's get to some practice.