The Dot Product

Learning Objectives

  • Calculate the dot product of two given vectors.
  • Determine whether two given vectors are perpendicular.
  • Find the direction cosines of a given vector.

The Dot Product and Its Properties

We have already learned how to add and subtract vectors. In this chapter, we investigate two types of vector multiplication. The first type of vector multiplication is called the dot product, based on the notation we use for it, and it is defined as follows:

definition


The dot product of vectors [latex]\mathbf{u} = \langle u_1, u_2, u_3 \rangle[/latex] and [latex]\mathbf{v} =\langle v_1, v_2, v_3 \rangle[/latex] is given by the sum of the products of the components

[latex]\mathbf{u \cdot v}[/latex][latex] = u_1v_1 + u_2v_2 + u_3v_3 [/latex].

Note that if [latex]\mathbf u[/latex] and [latex]\mathbf v[/latex] are two-dimensional vectors, we calculate the dot product in a similar fashion. Thus, if [latex]\mathbf{u} = \langle u_1, u_2\rangle[/latex] and [latex]\mathbf{v} =\langle v_1, v_2 \rangle[/latex], then

[latex]\mathbf{u \cdot v}[/latex][latex] = u_1v_1 + u_2v_2 [/latex].
When two vectors are combined under addition or subtraction, the result is a vector. When two vectors are combined using the dot product, the result is a scalar. For this reason, the dot product is often called the scalar product. It may also be called the inner product.

Example: calculating dot products

  1. Find the dot product of [latex]\mathbf{u} = \langle 3,5,2 \rangle[/latex] and [latex]\mathbf{v} =\langle -1,3,0 \rangle[/latex].
  2. Find the scalar product of [latex]\mathbf{p} = 10\mathbf{i} - 4\mathbf{j} +7 \mathbf{k}[/latex] and [latex]\mathbf{q} = -2\mathbf{i} + \mathbf{j} + 6\mathbf{k}[/latex].

try it

Find [latex]\mathbf{u \cdot v}[/latex], where [latex]\mathbf{u} = \langle 2,9,-1 \rangle[/latex] and [latex]\mathbf{v} =\langle -3,1,-4 \rangle[/latex].

Watch the following video to see the worked solution to the above Try IT.

You can view the transcript for “CP 2.21” here (opens in new window).

Try It

Like vector addition and subtraction, the dot product has several algebraic properties. We prove three of these properties and leave the rest as exercises.

theorem: properties of the dot product


Let [latex]\textbf u[/latex], [latex]\textbf v[/latex], and [latex]\textbf w[/latex] be vectors, and let [latex]c[/latex] be a scalar.

\[ \begin{array}{lrl}
\mbox{i.} & \mathbf{u \cdot v} &= \mathbf{v \cdot u} & \mbox{Commutative property} \\
\mbox{ii.} & \mathbf{u} \cdot (\mathbf{v} + \textbf{w}) &= \mathbf{u \cdot v} + \mathbf{u \cdot w} & \mbox{Distributive property} \\
\mbox{iii.} & c(\mathbf{u \cdot v}) &= (c\mathbf{u}) \cdot \mathbf{v} = \mathbf{u} \cdot (c\mathbf{v}) & \mbox{Associative property} \\
\mbox{iv.} & \mathbf{v} \cdot \mathbf{v} &= ||\mathbf{v}||^2 & \mbox{Property of magnitude} \\
\end{array}\]

Proof

Let [latex]\mathbf{u} = \langle u_1, u_2, u_3 \rangle[/latex] and [latex]\mathbf{v} =\langle v_1, v_2, v_3 \rangle[/latex]. Then


[latex] \begin{align*} \mathbf{u \cdot v} &= \langle u_1, u_2, u_3 \rangle \cdot \langle v_1, v_2, v_3 \rangle\\ &= u_1v_1 + u_2v_2 + u_3v_3\\ &= v_1u_1 + v_2u_2 + v_3u_3\\ &= \langle v_1, v_2, v_3 \rangle \cdot \langle u_1, u_2, u_3 \rangle\\ &= \mathbf{v \cdot u}.\\ \end{align*} [/latex]

The associative property looks like the associative property for real-number multiplication, but pay close attention to the difference between scalar and vector objects:


[latex] \begin{align*} c (\mathbf{u \cdot v}) &= c(u_1v_1 + u_2v_2 + u_3v_3)\\ &= c(u_1v_1) + c(u_2v_2) + c(u_3v_3)\\ &= (cu_1)v_1 + (cu_2)v_2 + (cu_3)v_3\\ &= \langle cu_1, cu_2, cu_3 \rangle \cdot \langle v_1, v_2, v_3 \rangle\\ &= c\langle u_1, u_2,u_3 \rangle \cdot \langle v_1, v_2, v_3 \rangle\\ &= (c\mathbf{u}) \cdot \mathbf{v}.\\ \end{align*} [/latex]

The proof that [latex]c (\mathbf{u \cdot v}) = \mathbf{u}\cdot (c\mathbf{v})[/latex] is similar.

The fourth property shows the relationship between the magnitude of a vector and its dot product with itself:


[latex] \begin{align*} \mathbf{v} \cdot \mathbf{v} &= \langle v_1, v_2, v_3 \rangle \cdot \langle v_1, v_2, v_3 \rangle\\ &= (v_1)^2 + (v_2)^2 + (v_3)^2\\ &= [\sqrt{(v_1)^2 + (v_2)^2 + (v_3)^2}]^2\\ &= ||\mathbf{v}||^2.\\ \end{align*} [/latex]
[latex]_\blacksquare[/latex]

Note that the definition of the dot product yields [latex]\mathbf{0} \cdot \mathbf{v} = \mathbf{0}[/latex]. By property iv., if [latex]\mathbf{v} \cdot \mathbf{v} = 0[/latex], then [latex]\mathbf{v} = \mathbf{0}[/latex].

Example: using properties of the dot product

Let [latex]\mathbf{a} = \langle 1,2,-3 \rangle[/latex], [latex]\mathbf{b} = \langle 0,2,4 \rangle[/latex], and [latex]\mathbf{c} = \langle 5,-1,3 \rangle[/latex]. Find each of the following products.

  1. [latex](\mathbf{a} \cdot \mathbf{b})\mathbf{c} [/latex]
  2. [latex]\mathbf{a}\cdot (2\mathbf{c} )[/latex]
  3. [latex]||\mathbf{b}||^2[/latex]

try it

Find the following products for [latex]\mathbf{p} = \langle 7,0,2 \rangle[/latex], [latex]\mathbf{q} = \langle -2,2,-2 \rangle[/latex], and [latex]\mathbf{r} = \langle 0,2,-3 \rangle[/latex].

  1. [latex](\mathbf{r} \cdot \mathbf{p})\mathbf{q}[/latex]
  2. [latex]||\mathbf{p}||^2[/latex]

Using the Dot Product to Find the Angle between Two Vectors

When two nonzero vectors are placed in standard position, whether in two dimensions or three dimensions, they form an angle between them (Figure 1). The dot product provides a way to find the measure of this angle. This property is a result of the fact that we can express the dot product in terms of the cosine of the angle formed by two vectors.

This figure is two vectors with the same initial point. The first vector is labeled “u,” and the second vector is labeled “v.” The angle between the two vectors is labeled “theta.”

Figure 1. Let [latex]θ[/latex] be the angle between two nonzero vectors [latex]{\bf{u}}[/latex] and [latex]{\bf{v}}[/latex] such that [latex]0≤θ≤π[/latex].

theorem: evaluating a dot product


The dot product of two vectors is the product of the magnitude of each vector and the cosine of the angle between them:

[latex]\mathbf{u} \cdot \mathbf{v} = ||\mathbf{u} ||\;||\mathbf{v} ||\cos{\theta}[/latex].

Proof

Place vectors [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] in standard position and consider the vector [latex]\mathbf{v} - \mathbf{u}[/latex] (Figure 2). These three vectors form a triangle with side lengths [latex]||\mathbf{u}||[/latex], [latex]||\mathbf{v}||[/latex], and [latex]||\mathbf{v} - \mathbf{u}||[/latex].

This figure is two vectors with the same initial point. The first vector is labeled “u,” and the second vector is labeled “v.” The angle between the two vectors is labeled “theta.” There is also a third vector from the terminal point of vector u to the terminal point of vector v. It is labeled “v – u.”

Figure 2. The lengths of the sides of the triangle are given by the magnitudes of the vectors that form the triangle.

cosines describes the relationship among the side lengths of the triangle and the angle [latex]\theta[/latex]. Applying the law of cosines here gives

[latex]||\mathbf{v} - \mathbf{u}||^2 = ||\mathbf{u}||^2 + ||\mathbf{v}||^2 - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}[/latex].

The dot product provides a way to rewrite the left side of this equation:


[latex] \begin{align*} ||\mathbf{v} - \mathbf{u}||^2 &= (\mathbf{v} - \mathbf{u}) \cdot (\mathbf{v} - \mathbf{u})\\ &= (\mathbf{v} - \mathbf{u}) \cdot \mathbf{v}-(\mathbf{v} - \mathbf{u}) \cdot \mathbf{u}\\ &= \mathbf{v} \cdot \mathbf{v} - \mathbf{u} \cdot \mathbf{v} - \mathbf{v} \cdot \mathbf{u}+\mathbf{u} \cdot \mathbf{u}\\ &= \mathbf{v} \cdot \mathbf{v} - \mathbf{u} \cdot \mathbf{v} - \mathbf{u} \cdot \mathbf{v}+\mathbf{u} \cdot \mathbf{u}\\ &= ||\mathbf{v}||^2 - 2 \mathbf{u} \cdot \mathbf{v} + ||\mathbf{u}||^2.\\ \end{align*} [/latex]

Substituting into the law of cosines yields

[latex] \begin{align*} ||\mathbf{v} - \mathbf{u}||^2 &= ||\mathbf{u}||^2 + ||\mathbf{v}||^2 - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}\\ ||\mathbf{v}||^2 - 2 \mathbf{u} \cdot \mathbf{v} + ||\mathbf{u}||^2 &= ||\mathbf{u}||^2 + ||\mathbf{v}||^2 - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}\\ - 2 \mathbf{u} \cdot \mathbf{v} &= - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}\\ \mathbf{u} \cdot \mathbf{v} &= ||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}.\\ \end{align*} [/latex]
[latex]_\blacksquare[/latex]

We can use this form of the dot product to find the measure of the angle between two nonzero vectors. The following equation rearranges the Dot Product to solve for the cosine of the angle:

[latex]\cos{\theta} = \frac{\mathbf{u} \cdot \mathbf{v}}{||\mathbf{u}||\;||\mathbf{v}||}[/latex].

Using this equation, we can find the cosine of the angle between two nonzero vectors. Since we are considering the smallest angle between the vectors, we assume [latex]0^\circ \leq \theta \leq 180^\circ[/latex] (or [latex]0 \leq \theta \leq \pi[/latex] if we are working in radians). The inverse cosine is unique over this range, so we are then able to determine the measure of the angle [latex]\theta[/latex].

Example: finding the angle between two vectors

Find the measure of the angle between each pair of vectors.

  1. [latex]\mathbf{i} + \mathbf{j} + \mathbf{k}[/latex] and [latex]2\mathbf{i} - \mathbf{j} - 3\mathbf{k}[/latex]
  2. [latex]\langle 2,5,6 \rangle [/latex] and [latex]\langle -2,-4,4 \rangle [/latex]

try it

Find the measure of the angle, in radians, formed by vectors [latex]\mathbf{a} = \langle 1,2,0 \rangle [/latex] and [latex]\mathbf{b} = \langle 2,4,1 \rangle[/latex]. Round to the nearest hundredth.

The angle between two vectors can be acute [latex](0 < \cos{\theta} < 1) [/latex], obtuse [latex](-1 < \cos{\theta} < 0)[/latex], or straight [latex](\cos{\theta} = -1)[/latex]. If [latex]\cos{\theta} = 1[/latex], then both vectors have the same direction. If [latex]\cos{\theta} = 0[/latex], then the vectors, when placed in standard position, form a right angle (Figure 3). We can formalize this result into a theorem regarding orthogonal (perpendicular) vectors.

This figure has 5 images. The first image has two vectors u and v. The angle between these two vectors is theta. Theta is an acute angle. The second image is has two vectors u and v. The angle between these vectors is theta. Theta is an obtuse angle. The third image is vectors u and v in opposite directions. The angle between u and v is a straight angle. The fourth image is u and v in the same direction. The fifth image is u and v with angle theta between them as a right angle.

Figure 3. (a) An acute angle has [latex]0< \cos{\theta}<1[/latex]. (b) An obtuse angle has [latex]−1<\cos\theta<0[/latex]. (c) A straight line has [latex]\cos\theta=−1[/latex]. (d) If the vectors have the same direction, [latex]\cos\theta=1[/latex]. (e) If the vectors are orthogonal (perpendicular), [latex]\cos\theta=0[/latex]

theorem: orthogonal vectors

The nonzero vectors [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] are orthogonal vectors if and only if [latex]\mathbf{u} \cdot \mathbf{v} = 0[/latex].

Proof

Let [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] be nonzero vectors, and let [latex]\theta[/latex] denote the angle between them. First, assume [latex]\mathbf{u} \cdot \mathbf{v} = 0[/latex]. Then

[latex]||\mathbf{u}||\;||\mathbf{v}||\cos{\theta} = 0[/latex].

However, [latex]||\mathbf{u}|| \neq 0[/latex] and [latex]||\mathbf{v}|| \neq 0[/latex], so we must have [latex]\cos{\theta} = 0[/latex]. Hence, [latex]\theta = 90^\circ[/latex], and the vectors are orthogonal.

Now assume [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] are orthogonal. Then [latex]\theta = 90^\circ[/latex] and we have

[latex]\mathbf{u} \cdot \mathbf{v} = ||\mathbf{u}||\;||\mathbf{v}||\cos{\theta} = ||\mathbf{u}||\;||\mathbf{v}||\cos{90^\circ} = ||\mathbf{u}||\;||\mathbf{v}||(0) = 0[/latex].
[latex]_\blacksquare[/latex]

The terms orthogonalperpendicular, and normal each indicate that mathematical objects are intersecting at right angles. The use of each term is determined mainly by its context. We say that vectors are orthogonal and lines are perpendicular. The term normal is used most often when measuring the angle made with a plane or other surface.

Example: identifying orthagonal vectors

Determine whether [latex]\mathbf{p} = \langle 1,0,5 \rangle[/latex] and [latex]\mathbf{q} = \langle 10,3,-2 \rangle[/latex] are orthogonal vectors.

try it

For which value of [latex]x[/latex] is [latex]\mathbf{p} = \langle 2,8,-1 \rangle[/latex] orthogonal to [latex]\mathbf{q} = \langle x,-1,2 \rangle[/latex]?

Example: measuring the angle formed by two vectors

Let [latex]\mathbf{v} = \langle 2,3,3 \rangle[/latex]. Find the measures of the angles formed by the following vectors.

  1. [latex]\mathbf{v}[/latex] and [latex]\mathbf{i}[/latex]
  2. [latex]\mathbf{v}[/latex] and [latex]\mathbf{j}[/latex]
  3. [latex]\mathbf{v}[/latex] and [latex]\mathbf{k}[/latex]

try it

Let [latex]\mathbf{v} = \langle 3,-5,1 \rangle[/latex]. Find the measure of the angles formed by each pair of vectors.

  1. [latex]\mathbf{v} [/latex] and [latex]\mathbf{i} [/latex]
  2. [latex]\mathbf{v} [/latex] and [latex]\mathbf{j} [/latex]
  3. [latex]\mathbf{v} [/latex] and [latex]\mathbf{k} [/latex]

The angle a vector makes with each of the coordinate axes, called a direction angle, is very important in practical computations, especially in a field such as engineering. For example, in astronautical engineering, the angle at which a rocket is launched must be determined very precisely. A very small error in the angle can lead to the rocket going hundreds of miles off course. Direction angles are often calculated by using the dot product and the cosines of the angles, called the direction cosines. Therefore, we define both these angles and their cosines.

DEFINITION


The angles formed by a nonzero vector and the coordinate axes are called the direction angles for the vector (Figure 5). The cosines for these angles are called the direction cosines.

This figure is the first octant of the 3-dimensional coordinate system. It has the standard unit vectors drawn on axes x, y, and z. There is also a vector drawn in the first octant labeled “v.” The angle between the x-axis and v is labeled “alpha.” The angle between the y-axis and vector v is labeled “beta.” The angle between the z-axis and vector v is labeled “gamma.”

Figure 5. Angle [latex]\alpha[/latex] is formed by vector [latex]{\bf{v}}[/latex] and unit vector [latex]{\bf{i}}[/latex]. Angle [latex]\beta[/latex] is formed by vector [latex]{\bf{v}}[/latex] and unit vector [latex]{\bf{j}}[/latex]. Angle [latex]\gamma[/latex] is formed by vector [latex]{\bf{v}}[/latex] and unit vector [latex]{\bf{k}}[/latex].

In Example: Measuring the Angle Formed by Two Vectors, the direction cosines of [latex]\mathbf{v} = \langle 2,3,3 \rangle[/latex] are [latex]\cos{\alpha} = \frac{2}{\sqrt{22}}[/latex], [latex]\cos{\beta} = \frac{3}{\sqrt{22}}[/latex], and [latex]\cos{\gamma} = \frac{3}{\sqrt{22}}[/latex]. The direction angles of [latex]\mathbf{v}[/latex] are [latex]\alpha = 1.130[/latex] rad, [latex]\beta = 0.877[/latex] rad, and [latex]\gamma = 0.877[/latex] rad.

So far, we have focused mainly on vectors related to force, movement, and position in three-dimensional physical space. However, vectors are often used in more abstract ways. For example, suppose a fruit vendor sells apples, bananas, and oranges. On a given day, he sells 30 apples, 12 bananas, and 18 oranges. He might use a quantity vector, [latex]\mathbf{q} = \langle 30,12,18 \rangle[/latex], to represent the quantity of fruit he sold that day. Similarly, he might want to use a price vector, [latex]\mathbf{p} = \langle 0.50,0.25,1 \rangle[/latex], to indicate that he sells his apples for 50¢ each, bananas for 25¢ each, and oranges for $1 apiece. In this example, although we could still graph these vectors, we do not interpret them as literal representations of position in the physical world. We are simply using vectors to keep track of particular pieces of information about apples, bananas, and oranges.

This idea might seem a little strange, but if we simply regard vectors as a way to order and store data, we find they can be quite a powerful tool. Going back to the fruit vendor, let’s think about the dot product, [latex]\mathbf{q} \cdot \mathbf{p}[/latex]. We compute it by multiplying the number of apples sold (30) by the price per apple (50¢), the number of bananas sold by the price per banana, and the number of oranges sold by the price per orange. We then add all these values together. So, in this example, the dot product tells us how much money the fruit vendor had in sales on that particular day.

When we use vectors in this more general way, there is no reason to limit the number of components to three. What if the fruit vendor decides to start selling grapefruit? In that case, he would want to use four-dimensional quantity and price vectors to represent the number of apples, bananas, oranges, and grapefruit sold, and their unit prices. As you might expect, to calculate the dot product of four-dimensional vectors, we simply add the products of the components as before, but the sum has four terms instead of three.

Example: using vectors in an economic context

AAA Party Supply Store sells invitations, party favors, decorations, and food service items such as paper plates and napkins. When AAA buys its inventory, it pays 25¢ per package for invitations and party favors. Decorations cost AAA 50¢ each, and food service items cost 20¢ per package. AAA sells invitations for $2.50 per package and party favors for $1.50 per package. Decorations sell for $4.50 each and food service items for $1.25 per package.

During the month of May, AAA Party Supply Store sells 1258 invitations, 342 party favors, 2426 decorations, and 1354 food service items. Use vectors and dot products to calculate how much money AAA made in sales during the month of May. How much did the store make in profit?

try it

On June 1, AAA Party Supply Store decided to increase the price they charge for party favors to $2 per package. They also changed suppliers for their invitations, and are now able to purchase invitations for only 10¢ per package. All their other costs and prices remain the same. If AAA sells 1408 invitations, 147 party favors, 2112 decorations, and 1894 food service items in the month of June, use vectors and dot products to calculate their total sales and profit for June.

Watch the following video to see the worked solution to the above Try IT.

You can view the transcript for “CP 2.26” here (opens in new window).