If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Solving linear systems with matrices

Sal solves that matrix equation using the inverse of the coefficient matrix. Created by Sal Khan.

Want to join the conversation?

Video transcript

that we could take a system of two equations with two unknowns and represent it as a matrix equation where the matrix A's are the coefficients here on the left-hand side. The column vector X has our two unknown variables, S and T. Then the column vector B is essentially representing the right-hand side over here. What was interesting about it, then that would be the equation A, the matrix A times the column vector X being equal to the column vector B. What was interesting about that is we saw well, look, if A is invertible, we can multiply both the left and the right-hand sides of the equation, and we have to multiply them on the left-hand sides of their respective sides by A inverse because remember matrix, when matrix multiplication order matters, we're multiplying the left-hand side of both sides of the equation. If we do that then we can get to essentially solving for the unknown column vector. If we know what column vector X is, then we know what S and T are. Then we've essentially solved this system of equations. Now let's actually do that. Let's actually figure out what A inverse is and multiply that times the column vector B to figure out what the column vector X is, and what S and T are. A inverse, A inverse is equal to one over the determinant of A, the determinant of A for a two-by-two here is going to be two times four minus negative two times negative five. It's going to be eight minus positive 10, eight minus positive 10, which would be negative two. This would become negative two right over here. Once again, two times four is eight minus negative two times negative five so minus positive 10 which gets us negative two. You multiply one over the determinant times what is sometimes called the adjoint of A which is essentially swapping the top left and bottom right or at least for a two-by-two matrix. This would be a four. This would be a two. Notice I just swapped these, and making these two negative, the negative of what they already are. This is from a negative two this is going to become a positive two, and this right over here is going to become a positive five. If all of this looks completely unfamiliar to you, you might want to review the tutorial on inverting matrices because that's all I'm doing here. So A inverse is going to be equal to, A inverse is going to be equal to, let's see, this is negative 1/2 times four is negative two. Negative 1/2, negative 1/2 times five is negative 2.5, negative 2.5. And negative 1/2 times two is negative one. Negative 1/2 times two is negative one. So that's A inverse right over here. Now let's multiply A inverse times our column vector, seven, negative six. Let's do that. This is A inverse. I'll rewrite it. Negative two, negative 2.5, negative one, negative one times seven and negative six. Times, I'll just write them all in white here now. Seven, negative six. We've had a lot of practice multiplying matrices. So what is this going to be equal to? The first entry is going to be negative two times seven which is negative 14 plus negative 2.5 times negative six. Let's see. That's going to be positive. That's going to be 12 plus another 3. That's going to be plus 15. Plus 15. Negative 2.5 times negative six is positive 15. Then we're going to have negative one times seven which is negative seven plus negative one times negative six. Well, that is positive six. So the product A inverse B which is the same things as a column vector X is equal to, we deserve a little bit of a drum roll now, the column vector one, negative one. We have just shown that this is equal to one, negative one or that X is equal to one, negative one, or we could even say that the column vector, the column vector ST, column vector with the entries S and T is equal to, is equal to one, negative one, is equal to one, negative one which is another way of saying that S is equal to one and T is equal to negative one. I know what you're saying. I said this in the last video and I'll say it again in this video. You're like, "Well, you know, it was so much easier "to just solve this system directly "just with using elimination or using substitution." I agree with you, but this is a useful technique because when you are doing problems in computation there may be situations where you have the left-hand side of this system stays the same, but there's many, many, many different values for the right-hand side of the system. So it might be easier to just compute the inverse once and just keep multiplying, keep multiplying this inverse times the different what we have on the right-hand side. You probably are familiar with some types, you have graphics processors, and graphics cards on computers and they talk about special graphic processors. What these are really all about are the hardware that is special-purposed for really fast matrix multiplication because when you're doing graphics processing when you're thinking about modeling things in three dimensions, and you're doing all these transformations, you're really just doing a lot of matrix multiplications really, really, really fast in real time so that to the user playing the game or whatever they're doing, it feels like they're in some type of a 3D, real-time reality. Anyway, I just want to point that out. This wouldn't be, if I saw this just randomly my instincts would be to solve this with elimination, but this ability to think of this as a matrix equation is a very, very useful concept, one actually not just in computation, but also as you go into higher level sciences especially physics, you will see a lot of matrix vector equations like this that kind of speak in generalities. It's really important to think about what these actually represent