 In our previous video we introduced the idea of a non-singular matrix that is those matrices which have an inverse and Therefore we essentially could divide out that matrix because you just multiply by the reciprocal That's all division is multiplying by the reciprocal, but not every matrix is non-singular sometimes They're singular so how can we determine whether a matrix is non-singular or not? Well in the two by two case There's a very simple formula you can use if you have a matrix a which again, it's two by two you have a b c d right here Then it turns out we can determine whether the matrix is non-singular or singular by computing the following number We're going to compute the number ad minus bc now as the name might suggest This number is commonly referred to as the determinant of the matrix ad The matrix a right here because after all if this number is non-zero that determines that the matrix is non-singular And if the mate if the number ad minus bc is equal to zero that actually tells you that the matrix is singular So yeah, this determinant be non-zero This is a topic we'll talk about later in this series about determinants in chapter five So stay tuned for that But this ad minus bc is this two by two Determinant and when this number is non-zero our matrix can be non-singular and we have a formula for The inverse of the matrix so the inverse of the matrix a is going to be one over the determinant of a ad minus bc So you can see why that cannot be zero all the ways you dive divided by zero This is what I was alluding to in the previous video that we call matrices singular because they have singularities that their Matrix will be singular if and only if it's determinant equals zero and that Singularity is coming from the zero determinant can't divide by zero So if it's non-singular the term it will be non-zero Sorry, if it's a non-singular matrix the determinant will be non-zero and then you're going to divide by the term But you also have to switch up the numbers a little bit You're going to notice that then the numbers on the diagonal are going to swap places A will become a D and D will become an A and then those numbers that are on the off diagonals So B and C you're going to take a negative sign in front of them And this is just kind of a formula to memorize here. We can verify that it works I mean if you take this matrix a and you times it by this proposed inverse matrix a inverse You'll see that this thing will turn out to be the identity matrix the i2 I would recommend you try doing that in general And so what we're going to do is we're going to use this formula to compute the inverse of this two by two matrix a Right here now the first thing we have to do is check the determinant So you're going to take the product of the diagonals one and four So the determinant of a you're going to get one times four and they used to track from it the product of the other diagonals two and three You see that this is going to be four. Oh, I wrote I wrote two three times three That should be two times three. Sorry, so you're going to get four minus six, which is negative two Which is not zero so this tells us that our matrix is non singular It is invertible therefore it has an inverse and that inverse we can compute using the formula from above So a inverse is going to look like a one over negative two Times we're going to swap the numbers on the main diagonals We got a four and a one and then the numbers and off the diagonal. We're going to put We're going to put some negative signs in front of those and so then if you distribute the negative one half through you're going to get negative two positive one Three halves and negative one half or you could use decimals if you prefer. That's not a big deal either way And so then we get the following inverse of the matrix a so that's all that one has to do to find an inverse for two by two matrix And let's actually verify that this is in fact the case if we take a times a inverse You're going to take the original matrix a which remember was one two three four And times it by this calculated matrix a inverse here negative two one Three halves and negative one half and if we go through the calculation here take the first row times the first column We end up with negative two Plus well two times three halves is a three Oh, okay, you'll notice that negative two plus three is a one Take the first row times the second column. You're going to get one minus two times a half is one That's going to be a zero Take the second row times the first column. You're going to get negative six plus well Two goes into four Two times so you get two times three which is six that's likewise a zero And then second row second column You're going to end up with a three minus a two and so we can see that this is the two by two identity I'll let you compute the other way around Uh to show that that one also gives you the identity therefore we have found the real mccoy inverse to this matrix Now why are we interested in finding inverses of matrices in the first place? Well When we go back to the beginning of this lecture series here We were interested in solving the linear system ax equals b this matrix equation encodes the entire linear system Now if we could If we could divide by a or in this case what I mean to say is if we could multiply by a inverse What we could do is the following you can multiply the left hand side of both You can multiply the left hand side of both sides of this equation by a inverse And because of matrix properties of these operations You'll get a inverse times a times x and then the right hand side is a inverse b Like so well a inverse times a would be the identity Which when you times that by a Oh, sorry, when you times that by x you'll just give back the vector x And so notice what we have here is that if a matrix is non-singular it has an inverse Then the solution to the linear system will just be x equals a inverse b We could just times the vector b By the inverse of the matrix and that'll solve the system of equations We can solve this matrix equation It'd be kind of like if you had the equation 2x equals 4 What do you do you divide both sides by 2 and you get x equals 2? That's the same idea with matrices that if there's an inverse we can multiply by that inverse Now matrix multiplication is non-commutative So notice you need to multiply both the left hand side and the right hand side by a the left On the left hand side of the equation and the right hand side of the equation You have to multiply by a inverse on the left in order to cancel the a on the left All right, that that is critical here So imagine we want to solve the system of equations x1 plus 2x2 equals 5 and 3x1 plus 4x2 equals 6 Now if we take the matrix The coefficient matrix one two three four and we take the vector b To be 5 and 6 right here, you'll hopefully recognize that oh wow wait a second That was the matrix a we just did a moment ago. Yay This is We have its inverse matrix already computed therefore the solution to this system of equation will be a inverse b Which the inverse matrix we saw from the previous slide would be negative 2 1 3 halves and negative 1 half we times that by b which is 5 and 6 And so doing the multiplication there you're going to end up with a negative 10 plus 6 That gives us a negative 4 And then if you take the second row times b you're going to get 15 halves minus six halves, which that turns out to be nine halves Our 3.5 if you prefer And then you can verify that this is in fact the solution to this system of equations if we take Here a looking at the first equation if you take a negative 4 Plus 9 that's equal to 5 so that passes the first equation And if you take the second equation, you're going to take negative 12 plus 18 Which that gives you a 6 so this is in fact a solution to the system of equations We can solve systems of linear equations that is we can solve this this matrix equation if we have a Matrix inverse so invertible matrices have some advantages. We can solve various Matrix equations using inverses if they exist