$$\def\ans#1{\bbox[border:1px solid green,6pt]{#1}}$$

# Vectors, Dot Products, and Cross Products

## Introduction to Vectors

When studying the flight of an airplane, a rocket firing, or countless other applications, we can use vectors to mathematically describe what's going on. A vector has two components: magnitude and direction. This is similar to the use of polar coordinates, where we describe a point by its distance from the origin (like the magnitude of a vector) and the angle formed by the line from the origin to the point (like the direction of a vector).

Since all that distinguishes a vector from other vectors is its magnitude and direction, we can move it around at will. Therefore, for the sake of convenience, we often place the tail of the vector at the origin and describe the vector by the location of the head. This way of describing a vector looks just like describing a point, so to be clear that we're talking about a vector (that when the tail is placed at the origin has its head at this location), we use angled brackets, like so: $\vec{v} = \langle 1,3,5 \rangle$ This vector is shown below.

### Magnitude

The magnitude of this vector is given by \begin{align} |\vec{v}| &= \sqrt{x^2+y^2+z^2}\\ &= \sqrt{1^2+3^2+5^2} = \sqrt{35} \end{align}

### Standard Unit Vectors

A unit vector is a vector with magnitude 1. The standard unit vectors point in the direction of the x axis, y axis, and z axis. Note that the hat on these vectors denotes that they are unit vectors; whenever we write a vector with a hat like this, we'll mean a unit vector. \begin{align} \hat{i} &= \langle 1,0,0 \rangle\\ \hat{j} &= \langle 0,1,0 \rangle\\ \hat{k} &= \langle 0,0,1 \rangle\\ \end{align} In $$\mathbb{R}^2$$, we only need two standard unit vectors: $\hat{i} = \langle 1,0 \rangle \textrm{ and } \hat{j} = \langle 0,1 \rangle.$ In $$\mathbb{R}^n$$, we need n unit vectors, usually written $\hat{e_1}, \hat{e_2}, \hat{e_3}, \ldots, \hat{e_n}$ where $$\hat{e_n}$$ has a 1 in the nth position and 0's elsewhere.

Vectors in rectangular coordinates can be expressed in terms of these standard unit vectors.

Write $$\vec{v}=\langle -2,6,17 \rangle$$ in terms of the standard unit vectors.

#### Solution

$\vec{v}=\langle -2,6,17 \rangle = \ans{-2\hat{i}+6\hat{j}+17\hat{k}}$

If $$\vec{v}=\langle 5,2,-3 \rangle = 5\hat{i} + 2\hat{j} -3\hat{k}$$, find $$2\vec{v}$$.

#### Solution

$2\vec{v}=\langle 10,4,-6 \rangle = \ans{10\hat{i}+4\hat{j}-6\hat{k}}$

Visually, to add two vectors, place the tail of one at the head of the other and find the resulting vector. Numerically, simply add/subtract the components.

If $$\vec{u}=3\hat{i}-2\hat{j}+5\hat{k}$$ and $$\vec{v}=4\hat{i} + 6\hat{k}$$, find $$3\vec{u}+\vec{v}$$.

#### Solution

\begin{align} 3\vec{u}+\vec{v} &= 9\hat{i}-6\hat{j}+15\hat{k}+4\hat{i}+6\hat{k}\\ &= \ans{13\hat{i}-6\hat{j}+21\hat{k}} \end{align}

### Unit Vectors

If $$\vec{u}$$ is any vector, $$\hat{u}$$ is a unit vector in the direction of $$\vec{u}$$. To find this unit vector, divide $$\vec{u}$$ by its magnitude: $\ans{\hat{u} = \dfrac{\vec{u}}{|\vec{u}|}}$

If $$\vec{u}=\langle 3,2,-2 \rangle$$, find $$\hat{u}$$.

#### Solution

The magnitude of $$\vec{u}$$ is $|\vec{u}| = \sqrt{3^2+2^2+(-2)^2} = \sqrt{17},$ so the unit vector is $\hat{u} = \dfrac{1}{\sqrt{17}} \langle 3,2,-2 \rangle = \ans{\left\langle \dfrac{3\sqrt{17}}{17}, \dfrac{2\sqrt{17}}{17}, -\dfrac{2\sqrt{17}}{17} \right\rangle}$

Find a vector in the same direction as $$\vec{v}=8\hat{i}-\hat{j}+4\hat{k}$$ that is 4 units long.

#### Solution

To find this, first find a unit vector in the same direction as $$\vec{v}$$ and then multiply it by 4.

$|\vec{v}| = \sqrt{8^2+(-1)^2+4^2} = \sqrt{81} = 9,$ so the unit vector is $\hat{v}=\dfrac{1}{9}\langle 8,-1,4 \rangle = \left\langle \dfrac{8}{9},-\dfrac{1}{9}, \dfrac{4}{9} \right\rangle.$ Therefore, $4\hat{v} = \ans{\left\langle \dfrac{32}{9}, -\dfrac{4}{9}, \dfrac{16}{9} \right\rangle}$

### Application: Statics

Find $$T_1$$ and $$T_2$$, the tension in the two cables below.

Start by representing the forces with vectors:

If this system is in static equilibrium (nothing is moving), it means that the three forces must cancel each other, meaning that if we add the three vectors, the result must be 0:

\begin{align} &\vec{T_1} + \vec{T_2} - 400\hat{j} = 0 \longrightarrow \vec{T_1}+\vec{T_2} = 400\hat{j}\\ &T_{1i}\hat{i}+T_{1j}\hat{j}+T_{2i}\hat{i}+T_{2j}\hat{j} = 400\hat{j}\\ \\ \implies &T_{1i}+T_{2i}=0\\ &T_{1j}+T_{2j}=400\\ \\ \implies &-|T_1| \cos 60^{\circ} + |T_2|\cos 30^{\circ} = 0\\ &|T_1|\sin 60^{\circ}+|T_2|\sin 30^{\circ} = 400\\ \\ \implies &-\dfrac{1}{2}|T_1|+\dfrac{\sqrt{3}}{2}|T_2| = 0\\ &\dfrac{\sqrt{3}}{2}|T_1| + \dfrac{1}{2}|T_2| = 400\\ \\ &\implies \ans{T_1 = 346.41 \textrm{ lb and } T_2 = 200 \textrm{ lb}} \end{align}

## Dot Product (Scalar Product)

The dot product, one of two ways to multiply a vector, is defined as follows: if $$\vec{u}=\langle u_1, u_2, u_3 \rangle$$ and $$\vec{v}=\langle v_1,v_2,v_3 \rangle$$, then \ans{\begin{align} \vec{u} \cdot \vec{v} &= u_1v_1 + u_2v_2 + u_3v_3\\ &= |\vec{u}| |\vec{v}| \cos \theta \end{align}} where $$\theta$$ is the angle between the two vectors. Note that the result is a scalar, which is why this is called the scalar product.

Also note that $\vec{u} \cdot \vec{u} = |\vec{u}|^2.$

Let $$\vec{u}=\langle 2,-3,4 \rangle$$, $$\vec{v}=\langle 4,-3,5 \rangle$$, and $$\vec{w} = \langle 1,1,-3 \rangle$$. Find $$\vec{u} \cdot \vec{v}$$, $$2\vec{v} \cdot \vec{w}$$, and the angle between $$\vec{u}$$ and $$\vec{v}$$.

#### Solution

1. $$\vec{u} \cdot \vec{v}$$: $\vec{u} \cdot \vec{v} = (2)(4)+(-3)(-3)+(4)(5) = \ans{37}$
2. $$2\vec{v} \cdot \vec{w}$$: $2\vec{v} \cdot \vec{w} = (8)(1)+(-6)(1)+(10)(-3) = \ans{-28}$ [note that $$(2\vec{v})\cdot \vec{w} = 2(\vec{v} \cdot \vec{w})$$]
3. The angle between $$\vec{u}$$ and $$\vec{v}$$: \begin{align} \vec{u} \cdot \vec{v} = 37 &= |\vec{u}| |\vec{v}| \cos \theta\\ &= (\sqrt{4+9+16}) (\sqrt{16+9+25}) \cos \theta\\ \longrightarrow \cos \theta &= \dfrac{37}{\sqrt{29}\ \sqrt{50}} = \ans{13.7^{\circ}} \end{align}

### Orthogonal (or Perpendicular) Vectors

Two vectors are orthogonal if the angle between them is $$\theta = \dfrac{\pi}{2}$$. In terms of the dot product, this means that two vectors $$\vec{u}$$ and $$\vec{v}$$ are orthogonal iff (if and only if) $$\vec{u} \cdot \vec{v} = 0$$.

Let $$\vec{u}=3\hat{i} = \langle 3,0,0 \rangle$$ and $$\vec{v}=-2\hat{j} = \langle 0,-2,0 \rangle$$. Show that $$\vec{u}$$ and $$\vec{v}$$ are orthogonal.

#### Solution

$\vec{u} \cdot \vec{v} = 0 \textrm{, so the vectors are orthogonal.}$

### Projection of $$\vec{u}$$ onto $$\vec{v}$$ (or vice versa)

The projection of one vector onto another can be thought of as the shadow that one vector casts onto the other, as shown below.

To find the projection of $$\vec{u}$$ onto $$\vec{v}$$, find the magnitude of the projection and multiply it by $\hat{v} = \dfrac{\vec{v}}{|\vec{v}|}.$ The magnitude of the projection is $|proj_v \vec{u}| = |\vec{u}| \cos \theta,$ and since $$\vec{u} \cdot \vec{v} = |\vec{u}| |\vec{v}| \cos \theta$$, $|proj_v \vec{u}| = \dfrac{\vec{u} \cdot \vec{v}}{|\vec{v}|}.$ Therefore, $\ans{proj_v \vec{u} = \dfrac{\vec{u} \cdot \vec{v}}{|\vec{v}|} \ \dfrac{\vec{v}}{|\vec{v}|} = \left(\dfrac{\vec{u} \cdot \vec{v}}{\vec{v} \cdot \vec{v}}\right) \vec{v}.}$

Find the projection of $$\vec{u} = \langle 3,3,4 \rangle$$ onto $$\vec{v} = \langle 3,2,0 \rangle$$.

#### Solution

\begin{align} proj_v \vec{u} &= \left(\dfrac{\vec{u} \cdot \vec{v}}{\vec{v} \cdot \vec{v}}\right) \vec{v}\\ &= \left(\dfrac{9+6+0}{9+4+0}\right) \langle 3,2,0 \rangle = \dfrac{15}{13} \langle 3,2,0 \rangle\\ &= \ans{\left\langle \dfrac{45}{13},\dfrac{30}{13},0 \right\rangle} \end{align}

For the next example, note that the work done by a force $$\vec{F}$$ acting to move an object along a vector $$\vec{d}$$ is given by $W=\vec{F} \cdot \vec{d}.$

###### Work Calculation

Find the work done in the figure below (think of pulling a cart with a rope).

#### Solution

\begin{align} W = \vec{F} \cdot \vec{d} &= (15 \ lb)(4\ ft) \cos 40^{\circ}\\ &= \ans{45.96 \ ft-lb} \end{align}

## Cross Product (Vector Product)

### Application: Torque (Moments)

Let's say you want to tighten a nut as shown above. To tighten it as much as possible, you have two options: you can push harder on the wrench, or you can get a longer wrench. Think about pushing a door open; pushing closer to the hinges is harder, but if you push at the end away from the hinges, it's much easier. When you apply a force to turn something like the nut or the door, you are creating a moment or torque around the point of rotation. This torque depends on the force you apply and how far from the rotation point you apply that force; the magnitude of the torque is the product of these two. $|\vec{M}| = |\vec{r}| |\vec{F}|$ where $$\vec{M}$$ is the moment, $$\vec{r}$$ is the moment arm, and $$\vec{F}$$ is the force that is applied perpendicular to the moment arm.

What if the force is applied at an angle, though? Without going into all the details, it turns out that only the perpendicular part of the force contributes to the moment, and the moment can be calculated using the cross product of $$\vec{r}$$ and $$\vec{F}$$: $\vec{M} = \vec{r} \times \vec{F}$

### Finding the Cross Product

The cross product $$\vec{u} \times \vec{v}$$ yields a third vector that is perpendicular to both $$\vec{u}$$ and $$\vec{v}$$. The direction is specified by the right hand rule (RHR): if you start by pointing the fingers of your right hand along the first vector, then curl them in the direction of the second vector, your thumb will point in the direction of the cross product.

The magnitude of the cross product is $|\vec{u} \times \vec{v}| = |\vec{u}| |\vec{v}| \sin \theta$ where $$\theta$$ is the angle between $$\vec{u}$$ and $$\vec{v}$$. For instance, $\hat{i} \times \hat{j} = \hat{k}.$

We rarely use that formula to find the cross product; instead, we find the determinant of a specific matrix. We'll leave most of the discussion of determinants for Linear Algebra; for now, we'll just cover what we need.

If $$u=\langle u_1,u_2,u_3 \rangle$$ and $$v=\langle v_1,v_2,v_3 \rangle$$, then $$\vec{u} \times \vec{v}$$ is given by the following determinant: $\vec{u} \times \vec{v} = \begin{vmatrix} \hat{i} & \hat{j} & \hat{k}\\ u_1 & u_2 & u_3\\ v_1 & v_2 & v_3 \end{vmatrix}$ To evaluate this determinant, cross out the row and column that intersect at $$\hat{i}$$, then the ones that intersect at $$\hat{j}$$, and finally the ones that intersect at $$\hat{k}$$. Find the determinants of these smaller matrices (called minors) by multiplying along the diagonals and subtracting, as shown:

This probably all looks very confusing right now, but you end up with this:

Be sure to note the minus sign on the $$\hat{j}$$ minor. The first and third terms are positive, but this second term is negative. Also note that $\vec{u} \times \vec{v} \neq \vec{v} \times \vec{u}$ More specifically, if you switch the order in the cross product, the result will have the same magnitude, but it will point in the opposite direction.

If $$\vec{u}=2\hat{i}-3\hat{j}+\hat{k}$$ and $$\vec{v}=3\hat{i}+2\hat{j}+2\hat{k}$$, find $$\vec{u} \times \vec{v}$$.

#### Solution

\begin{align}\vec{u} \times \vec{v} &= \begin{vmatrix} \hat{i} & \hat{j} & \hat{k}\\ 2 & -3 & 1\\ 3 & 2 & 2 \end{vmatrix}\\ &= (-6-2)\hat{i} - (4-3)\hat{j} + (4+9)\hat{k}\\ &= -8\hat{i} - \hat{j} + 13\hat{k} \end{align}

If $$\vec{u}=2\hat{i}-3\hat{j}+\hat{k}$$ and $$\vec{v}=3\hat{i}+2\hat{j}+2\hat{k}$$, find a vector that is orthogonal to both $$\vec{u}$$ and $$\vec{v}$$.

#### Solution

Remember that the cross product of two vectors is orthogonal to both, and we already found $$\vec{u} \times \vec{v}$$. Therefore, $\vec{w}=\langle -8,-1,13 \rangle$ or any multiple of $$\vec{w}$$ will be orthogonal to both $$\vec{u}$$ and $$\vec{v}$$.