Topics covered: Determinants; cross product
Instructor: Prof. Denis Auroux
Lecture Notes - Week 1 Summary (PDF)
Thank you. Let's continue with vectors and operations of them. Remember we saw the topic yesterday was dot product. And remember the definition of dot product, well, the dot product of two vectors is obtained by multiplying the first component with the first component, the second with the second and so on and summing these and you get the scalar.
And the geometric interpretation of that is that you can also take the length of A, take the length of B multiply them and multiply that by the cosine of the angle between the two vectors. We have seen several applications of that. One application is to find lengths and angles. For example, you can use this relation to give you the cosine of the angle between two vectors is the dot product divided by the product of the lengths.
Another application that we have is to detect whether two vectors are perpendicular. To decide if two vectors are perpendicular to each other, all we have to do is compute our dot product and see if we get zero. And one further application that we did not have time to discuss yesterday that I will mention very quickly is to find components of, let's say, a vector A along a direction u. So some unit vector. Let me explain. Let's say that I have some direction. For example, the horizontal axis on this blackboard. But it could be any direction in space. And, to describe this direction, maybe I have a unit vector along this axis. Let's say that I have any of a vector A and I want to find out what is the component of A along u.
That means what is the length of this projection of A to the given direction? This thing here is the component of A along u. Well, how do we find that? Well, we know that here we have a right angle. So this component is just length A times cosine of the angle between A and u. But now that means I should be able to compute it very easily because that's the same as length A times length u times cosine theta because u is a unit vector. It is a unit vector.
That means this is equal to one. And so that's the same as the dot product between A and u. That is very easy. And, of course, the most of just cases of that is say, for example, we want just to find the component along i hat, the unit vector along the x axis. Then you do the dot product with i hat, which is 100. What you get is the first component. And that is, indeed, the x component of a vector.
Similarly, say you want the z component you do the dot product with k that gives you the last component of your vector. But the same works with a unit vector in any direction. So what is an application of that? Well, for example, in physics maybe you have seen situations where you have a pendulum that swings. You have maybe some mass at the end of the string and that mass swings back and forth on a circle. And to analyze this mechanically you want to use, of course, Newton's Laws of Mechanics and you want to use forces and so on, but I claim that components of vectors are useful here to understand what happens geometrically.
What are the forces exerted on this pendulum? Well, there is its weight, which usually points downwards, and there is the tension of the string. And these two forces together are what explains how this pendulum is going to move back and forth. Now, you could try to understand the equations of motion using x, y coordinates or x, z or whatever you want to call them, let's say x, y. But really what causes the pendulum to swing back and forth and also to somehow stay a constant distance are phenomenal relative to this circular trajectory. For example, maybe instead of taking components along the x and y axis, we want to look at two other unit vectors.
We can look at a vector, let's call it T, that is tangent to the trajectory. Sorry. Can you read that? It's not very readable. T is tangent to the trajectory. And, on the other hand, we can introduce another vector. Let's call that N. And that one is normal, perpendicular to the trajectory. And so now if you think about it you can look at the components of the weight along the tangent direction and along the normal direction.
And so the component of F along the tangent direction is what causes acceleration in the direction along the trajectory. It is what causes the pendulum to swing back and forth. And the component along N, on the other hand. That is the part of the weight that tends to pull our mass away from this point. It is what is going to be responsible for the tension of the string. It is why the string is taut and not actually slack and with things moving all over the place. That one is responsible for the tension of a string.
And now, of course, if you want to compute things, well, maybe you will call this angle theta and then you will express things explicitly using sines and cosines and you will solve for the equations of motion. That would be a very interesting physics problem. But, to save time, we are not going to do it. I'm sure you've seen that in 8.01 or similar classes. And so to find these components we will just do dot products. Any questions? No. OK. Let's move onto our next topic.
Here we have found things about lengths, angles and stuff like that. One important concept that we have not understood yet in terms of vectors is area. Let's say that we want to find the area of this pentagon. Well, how do we compute that using vectors? Can we do it using vectors? Yes we can. And that is going to be the goal. The first thing we should do is probably simplify the problem. We don't actually need to bother with pentagons. All we need to know are triangles because, for example, you can cut that in three triangles and then sum the areas of the triangles. Perhaps easier, what is the area of a triangle?
Let's start with a triangle in the plane. Well, then we need two vectors to describe it, say A and B here. How do we find the area of a triangle? Well, we all know base times height over two. What is the base? What is the height? The area of this triangle is going to be one-half of the base, which is going to be the length of A. And the height, well, if you call theta this angle, then this is length B sine theta. Now, that looks a lot like the formula we had there, except for one little catch. This is a sine instead of a cosine. How do we deal with that?
Well, what we could do is first find the cosine of the angle. We know how to find the cosine of the angle using dot products. Then solve for sine using sine square plus cosine square equals one. And then plug that back into here. Well, that works but it is kind of a very complicated way of doing it. So there is an easier way. And that is going to be determinants, but let me explain how we get to that maybe still doing elementary geometry and dot products first.
Let's see. What we can do is instead of finding the sine of theta, well, we're not good at finding sines of angles but we are very good now at finding cosines of angles. Maybe we can find another angle whose cosine is the same as the sine of theta. Well, you have already heard about complimentary angles and how I take my vector A, my vector B here and I have an angle theta. Well, let's say that I rotate my vector A by 90 degrees to get a new vector A prime.
A prime is just A rotated by 90 degrees. Then the angle between these two guys, let's say theta prime, well, theta prime is 90 degrees or pi over two gradients minus theta. So, in particular, cosine of theta prime is equal to sine of theta. In particular, that means that length A, length B, sine theta, which is what we would need to know in order to find the area of this triangle is equal to, well, A and A prime have the same length so let me replace that by length of A prime. I am not changing anything, length B, cosine theta prime. And now we have something that is much easier for us.
Because that is just A prime dot B. That looks like a very good plan. There is only one small thing which is we don't know yet how to find this A prime. Well, I think it is not very hard. Let's see. Actually, why don't you guys do the hard work? Let's say that I have a plane vector A with two components a1, a2. And I want to rotate it counterclockwise by 90 degrees. It looks like maybe we should change some signs somewhere. Maybe we should do something with the components. Can you come up with an idea of what it might be?
I see a lot of people answering three. I see some other answers, but the majority vote seems to be number three. Minus a2 and a1. I think I agree, so let's see. Let's say that we have this vector A with components a1. So a1 is here. And a2. So a2 is here. Let's rotate this box by 90 degrees counterclockwise. This box ends up there. It's the same box just flipped on its side. This thing here becomes a1 and this thing here becomes a2. And that means our new vector A prime is going to be --
Well, the first component looks like an a2 but it is pointing to the left when a2 is positive. So, actually, it is minus a2. And the y component is going to be the same as this guy, so it's going to be a1. If you wanted instead to rotate clockwise then you would do the opposite. You would do a2 minus a1. Is that reasonably clear for everyone? OK. Let's continue the calculation there. A prime, we have decided, is minus a2, a1 dot product with let's call b1 and b2, the components of B.
Then that will be minus a2, b1 plus a1, b2 plus a1, b2. Let me write that the other way around, a1, b2 minus a2, b1. And that is a quantity that you may already know under the name of determinant of vectors A and B, which we write symbolically using this notation. We put A and B next to each other inside a two-by-two table and we put these verticals bars. And that means the determinant of these numbers, this guy times this guy minus this guy times this guy. That is called the determinant.
And geometrically what it measures is the area, well, not of a triangle because we did not divide by two, but of a parallelogram formed by A and B. It measures the area of the parallelogram with sides A and B. And, of course, if you want the triangle then you will just divide by two. The triangle is half the parallelogram. There is one small catch. The area usually is something that is going to be positive. This guy here has no reason to be positive or negative because, in fact, well, if you compute things you will see that where it is supposed to go negative it depends on whether A and B are clockwise or counterclockwise from each other. I mean the issue that we have --
Well, when we say the area is one-half length A, length B, sine theta that was assuming that theta is positive, that its sine is positive. Otherwise, if theta is negative maybe we need to take the absolute value of this. Just to be more truthful, I will say the determinant is either plus or minus the area. Any questions about this? Yes. Sorry. That is not a dot product. That is the usual multiplication. That is length A times length B times sine theta. What does that equal? And so that is equal to the area of a parallelogram.
Sorry. Let me explain that again. If I have two vectors A and B, I can form a parallelogram with them or I can form a triangle. And so the area of a parallelogram is equal to length A, length B, sine theta, is equal to the determinant of A and B. While the area of a triangle is one-half of that. And, again, to be truthful, I should say these things can be positive or negative. Depending on whether you count the angle positively or negatively, you will get either the area or minus the area. The area is actually the absolute value of these quantities.
Is that clear? OK. Yes. If you want to compute the area, you will just take the absolute value of the determinant. I should say the area of a parallelogram so that it is completely clear. Sorry. Do you have a question? Explain again, sorry, was the question how a determinant equals the area of a parallelogram? OK. The area of a parallelogram is going to be the base times the height. Let's take this guy to be the base. The length of a base will be length of A and the height will be obtained by taking B but only looking at the vertical part.
That will be length of B times the sine of theta. That is how I got the area of a parallelogram as length A, length B, sine theta. And then I did this manipulation and this trick of rotating to find a nice formula. Yes. You are asking ahead of what I am going to do in a few minutes. You are asking about magnitude of A cross B. We are going to learn about cross products in a few minutes. And the answer is yes, but cross product is for vectors in space. Here I was simplifying things by doing things just in the plane. Just bear with me for five more minutes and we will do things in space. Yes. That is correct. The way you compute this in practice is you just do this. That is how you compute the determinant.
Yes. What about three dimensions? Three dimensions we are going to do now. More questions? Should we move on? OK. Let's move to space. There are two things we can do in space. And you can look for the volume of solids or you can look for the area of surfaces. Let me start with the easier of the two. Let me start with volumes of solids. And we will go back to area, I promise. I claim that there is also a notion of determinants in space. And that is going to tell us how to find volumes. Let's say that we have three vectors A, B and C. And then the definition of their determinants going to be, the notation for that in terms of the components is the same as over there.
We put the components of A, the components of B and the components of C inside verticals bars. And, of course, I have to give meaning to this. This will be a number. And what is that number? Well, the definition I will take is that this is a1 times the determinant of what I get by looking in this lower right corner. The two-by-two determinant b2, b3, c2, c3. Then I will subtract a2 times the determinant of b1, b3, c1, c3. And then I will add a3 times the determinant b1, b2, c1, c2. And each of these guys means, again, you take b2 times c3 minus c2 times b3 and this times that minus this time that and so on.
In fact, there is a total of six terms in here. And maybe some of you have already seen a different formula for three-by-three determinants where you directly have the six terms. It is the same definition. How to remember the structure of this formula? Well, this is called an expansion according to the first row. So we are going to take the entries in the first row, a1, a2, a3 And for each of them we get the term. Namely we multiply it by a two-by-two determinant that we get by deleting the first row and the column where we are. Here the coefficient next to a1, when we delete this column and this row, we are left with b2, b3, c2, c3. The next one we take a2, we delete the row that is in it and the column that it is in.
And we are left with b1, b3, c1, c3. And, similarly, with a3, we take what remains, which is b1, b2, c1, c2. Finally, last but not least, there is a minus sign here for the second guy. It looks like a weird formula. I mean it is a little bit weird. But it is a formula that you should learn because it is really, really useful for a lot of things. I should say if this looks very artificial to you and you would like to know more there is more in the notes, so read the notes. They will tell you a bit more about what this means, where it comes from and so on. If you want to know a lot more then some day you should take 18.06, Linear Algebra where you will learn a lot more about determinants in N dimensional space with N vectors.
And there is a generalization of this in arbitrary dimensions. In this class, we will only deal with two or three dimensions. Yes. Why is the negative there? Well, that is a very good question. It has to be there so that this will actually equal, well, what I am going to say right now is that this will give us the volume of [a box?] with sides A, B, C. And the formula just doesn't work if you don't put the negative.
There is a more fundamental reason which has to do with orientation of space and the fact that if you switch two coordinates in space then basically you change what is called the handedness of the coordinates. If you look at your right hand and your left hand, they are not actually the same. They are mirror images. And, if you squared two coordinate axes, that is what you get. That is the fundamental reason for the minus. Again, we don't need to think too much about that. All we need in this class is the formula.
Why do we care about this formula? It is because of the theorem that says that geometrically the determinant of the three vectors A, B, C is, again, plus or minus. This determinant could be positive or negative. See those minuses and all sorts of stuff. Plus or minus the volume of the parallelepiped. That is just a fancy name for a box with parallelogram sides, in case you wonder, with sides A, B and C. You take the three vectors A, B and C and you form a box whose sides are all parallelograms. And when its volume is going to be the determinant.
Other questions? I'm sorry. I cannot quite hear you. Yes. We are going to see how to do it geometrically without a determinant, but then you will see that you actually need a determinant to compute it no matter what. We are going to go back to this and see another formula for volume, but you will see that really I am cheating. I mean somehow computationally the only way to compute it is really to use a determinant.
That is correct. In general, I mean, actually, I could say if you look at the two-by-two determinant, see, you can also explain it in terms of this extension. If you take a1 and multiply by this one-by-one determinant b2, then you take a2 and you multiply it by this one-by-one determinant b1 but you put a minus sign. And in general, indeed, when you expand, you would stop putting plus, minus, plus, minus alternating. More about that in 18.06. Yes. There is a way to do it based on other rows as well, but then you have to be very careful with the sign vectors. I will refer you to the notes for that. I mean you could also do it with a column, by the way. I mean be careful about the sign rules.
Given how little we will use determinants in this class, I mean we will use them in a way that is fundamental, but we won't compute much. Let's say this is going to be enough for us for now. After determinants now I can tell you about cross product. And cross product is going to be the answer to your question about area. OK. Let me move onto cross product. Cross product is something that you can apply to two vectors in space. And by that I mean really in three-dimensional space. This is something that is specific to three dimensions. The definition A cross B --
It is important to really do your multiplication symbol well so that you don't mistake it with a dot product. Well, that is going to be a vector. That is another reason not to confuse it with dot product. Dot product gives you a number. Cross product gives you a vector. They are really completely different operations. They are both called product because someone could not come up with a better name, but they are completely different operations. What do we do to do the cross product of A and B? Well, we do something very strange. Just as I have told you that a determinant is something where we put numbers and we get a number, I am going to violate my own rule. I am going to put together a determinant in which --
Well, the last two rows are the components of the vectors A and B but the first row strangely consists for unit vectors i, j, k. What does that mean? Well, that is not a determinant in the usual sense. If you try to put that into your calculator, it will tell you there is an error. I don't know how to put vectors in there. I want numbers. What is means is it is symbolic notation that helps you remember what the formula is. The actual formula is, well, you use this definition. And, if you use that definition, you see that it is i hat times some number. Let me write it as determinant of a2, a3, b2, b3 times i hat minus determinant a1, a3, b1, b3, j hat plus a1, a2, b1, b2, k hat.
And so that is the actual definition in a way that makes complete sense, but to remember this formula without too much trouble it is much easier to think about it in these terms here. That is the definition and it gives you a vector. Now, as usual with definitions, the question is what is it good for? What is the geometric meaning of this very strange operation? Why do we bother to do that? Here is what it does geometrically. Remember a vector has two different things. It has a length and it has a direction. Let's start with the length. A length of a cross product is the area of the parallelogram in space formed by the vectors A and B.
Now, if you have a parallelogram in space, you can find its area just by doing this calculation when you know the coordinates of the points. You do this calculation and then you take the length. You take this squared plus that squared plus that squared, square root. It looks like a very complicated formula but it works and, actually, it is the simplest way to do it. This time we don't actually need to put plus or minus because the length of a vector is always positive. We don't have to worry about that. And what is even more magical is that not only is the length remarkable but the direction is also remarkable. The direction of A cross B is perpendicular to the plane of a parallelogram.
Our two vectors A and B together in a plane. What I am telling you is that for vector A cross B will point, will stick straight out of that plane perpendicularly to it. In fact, I would have to be more precise. There are two ways that you can be perpendicular to this plane. You can be perpendicular pointing up or pointing down. How do I decide which? Well, there is something called the right-hand rule.
What does the right-hand rule say? Well, there are various versions for right-hand rule depending on which country you learn about it. In France, given the culture, you even learn about it in terms of a cork screw and a wine bottle. I will just use the usual version here. You take your right hand. If you are left-handed, remember to take your right hand and not the left one. The other right, OK? Then place your hand to point in the direction of A. Let's say my right hand is going in that direction. Now, curl your fingers so that they point towards B. Here that would be kind of into the blackboard. Don't snap any bones. If it doesn't quite work then rotate your arms so that you can actually physically do it.
Then get your thumb to stick straight out. Well, here my thumb is going to go up. And that tells me that A cross B will go up. Let me write that down while you experiment with it. Again, try not to enjoy yourselves. First, your right hand points parallel to vector A. Then your fingers point in the direction of B. Then your thumb, when you stick it out, is going to point in the direction of A cross B.
Let's do a quick example. Where is my quick example? Here. Let's take i cross j. I see most of you going in the right direction. If you have it pointing in the wrong direction, it might mean that you are using your left hand, for example. Example, I claim that i cross j equals k. Let's see. I points towards us. J point to our right. I guess this is your right. I think. And then your thumb is going to point up. That tells us it is roughly pointing up. And, of course, the length should be one because if you take the unit square in the x, y plane, its area is one. And the direction should be vertical.
Because it should be perpendicular to the x, y plane. It looks like i cross j will be k. Well, let's check with the definition i, j, k. What is i? I is one, zero, zero. J is zero, one, zero. The coefficient of i will be zero times zero minus zero times one. That is zero. The coefficient of j will be one time zero minus zero times zero, that is a zero, minus zero j. It doesn't matter. And the coefficient of k will be one times one, that is one, minus zero times zero, so one k. So we do get i cross j equals k both ways. In this case, it is easier to do it geometrically. If I give you no complicated vectors, probably you will actually want to do the calculation.
Any questions? Yes. The coefficient of k, remember I delete the first row and the last column so I get this two-by-two determinant. And that two-by-two determinant is one times one minus zero times zero so that gives me a one. That is what you do with two-by-two determinants. Similarly for the others, but the others turn out to be zero. More questions? Yes. Let me repeat how I got the one in front of k. Remember the definition of a determinant I expand according to the entries in the first row. When I get to k what I do is delete the first row and I delete the last column, the column that contains k.
I delete these guys and these guys and I am left with this two-by-two determinant. Now, a two-by-two determinant, you multiply according to this downward diagonal and then minus this times that. One times one, let me see here, I got one k because that is one times one minus zero times zero equals one. Sorry. That is really hard to read. Maybe it will be easier that way. Yes. Let's try. If I do the same for i, I think I will also get zero. Let's do the same for i. I take i, I delete the first row, I delete the first column, I get this two-by-two determinant here and I get zero times zero, that is zero, minus zero times one.
That is the other trick question. Zero times one is zero as well. So that zero minus zero is zero. I hope on Monday you should get more practice in recitation about how to compute determinants. Hopefully, it will become very easy for you all to compute this next. I know the first time it is kind of a shock because there are a lot of numbers and a lot of things to do. Let me return to the question that you asked a bit earlier about how do you find actually volume if I don't want to know about determinants? Well, let's have another look at the volume. Let's say that I have three vectors.
Let me put them this way, A, B and C. And let's try to see how else I could think about the volume of this box. Probably you know that the volume of a parallelepiped is the area of a base times the height. Sorry. The volume is the area of a base times the height. How do we do that in practice? Well, what is the area of a base? The base is a parallelogram in space with sides B and C. How do we find the area of the parallelogram in space? Well, we just discovered that. We can do it by taking that cross product.
The area of a base, well, we take the cross product of B and C. That is not quite it because this is a vector. We would like a number while we take its length. That is pretty good. What about the height? Well, the height is going to be the component of A in the direction that is perpendicular to the base. Let's take a direction that is perpendicular to the base. Let's call that N, a unit vector in that direction. Then we can get the height by taking A dot n.
That is what we saw at the beginning of class that A dot n will tell me how much A goes in the direction of n. Are you still with me? OK. Let's keep going. Let's think about this vector n. How do I get it? Well, I can get it by actually using cross product as well. Because I said the direction perpendicular to two vectors I can get by taking that cross product and looking at that direction. This is still B cross C length. And this one is, so I claim, n can be obtained by taking D cross C. Well, that comes in the right direction but it is not a unit vector. How do I get a unit vector?
I divide by the length. Thanks. I take B cross C and I divide by length B cross C. Well, now I can probably simplify between these two guys. And so what I will get -- What I get out of this is that my volume equals A dot product with vector B cross C. But, of course, I have to be careful in which order I do it. If I do it the other way around, A dot B, I get a number. I cannot cross that. I really have to do the cross product first.
I get the new vector. Then my dot product. The fact is that the determinant of A, B, C is equal to this so-called triple product. Well, that looks good geometrically. Let's try to check whether it makes sense with the formulas, just one small thing. We saw the determinant is a1 times determinant b2, b3, c2, c3 minus a2 times something plus a3 times something. I will let you fill in the numbers. That is this guy. What about this guy? Well, dot product, we take the first component of A, that is a1, we multiply by the first component of B cross C. What is the first component of B cross C? Well, it is this determinant b2, b3, c2, c3.
If you put B and C instead of A and B into there you will get the i component is this guy plus a2 times the second component which is minus some determinant plus a3 times the third component which is, again, a determinant. And you can check. You get exactly the same expression, so everything is fine. There is no contradiction in math just yet. On Tuesday we will continue with this and we will start going into matrices, equations of planes and so on. Meanwhile, have a good weekend and please start working on your Problem Sets so that you can ask lots of questions to your TAs on Monday.