Math 243: Calculus II
12.3 The Dot Product
12.3.1 The Dot Product of Two Vectors¶
$$ \require{color} \definecolor{brightblue}{rgb}{.267, .298, .812} \definecolor{darkblue}{rgb}{0.0, 0.0, 1.0} \definecolor{palepink}{rgb}{1, .73, .8} \definecolor{softmagenta}{rgb}{.99,.34,.86} \definecolor{blueviolet}{rgb}{.537,.192,.937} \definecolor{jonquil}{rgb}{.949,.792,.098} \definecolor{shockingpink}{rgb}{1, 0, .741} \definecolor{royalblue}{rgb}{0, .341, .914} \definecolor{alien}{rgb}{.529,.914,.067} \definecolor{crimson}{rgb}{1, .094, .271} \def\ihat{\mathbf{\hat{\unicode{x0131}}}} \def\jhat{\mathbf{\hat{\unicode{x0237}}}} \def\khat{\mathbf{\hat{\unicode{x1d458}}}} \def\tombstone{\unicode{x220E}} \def\contradiction{\unicode{x2A33}} $$
In his video Dot Products and Duality, Grant Sanderson explains the definition of intuition for the dot product in vector spaces $\mathbb{R}^n$, and their relationship with linear algebra.
If we have two vectors $\mathbf{x}$ and $\mathbf{y}$ in standard position, we draw a line segment from the tip of vector $\mathbf{y}$ perpendicular to vector $\mathbf{x}$,
The vector with the same direction as vector $\mathbf{x}$ and length equal to the leg of the resulting right triangle is call the projection of vector $\mathbf{y}$ onto vector $\mathbf{x}$ is defined by the vector
As $0\le\theta\le\pi$ is the angle between two vectors, the length of vector $\mathbf{p}$ is given by
$$
|\mathbf{p}| = |\mathbf{y}||\cos(\theta)|,
$$
where an acute angle implies that the projection of $\mathbf{y}$ onto $\mathbf{x}$ has the same direction as $\mathbf{x}$, and an obtuse angle signifies that the projection of $\mathbf{y}$ onto $\mathbf{x}$ has the opposite direction as $\mathbf{x}$.
Definition Dot Product¶
The scalar product or dot product of two vectors $\mathbf{x}$ and $\mathbf{y}$, is the product of the lengths of vector $\mathbf{x}$ and the projection $\ \mathbf{p}$ of vector $\ \mathbf{y}$ onto vector $\ \mathbf{x}$.
$$ \mathbf{x}\cdot\mathbf{y} := |\mathbf{x}|\,|\mathbf{p}| = |\mathbf{x}|\,|\mathbf{y}|\cos(\theta), $$
where $\theta$ is the included angle between the two vectors.
We learn in the video above that, for a fixed vector $\mathbf{y}\in\mathbb{R}^n$, this is a linear transformation
$$ L[\mathbf{x}] = \mathbf{x}\cdot\mathbf{y} $$
from the vector space $\mathbb{R}^n$ to the real numbers $\mathbb{R}$.
$$ L\,:\,\mathbb{R}^n\rightarrow\mathbb{R} $$
Any linear transformation from one finite dimensional vector space to another can be represented by a matrix with respect to the canonical bases, and this matrix is $\mathbf{y}^T$,
$$ \mathbf{x}\cdot\mathbf{y} = L[\mathbf{x}] = \mathbf{y}^T\mathbf{x} = x_1y_1 + x_2y_2 + \cdots + x_ny_n $$
From this identity, one obtains equations for both the vector projection and the length of the vector projection. The scalar component of vector $\mathbf{y}$ onto $\mathbf{x}$ is the length of the projection vector.
Definition Component¶
The scalar component of one vector $\mathbf{y}$ onto vector $\mathbf{x}$ in $\mathbb{R}^n$ is give by
$$ \text{Comp}_{\mathbf{x}}\mathbf{y} := |\mathbf{p}| = |\mathbf{y}|\cos(\theta) = \dfrac{|\mathbf{x}||\mathbf{y}|\cos(\theta)}{|\mathbf{x}|} = \dfrac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{x}|} = \dfrac{\mathbf{y}^T\mathbf{x}}{|\mathbf{x}|} $$
This definitions for the vector projection and component rely on the fact that the vector $\mathbf{u} = \dfrac{\mathbf{x}}{|\mathbf{x}|}$ is a vector that points in the same direction as vector $\mathbf{x}$, but has a length of one.
If one scales the vector $\frac{\mathbf{x}}{\left|\mathbf{x}\right|}$ by the scalar $d = \text{Comp}_{\mathbf{x}}\mathbf{y}$, then one obtains a vector parallel $\mathbf{x}$ with length $d$.
This product vector is the vector $\mathbf{p}$ or vector projection of $\mathbf{y}$ onto $\mathbf{x}$.
Definition Vector Projection¶
The vector projection of vector $\mathbf{y}$ onto vector $\mathbf{x}$ in $\mathbb{R}^n$ is give by
$$ \text{Proj}_{\mathbf{x}}\mathbf{y} := \mathbf{p} = \left(\dfrac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{x}|}\right)\left(\dfrac{\mathbf{x}}{|\mathbf{x}|}\right) = \dfrac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{x}|^2}\mathbf{x} = \dfrac{\mathbf{x}\cdot\mathbf{y}}{\mathbf{x}\cdot\mathbf{x}}\mathbf{x} = \dfrac{\mathbf{y}^T\mathbf{x}}{\mathbf{x}^T\mathbf{x}}\mathbf{x} $$
Exercise 1¶
A force $\mathbf{F}$ or $40 N$ acts on a box in the direction of the vector $\overrightarrow{OP}$, where $P(1,0,2)$. Express the force as a vector using standard unit vectors.
View Solution
Force vector $\mathbf{F}$ is a vector whose component in the direction of $\overrightarrow{OP}$ is $40 N$. The angle between $\mathbf{F}$ and $\overrightarrow{OP}$ is zero as they point in the same direction. Hence the vector projection of $\mathbf{F}$ onto $\overrightarrow{OP}$ is $\mathbf{F}$.
$$ \begin{align*} \mathbf{F} &= \text{Proj}_{\overrightarrow{OP}}\,\mathbf{F} = \frac{\mathbf{F}\cdot\overrightarrow{OP}}{\left|\overrightarrow{OP}\right|^2}\,\overrightarrow{OP} \\ \\ &= \frac{\left|\mathbf{F}\right|\,\left|\overrightarrow{OP}\right|\cos(0)}{\left|\overrightarrow{OP}\right|^2}\,\overrightarrow{OP} = \frac{\left|\mathbf{F}\right|}{\left|\overrightarrow{OP}\right|}\,\overrightarrow{OP} \\ \\ &= \frac{40}{\sqrt{5}}\langle 1, 0, 2 \rangle = \left\langle 8\sqrt{5}, 0, 16\sqrt{5} \right\rangle \end{align*} $$
12.3.2 Properties of Dot Product¶
(Real) Definition¶
The magnitude or length of a vector $\mathbf{x}$ in Euclidean space $\mathbb{R}^n$ is defined by
$$ \left|\mathbf{x}\right| = \sqrt{\mathbf{x}\cdot\mathbf{x}} = \sqrt{ x_1^2 + \dots + x_n^2 } $$
The linearity of dot product was introduced in Grant Sanderson's video. However the following properties of dot product will be important to using it in applications like Exercise 1.
Theorem 12.3.1¶
If $\mathbf{a}$, $\mathbf{b}$, $\mathbf{c}$ are vectors in $\mathbb{R}^n$ and $c$ is a scalar, then
$\mathbf{a}\cdot\mathbf{b} = \mathbf{b}\cdot\mathbf{a}$
$\mathbf{a}\cdot(\mathbf{b} + \mathbf{c}) = \mathbf{a}\cdot\mathbf{b} + \mathbf{a}\cdot\mathbf{c}$
$(c\mathbf{a})\cdot\mathbf{b} = c(\mathbf{a}\cdot\mathbf{b}) = \mathbf{a}\cdot(c\mathbf{b})$
$\mathbf{a}\cdot\mathbf{0} = 0$
Exercise 2¶
Compute the inner product of $\mathbf{v} = \langle -4, 2\rangle$ and $\mathbf{w} = \langle 8, -2\rangle$.
View Solution
$$ \mathbf{v}\cdot\mathbf{w} = \langle -4, 2\rangle\cdot\langle 8, -2\rangle = (-4)(8) + 2(-2) = -32 - 4 = -36 $$
Exercise 3¶
Compute the scalar product of $\mathbf{v} = \begin{bmatrix}\ \ 8\ \\ -3\ \\ \ \ 8\ \ \end{bmatrix}$ and $\mathbf{w} = \begin{bmatrix}\ \ 8\ \\ \ \ 1\ \\ \ \ 6\ \end{bmatrix}$.
View Solution
$$ \mathbf{v}\cdot\mathbf{w} = \begin{bmatrix}\ \ 8\ \\ -3\ \\ \ \ 8\ \ \end{bmatrix}\,\cdot\,\begin{bmatrix}\ \ 8\ \\ \ \ 1\ \\ \ \ 6\ \end{bmatrix} = (8)(8) + (-3)(1) + (8)(6) = 64 - 3 + 48 = 109 $$
Exercise 4¶
Compute the dot product of $\mathbf{x} = -4\ihat + 7\khat$ and $\mathbf{y} = 6\ihat + 8\jhat + 4\khat$.
View Solution
$$ \mathbf{x}\cdot\mathbf{y} = (-4)(6) + (0)(8) + (7)(4) = -24 + 0 + 28 = 4 $$
Exercise 5¶
Two vectors $\mathbf{u}$ and $\mathbf{v}$ in $\mathbb{R}^4$ have lengths 3 and 8, respectively. The angle between them is $\frac{\pi}{8}$. Compute $\mathbf{u}\cdot\mathbf{v}$.
View Solution
The cosine of $\frac{\pi}{8}$ can be determined using the half-angle formula. Most people remember the double angle formula
$$ \cos(2\theta) = \cos^2(\theta) - \sin^2(\theta) = 2\cos^2(\theta) - 1 $$
If one substitutes $\phi = 2\theta$, then
$$ \begin{align*} \cos(\phi) &= 2\cos^2\left(\frac{\phi}{2}\right) - 1 \\ \\ \cos\left(\frac{\phi}{2}\right) &= \sqrt{\frac{1+\cos(\phi)}{2}} \\ \\ \cos\left(\frac{\pi}{8}\right) &= \sqrt{\frac{1 + \cos\left( \frac{\pi}{4} \right)}{2}} = \sqrt{\frac{1 + \frac{\sqrt{2}}{2}}{2}} = \sqrt{\frac{2+\sqrt{2}}{4}} \\ \\ &= \frac{\sqrt{2 + \sqrt{2}}}{2} \\ \end{align*} $$
Now one may compute the dot product of vectors $\mathbf{u}$ and $\mathbf{v}$
$$ \mathbf{u}\cdot\mathbf{v} = \left|\mathbf{u}\right|\,\left|\mathbf{v}\right|\,\cos(\theta) = (3)(8)\frac{\sqrt{2 + \sqrt{2}}}{2} = 12\left(\sqrt{2 + \sqrt{2}}\right) $$
12.3.3 Angle Between Two Vectors¶
(Real) Definition¶
The angle between two vectors $\mathbf{x}$ and $\mathbf{y}$ in Euclidean space $\mathbb{R}^n$ is defined by
$$ \begin{align*} \cos(\theta) &= \frac{\mathbf{x}\cdot\mathbf{y}}{\left|\mathbf{x}\right|\left|\mathbf{y}\right|} \\ \\ \theta &= \cos^{-1}\left( \frac{\mathbf{x}\cdot\mathbf{y}}{\left|\mathbf{x}\right|\left|\mathbf{y}\right|} \right) \end{align*} $$
Two vectors are perpendicular (orthogonal) if and only if the angle between them is $\theta=\frac{\pi}{2}$, or the $\cos(\theta)=0$.
Theorem 12.3.2¶
Two vectors $\mathbf{u}$ and $\mathbf{v}$ in $\mathbb{R}^n$ are orthogonal if and only if $\mathbf{u}\cdot\mathbf{v}=0$.
Exercise 6¶
Show that vectors $\mathbf{p} = \langle 2, 1, 3 \rangle$ and $\mathbf{q} = \langle 1, 4, -2 \rangle$ are orthogonal vectors
View Solution
$$ \mathbf{p}\cdot\mathbf{q} = (2)(1) + (1)(4) + (3)(-2) = 2 + 4 - 6 = 0\ {\color{green}\Large{\checkmark}} $$
Since the dot product $\mathbf{p}\cdot\mathbf{q}=0$, the vectors are perpendicular.
12.3.4 Direction Cosines¶
The direction angles of a vector in $\mathbb{R}^n$ are the angles that a nonzero vector makes with each positive axis.
Definition¶
The direction cosines of a nonzero vector $\mathbf{v}$ in $\mathbb{R}^n$ are the cosines angles the vector makes with each basis vector $\mathbf{e}_k$, $1\le k\le n$. Hence
$$ \cos(\alpha_k) = \frac{\mathbf{v}\cdot\mathbf{e}_k}{\left|\mathbf{v}\right|\,\left|\mathbf{e}_k\right|} = \frac{v_k}{\left|\mathbf{v}\right|} $$
In $\mathbb{R}^3$ the three direction cosines of a nonzero vector $\mathbf{v}$ are given by
$$ \begin{align*} \cos(\alpha) &= \frac{\mathbf{v}\cdot\ihat}{\left|\mathbf{v}\right|\,\left|\ihat\right|} = \frac{v_1}{\left|\mathbf{v}\right|} \\ \\ \cos(\beta) &= \frac{v_2}{\left|\mathbf{v}\right|} \\ \\ \cos(\gamma) &= \frac{v_3}{\left|\mathbf{v}\right|} \end{align*} $$
Since we require a vector with direction cosines to be nonzero, we have that the denominators $\left|\mathbf{v}\right|\neq 0$. Hence
$$ \begin{align*} v_1 &= \left|\mathbf{v}\right|\cos(\alpha) \\ \\ v_2 &= \left|\mathbf{v}\right|\cos(\beta) \\ \\ v_3 &= \left|\mathbf{v}\right|\cos(\gamma) \\ \end{align*} $$
This means that
$$ \begin{align*} \cos^2(\alpha) + \cos^2(\beta) + \cos^2(\gamma) &= \left( \frac{v_1}{\left|\mathbf{v}\right|} \right)^2 + \left( \frac{v_2}{\left|\mathbf{v}\right|} \right)^2 + \left( \frac{v_3}{\left|\mathbf{v}\right|} \right)^2 \\ \\ &= \frac{v_1^2 + v_2^2 + v_3^2}{\left|\mathbf{v}\right|^2} = 1 \end{align*} $$
This also implies that
$$ \begin{align*} \mathbf{v} &= \langle v_1, v_2, v_3 \rangle = \left\langle\, \left|\mathbf{v}\right|\cos(\alpha),\, \left|\mathbf{v}\right|\cos(\beta),\, \left|\mathbf{v}\right|\cos(\gamma) \,\right\rangle \\ \\ &= \left|\mathbf{v}\,\right|\left\langle\, \cos(\alpha),\, \cos(\beta),\, \cos(\gamma)\, \right\rangle \end{align*} $$
Recalling that $\left|\mathbf{v}\right|\neq 0$ one obtains that the unit vector $\mathbf{u}$ in the direction of $\mathbf{v}$ is given by the coordinates
$$ \mathbf{u} = \frac{\mathbf{v}}{\left|\mathbf{v}\right|} = \left\langle\, \cos(\alpha),\, \cos(\beta),\, \cos(\gamma)\, \right\rangle $$
The direction cosines are the coordinates of the unit vector in the direction of $\mathbf{v}$.
Exercise 4¶
Determine the direction cosines of the vector $\mathbf{y} = \left\langle -3, 4, 5 \right\rangle$.
View Solution
The direction cosines are given by
$$ \begin{align*} \cos(\alpha) &= \frac{v_1}{\left|\mathbf{v}\right|} = \frac{-3}{\sqrt{50}} = -\frac{3}{5\sqrt{2}} = -\frac{3\sqrt{2}}{10} \\ \\ \cos(\beta) &= \frac{v_2}{\left|\mathbf{v}\right|} = \frac{4}{\sqrt{50}} = \frac{4}{5\sqrt{2}} = \frac{2\sqrt{2}}{5} \\ \\ \cos(\gamma) &= \frac{v_3}{\left|\mathbf{v}\right|} = \frac{5}{\sqrt{50}} = \frac{5}{5\sqrt{2}} = \frac{\sqrt{2}}{2} \\ \end{align*} $$
12.3.5 Direction Angles¶
Definition¶
The direction angles of a nonzero vector $\mathbf{z}$ in $\mathbb{R}^n$ are the angles in the interval $[0,\pi]$ specified by the direction cosines.
$$ \alpha_k = \cos^{-1}\left( \frac{z_k}{\left|\mathbf{z}\right|} \right) $$
for $1\le k \le n$.
Notice that the direction angle is the principle arc cosine of the direction cosine. That is direction angles are always in the interval $[0,\pi]$.
$$ \alpha_k = \pi + \arccos\left( \frac{z_k}{\left|\mathbf{z}\right|} \right) $$
Exercise 5¶
Determine the direction angles of the vector $\mathbf{y} = \left\langle -3, 4, 5 \right\rangle$.
View Solution
The direction angles are given by
$$ \begin{align*} \alpha &= \cos^{-1}\left(\frac{v_1}{\left|\mathbf{v}\right|}\right) =\arccos\left(-\frac{3}{\sqrt{50}}\right) \approx 2.009 \\ \\ \beta &= \cos^{-1}\left(\frac{v_2}{\left|\mathbf{v}\right|}\right) = \arccos\left( \frac{4}{5\sqrt{2}} \right) \approx .9695 \\ \\ \gamma &= \cos^{-1}\left(\frac{v_3}{\left|\mathbf{v}\right|}\right) = \arccos\left(\frac{1}{\sqrt{2}}\right) = \frac{\pi}{4} \\ \end{align*} $$
12.3.6 Applications¶
Example 1¶
Thrust force $\mathbf{F}$ moves capsule from $P(3,-3,0)$ to $Q(4,2,0)$. If the thrust vector is $\mathbf{F} = \langle 3,4,2 \rangle$, then compute the work done.
Solution¶
Work is force times distance. The distance is the length of vector $\overrightarrow{PQ}$, however the force is not parallel to this vector. Only a portion of the force vector pushes the capsule in the direction the capsule is traveling. The rest of the force is perpendicular to $\overrightarrow{PQ}$. The portion of the force applied in the direction of $\overrightarrow{PQ}$ is the component of $\mathbf{F}$ onto $\overrightarrow{PQ}$. Hence work is given by
$$ W = \left|\mathbf{F}\right|\,\cos(\theta)\,\left|\overrightarrow{PQ}\right| = \mathbf{F}\cdot\overrightarrow{PQ} $$
Vector $PQ$ has standard coordinates $\langle 4 - 3, 2 - (-3), 0-0 \rangle = \langle 1, 5, 0 \rangle$
Hence the work done by the force moving the capsule from $P$ to $Q$ is
$$ W = \langle 3,4,2 \rangle\cdot\langle 1, 5, 0 \rangle = 3(1) + 4(5) + 2(0) = 23\,Nm = 23\,J $$
Your use of this self-initiated mediated course material is subject to our Creative Commons License 4.0