$$\definecolor{flatred}{RGB}{192, 57, 43} \definecolor{flatblue}{RGB}{41, 128, 185} \definecolor{flatgreen}{RGB}{39, 174, 96} \definecolor{flatpurple}{RGB}{142, 68, 173} \definecolor{flatlightblue}{RGB}{52, 152, 219} \definecolor{flatlightred}{RGB}{231, 76, 60} \definecolor{flatlightgreen}{RGB}{46, 204, 113} \definecolor{flatteal}{RGB}{22, 160, 133} \definecolor{flatpink}{RGB}{243, 104, 224}$$

## April 19, 2021

### The Dot Product

Go to Preview Activity

Textbook Reference: Section 8.8 Vectors

We already know how to do a lot of things with vectors after just one day of exploration:

• We can add vectors. Numerically, this means adding the $$x$$'s and $$y$$'s; visually, this means "stacking" the arrows tip-to-tail. ${\color{flatred}\langle x_1,y_1\rangle} + {\color{flatblue}\langle x_2,y_2\rangle} = \langle {\color{flatred}x_1}+{\color{flatblue}x_2},{\color{flatred}y_1}+{\color{flatblue}y_2}\rangle$
• We can multiply a vector by a number called a scalar. Numerically, this means "distributing" the scalar; visually, this means stretching the arrow (and maybe flipping it if the scalar is negative). ${\color{flatpink}k}\langle x,y\rangle = \langle {\color{flatpink}k}x,{\color{flatpink}k}y\rangle$
• We can find the length of a vector using the Pythagorean theorem: $\Vert\langle x,y\rangle\Vert = \sqrt{x^2+y^2}$ And we can find the direction of a vector using the arctangent function: $\theta=\tan^{-1}\left(\dfrac yx\right)$ (Remember to add $$180^\circ$$ if the vector points to the left, since the arctangent function only gives angles on the right half of the unit circle.)
• Finally, given the length $$r$$ and direction $$\theta$$ of a vector, we can break it into its $$x$$ and $$y$$ components: $\langle r\,\angle\,\theta\rangle = \langle r\cos\theta,r\sin\theta\rangle$ This very closely resembles what we've already done with polar coordinates. This should be no surprise, because we essentially have two ways to describe a vector: by its horizontal and vertical components, or by its length and direction.
• All of these things let us use vectors to represent a number of real-world quantities like displacement, velocity, acceleration, or force, where we don't just care about how big something is but also which way it's pointing.

Can we do any more?

## Multiplying vectors

Notice that we can add two vectors, but so far we can only multiply a vector by a number (a "scalar").

Can we multiply a vector by another vector?

What would that even mean?

The thing is, there are a lot of possible choices we could make for how to multiply vectors.

For example, the most "obvious" thing to do would be to multiply them component-by-component. By this logic, for example, multiplying $$\color{flatred}\langle 3,4\rangle$$ by $$\color{flatblue}\langle -2,5\rangle$$ would give an answer of $\langle {\color{flatred}3}\cdot {\color{flatblue}-2},{\color{flatred}4}\cdot {\color{flatblue}5}\rangle=\langle -6,20\rangle\text.$

This would be a perfectly valid way to define multiplication of vectors. Unfortunately it turns out not to be all that useful to us in this class, because it doesn't have an obvious "nice" geometric way of interpreting the answer. Bummer.

(Although if you're curious, there are uses for this kind of product, called the "Hadamard product", in things like statistics, image compression, and machine learning. That's just not what we're learning about right now.)

The definition we're going to use instead is called the dot product, which we write like this: $\mathbf{u}\cdot\mathbf{v}$ (Yes you have to write the dot. You can't leave it out and just write $$\mathbf{uv}$$, because there are other types of vector multiplication, and the symbol you use signals which type of multiplication you're using.)

To find the dot product, we still multiply the $$x$$'s and $$y$$'s separately, but what's new is we add those results: ${\color{flatred}\langle x_1,y_1\rangle} \cdot {\color{flatblue}\langle x_2,y_2\rangle} = {\color{flatred}x_1}\cdot{\color{flatblue}x_2}\ +\ {\color{flatred}y_1}\cdot{\color{flatblue}y_2}$ So, for example: \begin{align*} {\color{flatred}\langle 3,4\rangle}\cdot{\color{flatblue}\langle -2,5\rangle} &= {\color{flatred}3}\cdot {\color{flatblue}-2}\ +\ {\color{flatred}4}\cdot {\color{flatblue}5}\\ &= -6 + 20\\ &= \boxed{14} \end{align*} Notice that this means that the dot product of two vectors is a number — a scalar. That's why sometimes you'll see it called the scalar product.

Anyway, this definition might seem a bit strange at first, but it turns out to be really useful geometrically. In fact, in class, you'll see how the dot product gives us a really simple way to tell the angle between two vectors.

# Preview Activity 28

1. Pick a couple of random vectors and practice calculating their dot product, just to make sure you understand the definition.

2. Again let $$\mathbf{v}=\langle 3,4\rangle$$. We showed in class that $$\Vert\mathbf{v}\Vert=5$$.

1. Show that $$\sqrt{\mathbf{v}\cdot\mathbf{v}}$$ also gives the same answer.
2. Show that this works in general: if $$\mathbf{v}=\langle x,y\rangle$$, then $$\Vert\mathbf{v}\Vert=\sqrt{\mathbf{v}\cdot\mathbf{v}}$$.
(Really this means just working through the formula — it shouldn't take more than like a few steps to show this.)
3. I want to take an opportunity to explicitly point something out we did.

Lots of precalculus textbooks (ours included) sadly don't include this lead-up to defining the dot product. They jump right into the definition, and you get right into doing problems with it.

So, I specifically wrote this lesson to answer two questions I've found students often have when first learning the dot product:

1. Why don't we just multiply two vectors component-by-component?
2. What's the point of this weird alternate definition of multiplication?

What answers were given for these two questions in the lesson above?

4. Answer AT LEAST one of the following questions:
2. What was an "a-ha" moment you had while doing this activity?
3. What was the muddiest point of this activity for you?
4. What question(s) do you have about anything you've done?