Section 6.3 The Dot Product
¶The goal of this section is to answer the following question. Given two vectors, what is the angle between them?
Since vectors have no position, we are free to place vectors wherever we like. If the two vectors are placed tail-to-tail, there is now a reasonable interpretation of the question: we seek the measure of the smallest angle between the two vectors, in the plane in which they lie. Figure 6.5 illustrates the situation.
Since the angle \(\theta\) lies in a triangle, we can compute it using a bit of trigonometry, namely, the law of cosines. Remember that the law of cosines states \(c^2 = a^2 + b^2 - 2ab \cos C\text{.}\)
The lengths of the sides of the triangle in Figure 6.5 are \(|\vect{v}|\text{,}\) \(|\vect{w}|\text{,}\) and \(|\vect{v}-\vect{w}|\text{.}\) Let \(\vect{v}=\langle v_1,v_2,v_3\rangle\) and \(\vect{w}=\langle w_1,w_2,w_3\rangle\text{;}\) then
A bit of simple arithmetic with the coordinates of \(\vect{v}\) and \(\vect{w}\) allows us to compute the cosine of the angle between them. If necessary we can use the arccosine to get \(\theta\text{,}\) but in many problems \(\cos\theta\) turns out to be all we really need.
The numerator of the fraction that gives us \(\cos\theta\) turns up a lot, so we give it a name and more compact notation: we call it the dot product, and write it as
This is the same symbol we use for ordinary multiplication, but there should never be any confusion; you can tell from context whether we are “multiplying” vectors or numbers. (We might also use the dot for scalar multiplication: \(a\cdot\vect{v}=a\vect{v}\text{;}\) again, it is clear what is meant from context.)
Example 6.4.
Find the angle between the vectors \(\vect{v}=\langle 1,2,1\rangle\) and \(\vect{w}=\langle 3,1,-5\rangle\text{.}\)
We know that \(\cos\theta=\vect{v}\cdot\vect{w}/(|\vect{v}||\vect{w}|)= (1\cdot3 + 2\cdot1 + 1\cdot(-5))/(|\vect{v}||\vect{w}|)=0\text{,}\) so \(\theta=\pi/2\text{,}\) that is, the vectors are perpendicular.
Example 6.5.
Find the angle between the vectors \(\vect{v}=\langle 3,3,0\rangle\) and \(\vect{w}=\langle 1,0,0\rangle\text{.}\)
We compute
so \(\theta=\pi/4\text{.}\)
The following are some special cases worth looking at.
Example 6.6.
Find the angles between:
\(\vect{v}\) and \(\vect{v}\)
\(\vect{v}\) and \(-\vect{v}\)
\(\vect{v}\) and \(\vect{0}=\langle 0,0,0\rangle\)
-
\begin{equation*} \begin{split} \cos\theta \amp= \vect{v}\cdot\vect{v}/(|\vect{v}||\vect{v}|) \\ \amp=(v_1^2+v_2^2+v_3^2)/ (\sqrt{v_1^2+v_2^2+v_3^2}\sqrt{v_1^2+v_2^2+v_3^2})=1, \end{split} \end{equation*}
so the angle between \(\vect{v}\) and itself is zero, which of course is correct.
-
\begin{equation*} \begin{split} \cos\theta\amp=\vect{v}\cdot-\vect{v}/(|\vect{v}||-\vect{v}|)\\ \amp=(-v_1^2-v_2^2-v_3^2)/ (\sqrt{v_1^2+v_2^2+v_3^2}\sqrt{v_1^2+v_2^2+v_3^2})=-1,\end{split} \end{equation*}
so the angle is \(\pi\text{,}\) that is, the vectors point in opposite directions, as of course we already knew.
-
\begin{equation*} \begin{split} \cos\theta\amp= \vect{v}\cdot\vect{0}/(|\vect{v}||\vect{0}|)\\ \amp=(0+0+0)/ (\sqrt{v_1^2+v_2^2+v_3^2}\sqrt{0^2+0^2+0^2}),\end{split} \end{equation*}
which is undefined. On the other hand, note that since \(\vect{v}\cdot\vect{0}=0\) it looks at first as if \(\cos\theta\) will be zero, which as we have seen means that vectors are perpendicular; only when we notice that the denominator is also zero do we run into trouble. One way to “fix” this is to adopt the convention that the zero vector \(\vect{0}\) is perpendicular to all vectors; then we can say in general that if \(\vect{v}\cdot\vect{w}=0\text{,}\) \(\vect{v}\) and \(\vect{w}\) are perpendicular.
Generalizing the examples, note the following useful facts:
If \(\vect{v}\) is parallel or anti-parallel to \(\vect{w}\) then \(\vect{v}\cdot\vect{w}/(|\vect{v}||\vect{w}|)=\pm1\text{,}\) and conversely, if \(\vect{v}\cdot\vect{w}/(|\vect{v}||\vect{w}|)=1\text{,}\) \(\vect{v}\) and \(\vect{w}\) are parallel, while if \(\vect{v}\cdot\vect{w}/(|\vect{v}||\vect{w}|)=-1\text{,}\) \(\vect{v}\) and \(\vect{w}\) are anti-parallel. (Vectors are parallel if they point in the same direction, anti-parallel if they point in opposite directions.)
If \(\vect{v}\) is perpendicular to \(\vect{w}\) then \(\vect{v}\cdot\vect{w}/(|\vect{v}||\vect{w}|)=0\text{,}\) and conversely if \(\vect{v}\cdot\vect{w}/(|\vect{v}||\vect{w}|)=0\) then \(\vect{v}\) and \(\vect{w}\) are perpendicular.
Given two vectors, it is often useful to find the projection of one vector onto the other, because this turns out to have important meaning in many circumstances. More precisely, given \(\vect{v}\) and \(\vect{w}\text{,}\) we seek a vector parallel to \(\vect{w}\) but with length determined by \(\vect{v}\) in a natural way, as shown in Figure 6.6. \(\vect{p}\) is chosen so that the triangle formed by \(\vect{v}\text{,}\) \(\vect{p}\text{,}\) and \(\vect{v}-\vect{p}\) is a right triangle.
Using a little trigonometry, we see that
this is sometimes called the scalar projection of \(\vect{v}\) onto \(\vect{w}\). To get \(\vect{p}\) itself, we multiply this length by a vector of length one parallel to \(\vect{w}\text{:}\)
Be sure that you understand why \(\vect{w}/|\vect{w}|\) is a vector of length one (also called a unit vector ) parallel to \(\vect{w}\text{.}\)
The discussion so far implicitly assumed that \(0\le\theta\le\pi/2\text{.}\) If \(\pi/2\lt \theta\le\pi\text{,}\) the picture is like Figure 6.7. In this case \(\vect{v}\cdot \vect{w}\) is negative, so the vector
is anti-parallel to \(\vect{w}\text{,}\) and its length is
In general, the scalar projection of \(\vect{v}\) onto \(\vect{w}\) may be positive or negative. If it is negative, it means that the projection vector is anti-parallel to \(\vect{w}\) and that the length of the projection vector is the absolute value of the scalar projection. Of course, you can also compute the length of the projection vector as usual, by applying the distance formula to the vector.
Note that the phrase “projection onto \(\vect{w}\)” is a bit misleading if taken literally; all that \(\vect{w}\) provides is a direction; the length of \(\vect{w}\) has no impact on the final vector. In Figure 6.8, for example, \(\vect{w}\) is shorter than the projection vector, but this is perfectly acceptable.
Physical force is a vector quantity. It is often necessary to compute the “component” of a force acting in a different direction than the force is being applied.
Example 6.7. Components of Force Vector.
Suppose a ten pound weight is resting on an inclined plane—a pitched roof, for example. Gravity exerts a force of ten pounds on the object, directed straight down. It is useful to think of the component of this force directed down and parallel to the roof, and the component down and directly into the roof. These forces are the projections of the force vector onto vectors parallel and perpendicular to the roof. Suppose the roof is tilted at a \(30^\circ\) angle, as in Figure 6.9. Compute the component of the force directed down the roof and the component of the force directed into the roof.
A vector parallel to the roof is \(\langle-\sqrt3,-1\rangle\text{,}\) and a vector perpendicular to the roof is \(\langle 1,-\sqrt3\rangle\text{.}\) The force vector is \(\vect{F}=\langle 0,-10\rangle\text{.}\) The component of the force directed down the roof is then
with length 5. The component of the force directed into the roof is
with length \(5\sqrt3\text{.}\) Thus, a force of 5 pounds is pulling the object down the roof, while a force of \(5\sqrt3\) pounds is pulling the object into the roof.
The dot product has some familiar-looking properties that will be useful later, so we list them here. These may be proved by writing the vectors in coordinate form and then performing the indicated calculations; subsequently it can be easier to use the properties instead of calculating with coordinates.
Theorem 6.8. Dot Product Properties.
If \(\vect{u}\text{,}\) \(\vect{v}\text{,}\) and \(\vect{w}\) are vectors and \(a\) is a real number, then
\(\ds \vect{u}\cdot\vect{u} = |\vect{u}|^2\)
\(\vect{u}\cdot\vect{v} = \vect{v}\cdot\vect{u}\)
\(\vect{u}\cdot(\vect{v}+\vect{w}) = \vect{u}\cdot\vect{v}+\vect{u}\cdot\vect{w}\)
\((a\vect{u})\cdot\vect{v}=a(\vect{u}\cdot\vect{v}) =\vect{u}\cdot(a\vect{v})\)
Exercises for Section 6.3.
Exercise 6.3.1.
Find \(\langle 1,1,1\rangle\cdot\langle 2,-3,4\rangle\text{.}\)
Answer\(3\)
Exercise 6.3.2.
Find \(\langle 1,2,0\rangle\cdot\langle 0,0,57\rangle\text{.}\)
Answer\(0\)
Exercise 6.3.3.
Find \(\langle 3,2,1\rangle\cdot\langle 0,1,0\rangle\text{.}\)
Answer\(2\)
Exercise 6.3.4.
Find \(\langle -1,-2,5\rangle\cdot\langle 1,0,-1 \rangle\text{.}\)
Answer\(-6\)
Exercise 6.3.5.
Find \(\langle 3,4,6\rangle\cdot\langle 2,3,4\rangle\text{.}\)
Answer\(42\)
Exercise 6.3.6.
Find the cosine of the angle between \(\langle 1,2,3\rangle\) and \(\langle 1,1,1\rangle\text{;}\) use a calculator if necessary to find the angle.
Answer\(\sqrt6/\sqrt7\text{,}\) \(\approx 0.39\)
Exercise 6.3.7.
Find the cosine of the angle between \(\langle -1, -2,-3\rangle\) and \(\langle 5,0,2\rangle\text{;}\) use a calculator if necessary to find the angle.
Answer\(-11\sqrt{14}\sqrt{29}/406\text{,}\) \(\approx 2.15\)
Exercise 6.3.8.
Find the cosine of the angle between \(\langle 47,100,0\rangle\) and \(\langle 0,0,5\rangle\text{;}\) use a calculator if necessary to find the angle.
Answer\(0\text{,}\) \(\pi/2\)
Exercise 6.3.9.
Find the cosine of the angle between \(\langle 1,0,1 \rangle\) and \(\langle 0,1,1\rangle\text{;}\) use a calculator if necessary to find the angle.
Answer\(1/2\text{,}\) \(\pi/3\)
Exercise 6.3.10.
Find the cosine of the angle between \(\langle 2,0,0\rangle\) and \(\langle -1,1,-1\rangle\text{;}\) use a calculator if necessary to find the angle.
Answer\(-1/\sqrt3\text{,}\) \(\approx 2.19\)
Exercise 6.3.11.
Find the angle between the diagonal of a cube and one of the edges adjacent to the diagonal.
Answer\(\arccos(1/\sqrt3)\approx 0.96\)
Exercise 6.3.12.
Find the scalar and vector projections of \(\langle 1,2,3\rangle\) onto \(\langle 1,2,0\rangle\text{.}\)
Answer\(\sqrt{5}\text{,}\) \(\langle 1,2,0\rangle\text{.}\)
Exercise 6.3.13.
Find the scalar and vector projections of \(\langle 1,1,1\rangle\) onto \(\langle 3,2,1\rangle\text{.}\)
Answer\(3\sqrt{14}/7\text{,}\) \(\langle 9/7,6/7,3/7\rangle\text{.}\)
Exercise 6.3.14.
A force of 10 pounds is applied to a wagon, directed at an angle of \(30^\circ\text{.}\) Find the component of this force pulling the wagon straight up, and the component pulling it horizontally along the ground.
Answer\(\langle 0,5\rangle\text{,}\) \(\langle 5\sqrt3,0\rangle\)
Exercise 6.3.15.
A force of 15 pounds is applied to a wagon, directed at an angle of \(45^\circ\text{.}\) Find the component of this force pulling the wagon straight up, and the component pulling it horizontally along the ground.
Answer\(\langle 0,15\sqrt2/2\rangle\text{,}\)\(\langle 15\sqrt2/2,0\rangle\)
Exercise 6.3.16.
Use the dot product to find a non-zero vector \(\vect{w}\) perpendicular to both \(\vect{u}=\langle 1,2,-3\rangle\) and \(\vect{v}=\langle 2,0,1\rangle\text{.}\)
AnswerAny vector of the form \(\langle a, -7a/2, -2a\rangle\)
Exercise 6.3.17.
Let \(\vect{x}=\langle 1,1,0 \rangle\) and \(\vect{y}=\langle 2,4,2 \rangle\text{.}\) Find a unit vector that is perpendicular to both \(\vect{x}\) and \(\vect{y}\text{.}\)
Answer\(\langle 1/\sqrt3,-1/\sqrt3,1/\sqrt3\rangle\)
Exercise 6.3.18.
Do the three points \((1,2,0)\text{,}\) \((-2,1,1)\text{,}\) and \((0,3,-1)\) form a right triangle?
AnswerNo.
Exercise 6.3.19.
Do the three points \((1,1,1)\text{,}\) \((2,3,2)\text{,}\) and \((5,0,-1)\) form a right triangle?
AnswerYes.
Exercise 6.3.20.
Show that \(|\vect{v}\cdot\vect{w}|\le|\vect{v}||\vect{w}|\)
Exercise 6.3.21.
Let \(\vect{x}\) and \(\vect{y}\) be perpendicular vectors. Use Theorem 6.8 to prove that \(|\vect{x}|^2+|\vect{y}|^2=|\vect{x}+\vect{y}|^2\text{.}\) What is this result better known as?
Exercise 6.3.22.
Prove that the diagonals of a rhombus intersect at right angles.
Exercise 6.3.23.
Suppose that \(\vect{z}=|\vect{x}| \vect{y} + |\vect{y}| \vect{x}\) where \(\vect{x}\text{,}\) \(\vect{y}\text{,}\) and \(\vect{z}\) are all nonzero vectors. Prove that \(\vect{z}\) bisects the angle between \(\vect{x}\) and \(\vect{y}\text{.}\)
Exercise 6.3.24.
Prove Theorem 6.8.