Roberto s Notes on Linear Algebra Chapter 1: Geometric ectors Section 8 The dot product What you need to know already: What a linear combination of ectors is. What you can learn here: How to use two ectors to obtain a scalar that contains important information about the two ectors. So far we hae seen how to add ectors and how to multiply a ector by a scalar, two operations that combine to generate linear combinations. But there is also a ery useful way of multiplying two ectors together, useful in that it will allow us to perform all kinds of computations and explore all kinds of interesting concepts and applications. It is a strange product, though, in the sense that it produces something that is different from both of the two items that we multiply together. Definition The scalar product, or dot product of two 2D ectors u and is denoted by u and is computed as the sum of the products of the components in corresponding positions. In formula: u u u u u 1 2 1 2 1 1 2 2 Of course the idea can be easily extended to 3D ectors. Definition The scalar product, or dot product of two 3D ectors u and is denoted by u and is computed as the sum of the products of the components in corresponding positions. In formula: u u u u u u u 1 2 3 1 2 3 1 1 2 2 3 3 Knot on your finger Notice that the dot product of any two ectors is always a scalar. Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 1
Is it called a scalar product because it creates a scalar from two ectors? Yes, although I will most often use the expression dot product, so as to aoid confusion with the scalar multiplication, which combines not two ectors, but a scalar and a ector. (You may remember that I pointed to this issue in Section 1.6) And what is the dot product good for? The dot product has many interesting and useful applications that in a short time will become second nature to you, if you don t know them already from other courses. But watch out, because soon we shall inestigate not only the dot product, but its ery properties. So, pay attention not only to the mechanical side of the formulae, but also to their meaning and workings. Here are some simple and familiar algebraic properties to get us started: Technical fact: Algebraic properties of the dot product The dot product is commutatie, meaning that if we multiply the two ectors in reerse order we obtain the same result: u u The dot product is distributie with respect to ector addition, meaning that the FOIL process applies to it: a + b u + = a u + a + b u + b The dot product is associatie with respect to scalar multiplication, meaning that a scalar multiple can be attached to any factor of the product: u u u c c c The dot product is positie definite, meaning that if is any non-zero ector, then 0, while 00 0. Proof Commutatiity is a consequence of the fact that the dot product is based on the usual addition and multiplication, both of which are commutatie. I will leae to you the proof of the distributiity with respect to ector addition, which goes along the same lines as the other one, coming up To proe that the dot product is associatie with respect to scalar multiplication, all we need to do is look at what the three combinations of operations presented do on the components. I will do so in 2D, since the 3D case is exactly the same, just longer: u u u c c u u cu cu 1 1 2 2 1 1 2 2 c cu cu cu cu 1 2 1 2 1 1 2 2 c u u c c u c u c 1 2 1 2 1 1 2 2 and since the usual product of scalars is commutatie, all three combinations do proide the same thing. The proof of the positie definite property follows immediately from the definition and you may want to check it as an exercise. Snore, snore snore I suggest you wake up, as there may be some tricky details to consider, such as the following. Knot on your finger The dot product is associatie with respect to the scalar multiplication, but it is NOT associatie by itself. What do you mean by itself? Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 2
Associatiity is usually a property of a single operation and it refers to how we can combine three objects by using the operation twice. For the dot product that does not work, as you will discoer in the Checkpoint. But I must agree that this algebraic gymnastic is rather boring unless math is your hobby or profession. These properties will become more releant later, but let us now look at some ery simple and useful geometric properties whose alue should be rather clear. Technical fact: Geometric properties of the dot product The length of any geometric ector is gien by: If u and are any two geometric ectors and is the angle between them, that is, the smaller angle between two of their representatie arrows with the same tail, then: u u cos If u and are any two geometric ectors and is the angle between them, then: cos u u Two geometric ectors u and are orthogonal (that is, perpendicular) if and only if their dot product is 0. Before I gie you the formal proof of these statements, let us see how they work in some familiar cases. Example: The ectors 2 0 and 33 form a 45º angle (check it thou out!), so the ratio that is purported to equal the cosine of the angle should equal cos 45. Let s see: u 2 03 3 6 6 1 u 2 02 0 3 33 3 4 18 2 29 2 Yep! It works! The ectors 1 0 3 and ratio that is purported to equal the cosine of the angle should equal cos90º, which is 0. Let s see: u 1 0 30 4 0 0 0 u 1 0 3 1 0 3 0 4 0 0 4 0 10 16 It works again! 0 4 0 form a 90º angle (check it out!), so the Hopefully these examples hae already gien you a glimpse of why the statements are true in general. But remember that a big part of linear algebra is checking proofs, and this is one situation where the needed proofs are simple enough that you can follow them, but require enough different ideas and are general enough that your undiided attention is needed. Proof Length: First we need to show that simply by checking: Angle: 2 2 for any ector. This is done 1 2 1 2 1 1 2 2 Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 3
To show that u = u cos we shall use the law of cosines, which states that if a, b and c are the three sides of any triangle and is the angle 2 2 2 between a and b, then c a b 2ab cos. Now let us use representatie arrows of u and starting at the same point and consider the representatie arrow for -u that starts at the tip of u. Because of the triangle rule, this configuration creates a triangle, as shown in the figure. We now apply the law of cosines to it and obtain: 2 2 2 - u = u + - 2 u cos But the preious property of the dot product implies that the square of the length of a ector equals the dot product of the ector with itself. Therefore: -u -u = u u + - 2 u cos We can now use the algebraic properties of the dot product to change the appearance of the left side: By distributiity: By associatiity: -u -u = + -u + -u + -u -u By commutatiity: u u = u u + u u = u u + u u And by regular algebra of scalars: = 2u +u u We are almost there! If we now use this expression as the left side of the law of cosines equation, we obtain: 2u + u u = u u + - 2 u cos And by cancelling the two pairs of like terms we obtain: 2u = -2 u cos u = u cos Just the property that we needed to proe! Notice that although the picture that I used suggests a proof in 2D, exactly the same proof works in 3D, since the cosine law applies to any triangle in any plane! If we moe the product of the two lengths in the last equation to the left side, we obtain the formula for the cosine of the angle between two ectors (and hence the angle itself). Notice that this formula generates the cosine by using only the components of the two ectors: trigonometry by using only addition and multiplication! Ain t it neat? Orthogonality: Two geometric ectors are perpendicular if and only if the angle between them is /2 (90 if you prefer, since here we are dealing with static angles). But the cosine of this angle is 0, hence the property. Do you see now why I presented the algebraic properties of the dot product first? Because you needed them to proe the geometric properties! Yes, and this is another example of how algebra, boring as it may seem, is behind many useful applications. Too bad that people see and enjoy the applications, but refuse to see the releance of the tools that make them possible. But I am digressing, let s see two more examples. Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 4
Example: The ectors 3 4 0 and 9 12 5 3 form a 30º angle. It is possible to proe this by using the fact that the second ector is straight aboe the first and its length is twice its third component, but that is somewhat inoled (see if you can do it, though). But if we use the relation between dot product and cosine we get: cos u u 3 4 0 9 12 5 3 3 4 0 3 4 0 9 12 5 3 9 12 5 3 27 48 75 75 3 3 9 16 81144 75 25 300 510 3 2 3 2 But if the cosine has this alue, the angle must be 30º. Very simple eh? And after seeing something ery effectie, let me show you something really weird. Do you remember that we agreed that the zero ector is parallel to any ector? Well, look at this: Technical fact The zero ector is perpendicular to any ector, both in 2D and 3D. The proof of this fact is practically obious, but notice that it tells us that the zero ector is a ery special ector, since it is both parallel and perpendicular to any ector. This will pop up again in the future. Example: What is the angle between 2 7 4 out geometrically is mind-boggling, but look: cos u u and 2 1 5? Figuring this one 2 7 42 1 5 2 7 42 7 4 2 1 52 1 5 4 7 20 9 69 30 2070 If we now want the angle, we use our friendly calculator to obtain: cos 78.6 2070 1 9 Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 5
Summary The dot product uses a simple arithmetic formula that only inoles the components of the two ectors inoled. The dot product can proide useful information about both lengths and angles of the ectors inoled. According to our definitions, the zero ector is both parallel and perpendicular to any other ector. Common errors to aoid The formulae that proide lengths and angles in terms of the dot product are simple, but not triial: make sure to memorize and use them properly. You may think that the proofs of the key properties shown in the section need not be understood. Think again! They contain important steps and properties with which you need to become familiar, so do not underestimate their importance and make sure you do understand them. Learning questions for Section LA 1-8 Reiew questions: 1. Describe how to perform the dot product of two ectors. 2. Explain how the dot product proides information about the length of a ector. 3. Explain how the dot product proides information about the angle between two ectors. Memory questions: 1. Which formula defines the dot product for 2D ectors? 2. Which formula defines the dot product for 3D ectors? 3. Which formula proides the connection between dot product and the length of a ector? 4. Which formula proides the connection between dot product and the angle between two ectors? 5. What is the dot product of two perpendicular ectors? Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 6
Computation questions: Compute the dot products presented in questions 1-4. 1. 3 2 4 3 2. 2 3 4 3 3. 1 0 2 3 4 1 4. 2 1 2 3 4 1 5. Determine whether the ectors 1 5 7 and 4 2 2 to each other. 6. Determine whether the ectors 1 7 5 and 2 4 2 to each other. are perpendicular are perpendicular 7. Find all alues of k for which the ectors k k 2, 3 k 1 parallel and those for which they are perpendicular, if any! u are 8. Determine the alue(s) of k for which the ectors a k b, parallel and those for which they are perpendicular, if any! 9. Find all alues of k (if any) for which the ectors 3 1 2, 2 k 1 u form an angle of: a) /4 b) /2 c k k are 10. Find all alues of k (if any) for which the ectors uk 4 2, 3 k 1 form an angle of: a) /4 b) /2 11. Find all alues of k (if any) for which the ectors u k 4 2, 10 k 10 form an angle of: a) /3 b) /2 12. Find all alues of k, if any, for which the ectors u 2 k k 2, 3 k 1 are: a) at a /4 angle b) orthogonal 13. Gien the ectors u 12kand 3 6 9 for which, respectiely: a) u and are parallel; b) u and are perpendicular; c) the projection of u on has length 1. 14. Gien that u 13, 21and w 2 3 2u wu w is perpendicular to w., determine the alues of k, determine if the ector 15. Determine whether the ectors u 3 2 5 and 2 8 3 form an acute or an obtuse. 16. Construct a linear combination of the ectors 1 2 3 3 1 2 that is orthogonal to 2 3 1 explain why such a ector does not exist. 17. Construct a ector perpendicular to 1 2 3. 18. Construct a ector perpendicular to 23. u and w and has length 21, or Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 7
In questions 19-20, determine whether the two gien ectors form an acute or an obtuse angle. 19. u 3, 2, 2 and 1, 2, 5 20. u 3, 2, 5 and 2, 3, 3 21. Gien the point P 2,4, 1 and the ector 6 1 2 of the arrow whose tail is at P and that represents, respectiely: a) a non-zero ector parallel to ; b) a non-zero ector orthogonal to., find the tip 22. Gien the points P 2,4, 1 and 6, 1, 2 a) two different unit ectors parallel to PQ ; Q, find: b) two non-parallel ectors both orthogonal to PQ. Theory questions: Determine which of the expressions inoling ectors and scalar and presented in questions 1-4 are meaningful and which ones are not. Proide a suitable rationale in each case. 1. u w 2. u u w 3. k u w 4. k u u w 5. Which ector operation assigns to each pair of ectors a scalar? 6. Which linear algebra relation is satisfied by orthogonal ectors? 7. Proide one ector orthogonal to i 8. If u and are ectors of the same dimension, is the quantity u u scalar, a ector, or undefined? 9. Why is the expression a b c meaningless? 5 a 10. What geometrical information can be obtained through the dot product? Proof questions: 1. Proe that the dot product is distributie with respect to ector addition. 2. Check that the dot product is positie definite. Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 8
3. Proe that any ector orthogonal to 1 2 n k k. 2 1 is of the form 4. Deelop a method to construct a ector perpendicular to a gien ector 1 2 in 2D. 5. Deelop a method to construct a ector perpendicular to a gien ector 1 2 3 in 3D. Notice that this is not exactly the same as for the preious question, since a little extra step is required. 7. Explain why two ectors u and form an acute angle if the dot product u is positie and an obtuse angle if such dot product is negatie. 8. Explain why the dot product is not associatie. 9. Gien a ector abc and has half its length., construct a ector w that is perpendicular to it 10. Show that there are infinitely many ectors w orthogonal to a gien 3D ector. 6. Use the dot product and its properties (that is, no geometry) to proe that if u 2 2 2 and are orthogonal geometric ectors, u u and 2 2 2 u u. Do you recognize these two statements as a ery famous geometrical fact? Application questions: 1. If u and are orthogonal ectors, write the Pythagorean identities that link them in terms of dot products. 2. Use the notation and properties of dot products and of ector magnitudes to show that the points P 3, 2, Q 1, 2 and R, 1 by showing that: a) two of their sides are perpendicular b) the three sides satisfy the Pythagorean theorem. 1 form a right triangle 3. Use the dot product and the parallelogram rule for the addition of ectors to proe that in a parallelogram, the sum of the squares of the two diagonals equals the sum of the squares of all four sides. 4. Obtain a proof of the same statement gien in the preious question, but without using linear algebra methods, that is, by using basic plane geometry and trigonometry. Which is easier? Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 9
Templated questions: 1. Pick any two ectors and compute their dot product. 2. Pick any two ectors and compute the angle they form. What questions do you hae for your instructor? Linear Algebra Chapter 1: Geometric ectors Section 8: The dot product Page 10