The dot product measures how aligned two vectors are with each other.

1 The definition of the dot product

We have already seen how to add vectors and how to multiply vectors by scalars.

In this section we will define a way to “multiply” two vectors called the dot product. The dot product measures how “aligned” two vectors are with each other.

The first thing you should notice about the the dot product is that

\[ \mathbf {vector}\dotp \mathbf {vector} = \mathbf {number}. \]
Compute.
\[ \vector {1,2,3}\dotp \vector {4,5,6} \begin{prompt} = \answer {32} \end{prompt} \]
Compute.
\[ \vector {1,1,-1}\dotp \vector {1,1,2} \begin{prompt} = \answer {0} \end{prompt} \]
Let \(\vec {u},\vec {v},\vec {w}\) be nonzero vectors in \(\R ^3\). Which of the following expressions make sense?
\((\vec {w} \dotp \vec {u} ) \vec {u}\) \(5(\vec {u} +\vec {w}) \dotp {\vec {u}}\) \(\vec {w} / \vec {u}\) \(\vector {2,3} \dotp \vector {4,2} + 7\) \(\vec {w} / ( \vec {u} \dotp \vec {u})\) \(\vector {1,3} \dotp \vector {-1,2,5}\) \(\vec {u}\dotp \vec {v}+\vec {w}\)
Think about which terms/factors are vectors and which terms/factors are scalars.
Which of the following are vectors?
\((\vec {w} \dotp \vec {u} ) \vec {u}\) \(5(\vec {u} +\vec {w}) \dotp {\vec {u}}\) \(\vector {2,3} \dotp \vector {4,2} + 7\) \(\vec {w} / ( \vec {u} \dotp \vec {u})\)

The dot product allows us to write some complicated formulas more simply.

Compute the magnitude of the vector \(\vec {v} = \vector {1,2,3,4}\).
\[ |\vec {v}| = \answer {\sqrt {30}} \]

2 The geometry of the dot product

Let’s see if we can figure out what the dot product tells us geometrically. As an appetizer, we give the next theorem: the Law of Cosines.

When \(\theta = \pi /2\) what does the law of cosines say?
It is the Pythagorean theorem. It is the law of sines. It is undefined.

We can rephrase the Law of Cosines in the language of vectors. The vectors \(\vec {v}\), \(\vec {w}\), and \(\vec {v} - \vec {w}\) form a triangle

so if \(\theta \) is the angle between \(\vec {v}\) and \(\vec {w}\) we must have

\[ |\vec {v} - \vec {w}|^2=|\vec {v}|^2+|\vec {w}|^2-2|\vec {w}||\vec {v}|\cos (\theta ). \]

The theorem above tells us some interesting things about the angle between two (nonzero) vectors.

We have a special buzz-word for when the dot product is zero.

From this we see that the dot product of two vectors is zero if those vectors are orthogonal. Moreover, if the dot product is not zero, using the formula

\[ \vec {v} \dotp \vec {w} = |\vec {v}||\vec {w}|\cos (\theta ) \]

allows us to compute the angle between these vectors via

\[ \theta = \arccos \left (\frac {\vec {v} \dotp \vec {w} }{|\vec {v}|\cdot |\vec {w}|}\right ), \]

where \(0\le \theta \le \pi \).

Find the angle between the vectors.
\begin{align*} \vec {v} &= 2\veci +3\vecj +6\veck \\ \vec {w} &= 1\veci +2\vecj +2\veck \end{align*}
\[ \theta = \answer { \arccos \left (\frac {20}{21}\right )} \]
Find all unit vectors orthogonal to both vectors \(\vec {v}\) and \( \vec {w}\), given by
\begin{align*} \vec {v} &= \veci + \vecj \\ \vec {w} &= \veci + \veck . \end{align*}

Write your vectors in the order of increasing \(x\)-components.

\[ \vector {\answer {-1/\sqrt {3}},\answer {1/\sqrt {3}},\answer {1/\sqrt {3}}}\quad \text {and}\quad \vector {\answer {1/\sqrt {3}},\answer {-1/\sqrt {3}},\answer {-1/\sqrt {3}}} \]

3 Projections and components

3.1 Projections

One of the major uses of the dot product is to let us project one vector in the direction of another. Conceptually, we are looking at the “shadow” of one vector projected onto another, sort of like in the case of a sundial.

In essence we imagine the “sun” directly over a vector, casting a shadow onto another vector.

While this is good starting point for understanding orthogonal projections, now we need the definition.

Consider the vector \(\vec {v}=\vector {3,2,1}\) and the vector \(\veci = \vector {1,0,0}\). Compute \(\proj _\veci (\vec {v})\).
Draw a picture.
\[ \proj _\veci (\vec {v}) = \vector {\answer {3},\answer {0},\answer {0}} \]
Let \(\vec {v} = \vector {1,1}\) and \(\vec {w}=\vector {-1,1}\). Compute \(\proj _\vec {w}(\vec {v})\).
Draw a picture.
\[ \proj _\vec {w}(\vec {v}) = \vector {\answer {0},\answer {0}} \]

To compute the projection of one vector along another, we use the dot product.

Find the projection of the vector \(\vec {v} = \vector {2,3,1}\) in the direction of the vector \(\vec {w} = \vector {3,-1,1}\).
\[ \proj _\vec {w}(\vec {v}) = \vector {\answer {\frac {12}{11}},\answer {\frac {-4}{11}},\answer {\frac {4}{11}}} \]
Let \(\vec {v}\) and \(\vec {w}\) be nonzero vectors in \(\R ^2\). Let \(k\ge 1\). Select all statements that must be true.
\(\proj _{\vec {w}}(\vec {v})=\proj _{\vec {v}}(\vec {w})\) \(|\proj _{\vec {w}}(\vec {v})|\le |\vec {v}|\) \(|\proj _{\vec {w}}(\vec {v})|\le |\vec {w}|\) \(|\proj _{\vec {w}}(\vec {v})|\le |\proj _{\vec {w}}(k\cdot \vec {v})|\) \(|\proj _{\vec {w}}(k\cdot \vec {v})|\le |\proj _{\vec {w}}(\vec {v})|\) \(|\proj _{\vec {w}}(\vec {v})|\le |\proj _{k\cdot \vec {w}}(\vec {v})|\) \(|\proj _{k\cdot \vec {w}}(\vec {v})|\le |\proj _{\vec {w}}(\vec {v})|\)

3.2 Components

Scalar components compute “how much” of a vector is pointing in a particular direction.

Let \(\vec {v} = \vector {3,-2,1}\). Compute \(\scal _\veci (\vec {v})\).
\[ \scal _\veci (\vec {v}) = \answer {3} \]
Compute \(\scal _\vecj (\vec {v})\).
\[ \scal _\vecj (\vec {v}) = \answer {-2} \]
Compute \(\scal _\veck (\vec {v})\).
\[ \scal _\veck (\vec {v}) = \answer {1} \]

To compute the scalar component of a vector in the direction of another, you use the dot product.

Let \(\vec {v}\) and \(\vec {w}\) be nonzero vectors and let \(\theta \) be the angle between them. Which of the following are true?
\(|\proj _\vec {w}(\vec {v})| = \scal _{\vec {w}}(\vec {v})\) \(|\proj _\vec {w}(\vec {v})| = |\scal _{\vec {w}}(\vec {v})|\) \(\proj _\vec {w}(\vec {v}) =|\vec {v}|\cos (\theta )\left (\frac {\vec {w}}{|\vec {w}|}\right )\) \(\scal _\vec {w}(\vec {v}) = |\vec {v}|\cos (\theta )\)

3.3 Orthogonal decomposition

Given any vector \(\vec {v}\) in \(\R ^2\), we can always write it as

\[ \vec {v} = a\veci + b\vecj \]

for some real numbers \(a\) and \(b\). Here we’ve broken \(\vec {v}\) into the sum of two orthogonal vectors — in particular, vectors parallel to \(\veci \) and \(\vecj \). In fact, given a vector \(\vec {v}\) and another vector \(\vec {w}\) you can always break \(\vec {v}\) into a sum of two vectors, one of which is parallel to \(\vec {w}\) and another that is perpendicular to \(\vec {w}\). Such a sum is called an orthogonal decomposition. Move the point around to see various orthogonal decompositions of vector \(\vec {v}\).

Let \(\vec u = \vector {-2,1}\) and \(\vec v = \vector {3,1}\). What is the orthogonal decomposition of \(\vec {u}\) in terms of \(\vec {v}\)?
\[ \vec u= \underbrace {\vector {\answer {-1.5},\answer {-0.5}}}_{\parallel \vec v} + \underbrace {\vector {\answer {-0.5},\answer {1.5}}}_{\perp \vec v} \]
Let \(\vec w =\vector {2,1,3}\) and \(\vec x =\vector { 1,1,1}\). What is the orthogonal decomposition of \(\vec {w}\) in terms of \(\vec {x}\)?
\[ \vec w = \underbrace {\vector {\answer {2},\answer {2},\answer {2}}}_{\parallel \vec x} + \underbrace {\vector { \answer {0},\answer {-1},\answer {1}}}_{\perp \vec x} \]

Now we give an example where this decomposition is useful.

4 The algebra of the dot product

We summarize the arithmetic and algebraic properties of the dot product below.

Instead of defining the dot product by a formula, we could have defined it by the properties above! While this is common practice in mathematics, the process is a bit abstract and is perhaps beyond the scope of this course. Nevertheless, we know that you are an intrepid young mathematician, and we will not hold back. We will now show that there is only one formula which gives us all of these properties, and it will be our formula for the dot product.