Hey, everyone. Welcome back. So in an earlier video, we learned how to calculate a 2 by 2 determinant, and then we learned how to use Cramer's rule to solve a system of 2 equations with 2 unknowns. Well, similarly here, we've learned how to calculate 3 by 3 determinants. And what I'm going to show you in this video is how to solve a system of 3 equations with 3 unknowns using Cramer's rule. Now remember that Cramer's rule is really just a formula that directly gives you the solution to a system of equations. We're basically just going to plug in a bunch of numbers into some formulas, and it's going to spit out the answers for x, y, and z directly. Alright? The only thing that's different here is that because we have 3 equations with 3 unknowns, our determinants will just be a little bit more complicated. Instead, we're going to use determinants of 3 by 3 matrices. Let's just go ahead and get started here because there's actually not a whole lot that's different about Cramer's rule, and we'll go ahead and work this out together. Let's get started.
So we have the system of equations over here, and we want to solve this by using Cramer's rule. Now the first thing I'm going to do is I'm going to turn this into an augmented matrix just so I can get all my coefficients and stuff in the right place. Alright? So this just becomes a matrix like this. Remember, we're just going to copy over the coefficients. My x coefficients are going to be negative 5, and I have 0 over here. This is like 0x, and then I have 1. Now for the y column that's going to be in green, I'm going to have negative 1, 3, and then 1. And then for this z column over here, my z coefficients, this is going to be 4, 6, and 1. And then remember that my final, my final column over here with these purple numbers, these are going to be my constants, are just going to be other constants on the right side, 4, 21, and 6.
Alright? So what Cramer's rule says is that x, y, and z, I'm going to have to take basically the division of two numbers, something called dx, dy, and dz. So what is this capital D? This capital D really is just the 3 by 3 matrix that you get just by looking at the coefficients of your x, y, and z variables. Alright? Now because I'm going to use that variable 3 times in my equations, that's always just going to be a good place to start. Also, what happens is that if that capital D ends up being 0, then you'll actually have no solution. So you just want to make sure that it's not 0. So let's go ahead and start there. What capital D is is just the determinant of just this 3 by 3 matrix that you get over here. Right? So it's really just going to be the determinant of this thing.
So remember how to calculate determinants? Just really quickly as a brief refresher, what you have to do is you have to follow this formula over here where, remember, you're just going to have to take these numbers, cancel out strike out the rows and columns, and then focus on the smaller 2 by 2 matrices that you get. Alright? You can take a look there just in case you need a refresher. So I'm just going to go ahead and set this up, and I'm going to skip some steps here because we're a little bit sort of tight on space for this problem. What we're going to see here is that this is going to be negative 5 times the smaller determinant over here. So in other words, this is just going to be the 3, 1, and 6, 1. Now we flip signs. This will be minus. This is going to be negative one, the negative one times this smaller determinant over here, and we cancel out some stuff, and we're going to get 0, 1 and 6, 1. Alright. Now I'm going to flip signs again. This is going to become now 4. This is going to become now we're going to use smaller determinants that we get over here. So in other words, this is just going to be 1, 1 and 3, 1. Alright? So that's what this ends up being.
So if we calculate this, what we're going to end up seeing is that we end up getting, this is going to be negative 5. This is going to be negative 5, and then we're going to have 3 times 1 minus 6 times 1. So 3 minus 6, will end up being -3 so negative 5 times negative 3. that's what this whole thing ends up becoming, negative 3 over here. Alright? So now let's see. We have negative 1, so we're going to have minus. We're going to have negative one times and then what is this mess end up becoming? 0 times 1 is 0 minus 6 times 1, which is 6. So this is going to be let's see. This is going to be negative one times 0 minus 6. That's actually negative 6. Alright? That's what that ends up being. That's what this whole mess becomes. And then over here in this last term, we're going to get is we're going to get 0 times 1. So it's going to be 4 times let's see. 0 times 1 is 0, and then minus 3 times 1, which is 3. So in other words, it's going to be 0 minus 3, which is negative 3. Alright?
So what I end up getting here is that this is going to be, let's see. So this is going to be this is going to be negative 15. Actually, this is going to be positive 15. This is going to be now minus, and this is going to be 6 because the negatives cancel out, plus 12. And if you work this out here, what you're going to get is that capital D is equal to -3. So in other words, what's going to happen here is when I calculate x, y and z, I'm going to have to calculate some number and then just divide it by now we know this is just going to be -3. Alright? So let's go ahead and do that. So this capital D here is -3. So now that we're done with this, let's go ahead and now focus on x. So what x says is to calculate x, this is just going to be something called Dx. So I'm going to have to calculate just some number here, some determinant number called Dx and divided by this capital D. So in other words, some number divided by -3. What is this Dx that we've been talking about? Well, really, what it is is in a similar way that in Cramer's rule, we replaced one of the constant columns for one of the x and y coefficients, it's the same exact thing. For Dx, what this really means is that we're going to take our normal matrix over here of a, b, and c. And if you're solving for the x components, you're going to take the constants on the right side of your equation, and you're going to replace them in the x column. So in other words, you no longer are dealing with the x coefficients. Now you just have your constants. So what Dx is is it's going to be a 3 by 3 determinants, except instead of the negative 5, 0, and 1, I'm really just going to plug in these numbers. This is going to be 4, 21, and 6. So 4, 21, and 6, and then the rest of the numbers are the same, negative 1, 3, and 1. And this is going to be 4, 6, and 1. Alright? Now what we have to do is just calculate the determinant of this 3 by 3 matrix. So let's go ahead and do that.
So what this says here is that we're going to this is going to be 4, and then this is going to be, this is just going to be the smaller matrix over here. So I'm just going to copy that over like that. Minus this is going to be negative 1, and then this is going to be, 2, 1, 6. So 2, 1, 6, and then this is going to be 6, 1. And then we have plus plus, and then we have 4, and this is going to be, these smaller numbers over here. so this is going to be 21, 3, and 6, 1. So that is going to be your 3 by 3 determinants. Now we just have to go ahead and do a bunch of calculations. Alright? So this Dx here will be well, this is just going to be 4 times 3 minus 6. So this is going to be, 4 times -3. That’s 4 times -3 minus, and this is going to be let's see. Negative one. So this is going to be oops. So what happens is we do 21 times 1, that's 21, minus 36, which is -15. And then that's we multiplyyclerView by negative one, that's going to be positive 15. so this is going to be 15 over here. Now this is going to be 21 times 1, which is 21, times a minus 18, so that's 3, and 4 times 3 is 12. Alright? So So we're just going to do we're just going to sort of, mental math our way through this.
This is going to be -12 minus 15 plus 12. Alright? So this ends up being -12 minus 15 plus 12, and you can just double check that I've done this correctly. Work out the math yourself, and you'll see that this is correct. So what happens is these this 12 and -12 will cancel, and you'll see that Dxjust leaves you with -15. Alright? So now we can plug this Dx back into this formula over here, and we'll see that this is just a number, -fifteen over -three just equals positive 5. And that is the first number that you have. So x is equal to 5. Now we just basically are going to rinse and repeat. We're going to do this exact same thing. We're going to do it twice, you know, 2 more times for y and z. Alright? So this is going to be y over here. Right? So here, what I've got is Dy over D. So in other words, some number divided by -3. And when I calculate that, I'm just going to get whatever the answer is. How do I figure out what Dy is? Well, basically, Dy is just going to be now if I replace the constants into the y column instead of the x. Right? So now the constants are going to be in this middle column. And so let's go ahead and write out what this matrix is going to be. So what this is going to be is this is going to be, let's see. So I've got my negative 5, 0, and 1, and then I've got, in purple, I've got 4, 21, and 6. And then over here, what I've got is 4, 6, and 1. Alright? So let's calculate this determinant over here. This is going to be negative 5 times, and then we're going to have these 2 smaller numbers over here. That's going to go in here. Then we switch signs. This is going to be minus, then we're going to have 4, and then this is going to be a smaller determinant; in which we're going to have 0, 1, and 6, 1, and then we're going to flip signs again, and now we're going to have 4, and then in this smaller determinant, we're just going to have these four numbers over here. So what you'll also notice here is that, occasionally, you're going to have the same numbers that pop up. So you're going to have, for example, 21, 6, 6, and 1. We actually already know what the determinant of that is; that ends up being 15 or -15. So you're going to see the same sort of numbers pop up. So you can usually look up on up and down on your page and look for determinants that you've already calculated before, just to make things a little bit easier. Alright. So let's calculate this. So this is going to be negative 5, and then this whole thing just becomes 21 minus, 36, which is going to be minus 15. Alright? So what this ends up being here is this ends up being a 4. Now with 0 minus 1, sorry. 0 times 1 minus 6 is going to be negative 6, and this is going to be 4. And then 0 times 6 is 0 minus 21 times 1, which is -21. Alright? So that's really what that becomes. And if you work this out here, what this ends up being is this ends up being 75, plus 24 minus 84. Right?
And so if you work this out, what you'll get is a grand total over here of 15. So this actually, Dy ends up being positive 15. Alright? Now if you plug this back into this formula, what you'll see is that 15 over negative 3 ends up being -5, and that is your second answer. Now we just have to do this one last time over here to calculate what z is. Z is going to be Dz over D, and this is going to be some number divided by negative 3. When you calculate this, you're just going to get some number over here. Let's go ahead and work this out. So this is going to be Dz is equal to and now we've got we're just gonna replace now the z column with the constants. So in other words, this is going to be negative 5, 0, and 1. This is going to be, negative 1, 3, and 1. And then here, we're going to have 4, 21, and 6. Now if you work this out, which this determinant is going to be, this is going to be, negative 5, and then we're going to do these two numbers. By the way, we've already calculated determinant before. And this is going to be minus, negative 1, and then we're going to have this smaller determinant over here, which is going to be 0, 1, 21, and 6. So 2, 1, 6. And then finally, we swap signs one last time, and this is going to now be 4. And then we have this smaller determinant over here. This is going to be like that. Alright? Now I'm actually just, I'm actually just going to go ahead and skip ahead to the answer here. You can go ahead and pause this and make sure that you've done it yourself. Once you actually work out all of this, what you're going to get is you're going to end up getting 15. This is going to be -21, and this is going to be -12. And so what you're going to get here for this is you're going to get -18. So when you plug this in negative 18, you're going to get an answer of 6. And so, finally, the answer to your solution is 5, negative 5, and positive 6. So this is the solution to your system of equations. Negative oh, sorry. 5, negative 5, negative 5, and then positive 6. So that is the solution. Let me know if that makes sense. I know this is a little bit tedious. Thanks for sticking with me. Thanks for watching.