Math 344: Calculus III
12.3 Dot Product
12.3.1 Vector Algebra¶
$$ \require{color} \definecolor{brightblue}{rgb}{.267, .298, .812} \definecolor{darkblue}{rgb}{.08, .18, .28} \definecolor{palepink}{rgb}{1, .73, .8} \definecolor{softmagenta}{rgb}{.99,.34,.86} \def\ihat{\hat{\mmlToken{mi}[mathvariant="bold"]{ı}}} \def\jhat{\hat{\mmlToken{mi}[mathvariant="bold"]{ȷ}}} \def\khat{\hat{\mathrm{k}}} \def\tombstone{\unicode{x220E}} \mathbf{P} = (x_1, x_2, \dots, x_n ) $$
We will need to use vector algebra throughout this course. Euclidean vectors are represented by a column of numbers, list of numbers, or components. The issue with describing every vector as a column or list of numbers is that our calculus textbook would be 50% thicker. To keep the calculus textbook under the 1000 kg limit, our authors also use points, the point where the tip sits when the vector is in standard position. A point $P$ is represented by a tuple; a tuple is a horizontal list of numbers encased in round brackets
When one uses a tuple to represent a vector, the base of the vector is the origin $\mathbf{0}$, and the tuple describes where the tip sits. Whenever the base of a vector is the origin, we say that the vector is in standard position. In order to save space one may also use
angle brackets
$$ \mathbf{x} = \langle\,x_1, x_2, \dots, x_n\,\rangle $$
or a transposed tuple
$$ \mathbf{y} = (\,y_1, y_2, \dots, y_n\,)^T $$
to represent a vector.
When one represents a vector in a Euclidean vector space using a list of coordinates, the position of the vector is NOT known. We often draw the vector in standard position, however every vector with the same length, and angles with respect to the coordinate axes is the same vector.
The Computer Scientist's Perspective¶
This gives rise to the computer scientists's perspective as a vector a list of numbers in some Euclidean Vector Space.
- A $2\times 1$ or two dimensional vector is represented by a list of two numbers:
$$ \mathbf{x} = \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \langle x_1, x_2\rangle = x_1\ihat + x_2\jhat $$
Each entry is the coefficient of the corresponding basis vector $\ihat$ and $\jhat$. - A $3\times 1$ or three dimensional vector is represented by a list of three coordinates:
$$ \mathbf{x} = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \langle x_1, x_2, x_3 \rangle = x_1\ihat + x_2\jhat + x_3\khat $$ - An $n\times 1$ or $n$-dimensional vector is represented by a list of $n$ coordinates:
$$ \mathbf{x} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} = \langle x_1, x_2, \dots, x_n \rangle = x_1\mathbf{e}_1 + x_2\mathbf{e}_2 + \cdots + x_n\mathbf{e}_n $$
Notice that in $n$ dimensional Euclidean vector spaces, we replace our standard basis vector $\ihat$, $\jhat$, and $\khat$ with $\mathbf{e}_1$, $\mathbf{e}_2$, $\mathbf{e}_3$ and so on until we get to $\mathbf{e}_n$. This prevents us from using up all of the letters for basis vectors. The $\mathbf{e}$ stands for elementary basis vector. In this case
$$ \ihat = \mathbf{e}_1 \qquad\qquad \jhat = \mathbf{e}_2 \qquad\qquad \khat = \mathbf{e}_3 $$ - Surprisingly enough the real numbers $\mathbb{R}$ is a space of Euclidean vectors represented by a column or list of one number:
$$ x = \begin{bmatrix} x \end{bmatrix} = x\ihat = x\,(1) = x $$
Real numbers are also called scalars and in this case the unit vector pointing to the right is $\ihat = 1$.
Finite dimensional Euclidean vector spaces $\mathbb{R}^n$ embody the rules or axioms of vector addition and scalar multiplication. Vectors encode both magnitude and direction. The magnitude, length, or norm of a vector in a Euclidean vector space is easy to compute from its standard coordinates
$$
|\mathbf{x}| := \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}
$$
The direction of a vector is more difficult to describe. In two dimensions, the direction is the angle the vector makes with the positive horizontal axis. In higher dimensional Euclidean vector spaces, the direction of a vector requires more consideration.
12.3.2 Linear Equations¶
In order to study the calculus of vector functions we will need to describe them. The most common method we used to describe real functions was with an equation. The simplest vector functions are linear transformations. We require vector algebra to describe more complicated vector functions as well. We will refer to videos introducing topics in linear algebra throughout the course. The terms linear algebra and vector algebra are considered equivalent in this course as we restrict our attention to the linear algebra of Euclidean vector spaces.
One begins the study of real-valued functions with functions whose graph is a line in the Cartesian plane.
$$ ax + by + c = 0 $$
As long as $b\neq 0$, we solve this equation for the dependent variable $y$,
$$ y = -\dfrac{a}{b}\,x - \dfrac{c}{b} = mx + y_0, $$
where $m$ is the slope and $y_0$ is the $y$-intercept of the graph. The graph passes through the origin precisely when $y_0=0$. We call these real-valued functions linear transformations when the $y$-intercept is zero, and affine when the $y$-intercept is nonzero. Linear has a more specific meaning in your mathematics from this point onward.
Linear algebra
map lines to lines, and parallel lines to parallel lines. A linear transformation may dilate or contract distances but evenly spaced parallel lines will remain evenly spaced.
An affine transformation maps line to lines, and parallel lines to parallel lines. However may translate vectors away from the origin. An affine transformation is a composition of a linear transformation and a translation.
One encodes a linear transformation from Euclidean vector space $\mathbb{R}^n$ to Euclidean vector space $\mathbb{R}^m$ by recording where the linear transformation sends each basis vector. One describes the domain and codomain
$$
\begin{align*}
\text{domain} &= \mathbb{R}^n = \text{span}\left\{ \mathbf{e}_1, \mathbf{e}_2, \dots, \mathbf{e}_n \right\} \\
\\
\text{codomain} &= \mathbb{R}^m
\end{align*}
$$
If $L$ is a linear transformation from Euclidean vector space $\mathbb{R}^n$ to Euclidean vector space $\mathbb{R}^m$, then the images of each vector becomes a vector in $\mathbb{R}^m$ so is represented by a list of $m$ coordinates. For example
$$
L(\mathbf{e}_1) = \langle a_1, a_2, \dots, a_m \rangle = \begin{bmatrix} a_1 \\ a_2 \\ \vdots \\ a_m \end{bmatrix}
$$
We have another problem with running out of letters so we will use two subscripts $a_{ij}$; the second subscript $j$ indicates that the vector is the image of $\mathbf{e}_j$, and the first subscript $i$ indicates the coordinate of the image vector.
$$
L\left(\mathbf{e}_1\right) = \begin{bmatrix} a_{11} \\ a_{21} \\ a_{31} \\ \vdots \\ a_{m1} \end{bmatrix},\ L\left(\mathbf{e}_2\right) = \begin{bmatrix} a_{12} \\ a_{22} \\ a_{32} \\ \vdots \\ a_{m2} \end{bmatrix},\ L\left(\mathbf{e}_3\right) = \begin{bmatrix} a_{13} \\ a_{23} \\ a_{33} \\ \vdots \\ a_{m3} \end{bmatrix},\ \dots,\ L\left(\mathbf{e}_n\right) = \begin{bmatrix} a_{1n} \\ a_{2n} \\ a_{3n} \\ \vdots \\ a_{mn} \end{bmatrix}
$$
Finally we package these $n$, $m$-dimensional column vectors together into a $m\times n$ matrix
$$
A = \begin{bmatrix} a_{11} & a_{12} & \dots & a_{1n} \\ a_{21} & a_{22} & \dots & a_{2n} \\ a_{31} & a_{32} & \dots & a_{3n} \\ \ddots & \ddots & \dots & \ddots \\ a_{m1} & a_{m2} & \dots & a_{mn} \end{bmatrix} = \begin{bmatrix} \mathbf{a}_1 & \mathbf{a}_2 & \dots & \mathbf{a}_n \end{bmatrix}
$$
A matrix is a collection of $n$, $m\times 1$ vectors $\mathbf{a}_j = \begin{bmatrix} a_{1j} \\ a_{2j} \\ \ddots \\ a_{mj} \end{bmatrix}$
Notice that
- An $m\times n$ matrix $A$ has $m$ rows indicating that each column of the matrix an $m$-dimensional vector $\mathbf{a}_j$
- An $m\times n$ matrix $A$ is made up of $n$ column vectors $\mathbf{a}_1$, $\mathbf{a}_2$, $\dots$, $\mathbf{a}_n$
- The vector space of $m\times n$ matrices is denoted $\mathbb{R}^{m\times n}$
Matrix-vector Multiplication¶
For any $m\times n$ matrix $A\in\mathbb{R}^{m\times n}$ and $n\times 1$ vector $\ \mathbf{x}\in\mathbb{R}^n$, the matrix product of an $m\times n$ matrix and an $n\times 1$ vector is defined by
$$ A\mathbf{x} := \begin{bmatrix} \mathbf{a}_1 & \mathbf{a}_2 & \cdots & \mathbf{a}_n \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} = x_1\mathbf{a}_1 + x_2\mathbf{a}_2 + \dots + x_n\mathbf{a}_n $$
Whenever one multiplies vectors by scalars and adds them together, the result is called a linear combination. Hence the product of an $m\times n$ matrix $A$ and an $n\times 1$ vector $\mathbf{x}$ is an $m\times 1$ vector $\mathbf{y}$; a linear combination of the $m\times 1$ column vectors of matrix $A$. In this way we can describe a linear combination algebraically
$$
\mathbf{y} = L(\mathbf{x}) = A\mathbf{x}
$$
Using the rules of vector algebra, if $\mathbf{v}$, $\mathbf{w}\in\mathbb{R}^n$ are $n$-dimensional vectors and $\alpha$, $\beta\in\mathbb{R}$ are scalars, then
$$
\begin{align*}
L\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) &= A\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) \\
\\
&= \begin{bmatrix} \mathbf{a}_1 & \mathbf{a}_2 & \cdots & \mathbf{a}_n \end{bmatrix}\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) \\
\\
&= \begin{bmatrix} \mathbf{a}_1 & \mathbf{a}_2 & \cdots & \mathbf{a}_n \end{bmatrix}\begin{bmatrix} \alpha v_1 + \beta w_1 \\ \alpha v_2 + \beta w_2 \\ \ddots \\ \alpha v_n + \beta w_n \end{bmatrix} \\
\\
&= (\alpha v_1 + \beta w_1)\mathbf{a}_1 + (\alpha v_2 + \beta w_2)\mathbf{a}_2 + \cdots + (\alpha v_n + \beta w_n)\mathbf{a}_n \\
\\
&= \left(\alpha v_1\mathbf{a}_1 + \alpha v_2\mathbf{a}_2 + \cdots + \alpha v_n\mathbf{a}_n\right) + \left(\beta w_1\mathbf{a}_1 + \beta w_2\mathbf{a}_2 + \cdots + \beta w_n\mathbf{a}_n\right) \\
\\
&= \alpha\left(v_1\mathbf{a}_1 + v_2\mathbf{a}_2 + \cdots + v_n\mathbf{a}_n\right) + \beta\left(w_1\mathbf{a}_1 + w_2\mathbf{a}_2 + \cdots + w_n\mathbf{a}_n\right) \\
\\
&= \alpha A\mathbf{v} + \beta A\mathbf{w} \\
\\
&= \alpha L(\mathbf{v}) + \beta L(\mathbf{w})
\end{align*}
$$
Linear Transformation¶
For any function $L:\mathbb{R}^n\rightarrow\mathbb{R}^m$, if for every vectors $\mathbf{v}$, $\mathbf{w}\in\mathbb{R}^n$ and scalars $\alpha$, $\beta\in\mathbb{R}$ we have
$$ L\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) = \alpha L(\mathbf{v}) + \beta L(\mathbf{w}), $$
then we call $L$ a linear transformation from vector space $\mathbb{R}^n$ to vector space $\mathbb{R}^m$, and there is an $m\times n$ matrix $A\in\mathbb{R}^{m\times n}$ so that for every vector in the domain $\mathbf{x}\in\mathbb{R}^n$,
$$ \mathbf{y} = L(\mathbf{x}) = A\mathbf{x} $$
So multiplying a vector on the left by matrix is a linear operation. Furthermore every linear transformation from one finite dimensional vector space to another finite dimensional vector space may be represented by multiplying the vectors (or scalars) by an appropriate $m\times n$ matrix; the matrix whose columns are the images of the basis vectors of the domain, in the order of the basis.
We use this definition of a linear transformation because it mirrors the distributive multiplication of matrices across linear combinations of vectors. From above
$$
A\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) = \alpha A\mathbf{v} + \beta A\mathbf{w},
$$
therefore a function that displays the same kind of distributive law
$$
L\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) = \alpha L\mathbf({v}) + \beta L(\mathbf{w})
$$
is a linear transformation.
12.3.3 Examples of Linear Transformations¶
Remember that the real line is also a vector space, a one dimensional vector space. So real-valued functions whose graphs are a line through the origin are linear transformations from $\mathbb{R}$ to $\mathbb{R}$.
Example 12.3.1¶
Define $f:\mathbb{R}\rightarrow\mathbb{R}$ by
$$
f(x) = 3x
$$
This function is a linear transformation because for any real numbers $r$, $s$ and any real numbers $\alpha$, $\beta$ we have
$$
f(\alpha r + \beta s) = 3(\alpha r + \beta s) = 3\alpha r + 3\beta s = \alpha 3r + \beta 3s = \alpha f(r) + \beta f(s)
$$
Example 12.3.2¶
Define $g:\mathbb{R}\rightarrow\mathbb{R}$ by
$$
g(x) = 3x + 2
$$
This function is not a linear transformation because
$$
g(2 + 5) = g(7) = 3(7) + 2 = 23
$$
however
$$
g(2) + g(5) = 3(2) + 2 + 3(5) + 2 = 8 + 17 = 25
$$
Function $g$ is affine.
Example 12.3.3¶
Define $h:\mathbb{R}\rightarrow\mathbb{R}$ by
$$
h(x) = x^2
$$
This function is not a linear transformation because
$$
g(2\cdot 5) = g(10) = 10^2 = 100
$$
however
$$
2 \cdot\,g(5) = 2 \cdot\left(5^2\right) = 2\cdot 25 = 50
$$
Example 12.3.4¶
Define $L:\mathbb{R}^2\rightarrow\mathbb{R}^2$ by
$$
L(\mathbf{x}) = L\left(\begin{bmatrix} x_1 \\ x_2 \end{bmatrix}\right) = L(\langle x_1,\ x_2\rangle) = \langle 3x_1, x_1 + x_2\rangle = \begin{bmatrix} 3x_1 \\ x_1 + x_2 \end{bmatrix}
$$
If $\mathbf{v}$, $\mathbf{w}\in\mathbb{R}^2$ and $\alpha$, $\beta$ are real numbers (scalars), then
$$
\begin{align*}
L\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) &= L\left(\begin{bmatrix} \alpha v_1 + \beta w_1 \\ \alpha v_2 + \beta w_2 \end{bmatrix}\right) \\
\\
&= \begin{bmatrix} \alpha v_1 + \beta w_1 \\ (\alpha v_1 + \beta w_1) + (\alpha v_2 + \beta w_2) \end{bmatrix} \\
\\
&= \begin{bmatrix} \alpha v_1 + \beta w_1 \\ \alpha v_1 + \alpha v_2 + \beta w_1 + \beta w_2 \end{bmatrix} \\
\\
&= \begin{bmatrix} \alpha v_1 \\ \alpha v_1 + \alpha v_2 \end{bmatrix} + \begin{bmatrix} \beta w_1 \\ \beta w_1 + \beta w_2 \end{bmatrix} \\
\\
&= \alpha\begin{bmatrix} v_1 \\ v_1 + v_2 \end{bmatrix} + \beta\begin{bmatrix} w_1 \\ w_1 + w_2 \end{bmatrix} \\
\\
&= \alpha L(\mathbf{v}) + \beta L(\mathbf{w})
\end{align*}
$$
Thus $L$ is a linear transformation. Using angle brackets one obtains
$$
\begin{align*}
L\left(\alpha\mathbf{v} + \beta\mathbf{w}\right) &= L\langle \alpha v_1 + \beta w_1,\ \alpha v_2 + \beta w_2 \rangle \\
\\
&= \langle \alpha v_1 + \beta w_1,\ (\alpha v_1 + \beta w_1) + (\alpha v_2 + \beta w_2) \rangle \\
\\
&= \langle \alpha v_1 + \beta w_1,\ \alpha v_1 + \alpha v_2 + \beta w_1 + \beta w_2 \rangle \\
\\
&= \langle \alpha v_1,\ \alpha v_1 + \alpha v_2 \rangle + \langle \beta w_1,\ \beta w_1 + \beta w_2 \rangle \\
\\
&= \alpha\langle v_1,\ v_1 + v_2 \rangle + \beta\langle w_1,\ w_1 + w_2 \rangle \\
\\
&= \alpha L(\mathbf{v}) + \beta L(\mathbf{w})
\end{align*}
$$
Example 12.3.5¶
Define $H:\mathbb{R}^3\rightarrow\mathbb{R}^3$ by
$$
H(\mathbf{x}) = A\mathbf{x} = \begin{bmatrix} 1 & 0 & 2 \\ 3 & 1 & 0 \\ 2 & 1 & 3 \end{bmatrix}\mathbf{x}
$$
Function $H$ is a linear transformation because matrix-vector multiplication is a linear operation.
Example 12.3.6¶
Define $K:\mathbb{R}^3\rightarrow\mathbb{R}^3$ by
$$
K(\mathbf{x}) = K\langle x_1, x_2, x_3 \rangle = \langle x_1^2, x_2^{1/2}, \sin(x_3) \rangle
$$
This function is not linear because
$$
K\left(\,2\left\langle 2, 2, \frac{\pi}{2}\right\rangle\,\right) = K\left(\,\left\langle 4, 4, \pi\right\rangle\,\right) = \langle 16, 2, 0 \rangle
$$
however
$$
2K\left(\,\left\langle 2, 2, \frac{\pi}{2}\right\rangle\,\right) = 2\left\langle 4, \sqrt{2}, 1\right\rangle = \left\langle 8, 2\sqrt{2}, 2\right\rangle \neq \langle 16, 2, 0 \rangle
$$
12.3.4 Dot Product¶
We will use linear transformations to describe three types of functions
- scalar product and vector product
- functions defined by linear equations; that is linear and affine transformations
- more elaborate functions
The Dot Product
of two vectors is also called the scalar product, or inner product.
12.3.5 Component¶
The Inner Product gives our vector spaces $\mathbb{R}^n$ their geometry. The definition of the inner product, or dot product, of two vector involves the concept of component and projection.
(This image was obtained from Free SVG Images under the CCO Public Domain License)When I am pushing a cart, I hold the cart below my shoulders. The force I apply to the handle of the cart follows a vector from my shoulder to my hands at an angle downward. Some of the force pushes down perpendicular to the floor and some of the force pushes the direction I propel the cart. Hopefully most of the force thrusts the cart parallel to the ground. The force vector is neither parallel to my direction of travel, nor perpendicular to it. In the right rectangle drawn over the image above of a person pushing such a cart, the force parallel to my traveling direction is the horizontal projection of the force. The force perpendicular to the direction of travel is the vertical projection.
The vector projection or orthogonal projection of vector $\mathbf{v}$ onto vector $\mathbf{w}$ is a vector $\mathbf{p}$ parallel to $\mathbf{w}$ so that the result $\mathbf{v}-\mathbf{p}$ is perpendicular to vector $\mathbf{w}$. The length of the projection vector is called the component of $\mathbf{v}$ onto $\mathbf{w}$. If we define
$$
\begin{align*}
c &= \left| \mathbf{p} \right| \\
d &= \left| \mathbf{r} \right| = \left| \mathbf{v}-\mathbf{p} \right|
\end{align*}
$$
then we have that vector $\mathbf{v}$ is the vector sum
$$
\mathbf{v} = \mathbf{p} + \mathbf{r} = c\,\ihat + d\,\jhat
$$
This means that if we arrange our basis vectors so that vector $\mathbf{w}$ is on the horizontal axis, the components or coordinates of $\mathbf{p}$ will be $(c,0)$ and the coordinates of $\mathbf{r} = \mathbf{v}-\mathbf{p}$ become $(0,d)$.
Regardless of whether our base vector $\mathbf{w}$ lies on the horizontal axis, a unit vector in the direction of $\mathbf{w}$ is just a vector of length one, pointing the same direction as vector $\mathbf{w}$. This vector is given by
$$
\mathbf{u} = \dfrac{\mathbf{w}}{|\mathbf{w}|}
$$
Once we have vector $\mathbf{u}$, we can determine the length of the projection $\mathbf{p}$ using trigonometry.
$$
\cos(\theta) = \dfrac{|\mathbf{p}|}{|\mathbf{v}|}
$$
or
$$
|\mathbf{p}| = |\mathbf{v}|\cos(\theta)
$$
Component of a Vector¶
The Component of vector $\mathbf{v}$ onto vector $\mathbf{w}$ is the length
$$ \text{comp}_{\mathbf{w}}\mathbf{v} := |\mathbf{v}|\cos(\theta) $$
12.3.6 Inner Product¶
Inner Product¶
The Euclidean Inner Product, Euclidean Scalar Product, or Dot Product of vectors $\mathbf{v}$ and $\mathbf{w}$ is the component of $\mathbf{v}$ onto $\mathbf{w}$ times the length of $\mathbf{w}$. Thus
$$ \mathbf{v}\cdot\mathbf{w} := |\mathbf{v}|\cos(\theta)\, |\mathbf{w}| = |\mathbf{v}|\,|\mathbf{w}|\,\cos(\theta) $$
The problem with this definition is that one must first determine the angle between our vectors. If we fix the second vector $\mathbf{w}$, we can define a linear transformation from $\mathbb{R}^n$ to the real numbers $\mathbb{R}$, $\text{Dot}:\mathbb{R}^n\rightarrow\mathbb{R}$ defined by
$$
\text{Dot}(\mathbf{v}) := \mathbf{v}\cdot\mathbf{w} = \left(|\mathbf{v}|\right)\,|\mathbf{w}|\,\cos(\theta)
$$
Since any linear transformation from an $n$-dimensional vector space to a $1$-dimensional vector can be represented by an $1\times n$ matrix we have a $1\times n$ matrix $A$ such that
$$
\text{Dot}(\mathbf{v}) = A\mathbf{v}
$$
The columns of matrix $A$ are the values of $\text{Dot}(\mathbf{e}_1)$, $\text{Dot}(\mathbf{e}_2)$, $\dots$, $\text{Dot}(\mathbf{e}_n)$. In the case of the dot product of two dimensional vectors, matrix $A$ has two columns, $\text{Dot}(\ihat)$ and $\text{Dot}(\jhat)$. We also learned in the previous video that
$$
\text{Dot}(\ihat) = w_1,\ \text{and}\ \text{Dot}(\jhat) = w_2,
$$
the coordinates of $\mathbf{w}$. Hence the $1\times 2$ matrix $A$ is the dual of vector $\mathbf{w} = \langle w_1,\ w_2\rangle = \begin{bmatrix} w_1 \\ w_2 \end{bmatrix}$,
$$
A = \begin{bmatrix} w_1 & w_2 \end{bmatrix}
$$
$\text{Dot}(\ihat)$ equals $w_1$ because the component of vector $\mathbf{w}$ onto the horizontal axis is $w_1$. Likewise $\text{Dot}(\jhat)$ equals $w_2$ because the component of vector $\mathbf{w}$ onto the vertical axis is $w_2$. This gives us a new method of computing the dot product of vector $\mathbf{v}$ with vector $\mathbf{w}$
$$
\mathbf{v}\cdot\mathbf{w} = A\mathbf{v} = \begin{bmatrix} w_1 & w_2 \end{bmatrix}\begin{bmatrix} v_1 \\ v_2 \end{bmatrix} = v_1w_1 + v_2w_2 = |\mathbf{v}|\,|\mathbf{w}|\,\cos(\theta)
$$
The inner product, scalar product, or dot product of two vectors $\mathbf{v}$, $\mathbf{w}\in\mathbb{R}^n$ is given by
$$ \mathbf{v}\cdot\mathbf{w} := |\mathbf{v}|\,|\mathbf{w}|\,\cos(\theta) = \displaystyle\sum_{j=1}^n v_jw_j $$
12.3.7 Example of Inner Product¶
Example 12.3.7¶
Compute the inner product of $\mathbf{v} = \langle -4, 2\rangle$ and $\mathbf{w} = \langle 8, -2\rangle$.
$$
\mathbf{v}\cdot\mathbf{w} = \langle -4, 2\rangle\cdot\langle 8, -2\rangle = (-4)(8) + 2(-2) = -32 - 4 = -36
$$
Example 12.3.8¶
Compute the scalar product of $\mathbf{v} = \begin{bmatrix}\ \ 8\ \\ -3\ \\ \ \ 8\ \ \end{bmatrix}$ and $\mathbf{w} = \begin{bmatrix}\ \ 8\ \\ \ \ 1\ \\ \ \ 6\ \end{bmatrix}$.
$$
\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
$$
Example 12.3.9¶
Compute the dot product of $\mathbf{x} = -4\ihat + 7\khat$ and $\mathbf{y} = 6\ihat + 8\jhat + 4\khat$.
$$
\mathbf{x}\cdot\mathbf{y} = (-4)(6) + (0)(8) + (7)(4) = -24 + 0 + 28 = 4
$$
12.3.8 Properties of Inner Product¶
If one computes the dot product of a vector $\mathbf{v}$ with itself then one obtains
$$
\mathbf{v}\cdot\mathbf{v} = |\mathbf{v}|\,|\mathbf{v}|\,\cos(0) = |v|^2 = v_1v_1 + v_2v_2 = v_1^2 + v_2^2
$$
This tells us that the inner product defined on vector space gives us a formula for the length of a vector in $\mathbb{R}^2$,
$$
|\mathbf{v}| := \sqrt{\mathbf{v}\cdot\mathbf{v}} = \sqrt{v_1^2 + v_2^2}
$$
The magnitude or length of a vector in $\mathbb{R}^n$ is given by¶
$$ \left|\mathbf{v}\right| := \sqrt{\mathbf{v}\cdot\mathbf{v}} = \left(\displaystyle\sum_{j=1}^n v_i^2\right)^{1/2} $$
One may define a linear transformation Dot$:\mathbb{R}^n\rightarrow\mathbb{R}$ by defining the second vector in the dot product to be a constant vector
$$
\text{Dot}(\mathbf{v}) = \mathbf{v}\cdot\mathbf{w} = v_1w_1 + v_2w_2 = \begin{bmatrix} w_1 & w_2\end{bmatrix}\begin{bmatrix} v_1 \\ v_2 \end{bmatrix}
$$
However one may likewise define a linear transformation Alt$:\mathbb{R}^n\rightarrow\mathbb{R}$ by defining the first vector to be a constant vector
$$
\text{Alt}(\mathbf{w}) := \mathbf{v}\cdot\mathbf{w} = v_1w_1 + v_2w_2 = \begin{bmatrix} v_1 & v_2 \end{bmatrix}\begin{bmatrix} w_1 \\ w_2 \end{bmatrix}
$$
We call the inner product multi-linear because it is a linear transformation when holding the first vector constant and varying the second vector, and also holding the second vector constant and varying the first vector.
Since scalar product is multi-linear, we have the following properties that follow from this type of linearity. If $\mathbf{a}$, $\mathbf{b}$, and $\mathbf{c}$ are vectors in vector space $\mathbb{R}^n$, and $\lambda\in\mathbb{R}$ is a scalar then
- $\mathbf{a}\cdot\mathbf{a} = |\mathbf{a}|^2$
- $\mathbf{a}\cdot\mathbf{b} = \displaystyle\sum_{j=1}^n a_jb_j = \displaystyle\sum_{j=1}^n b_ja_j = \mathbf{b}\cdot\mathbf{a}$
- $\mathbf{a}\cdot\left(\mathbf{b} + \mathbf{c}\right) = \displaystyle\sum_{j=1}^n a_j(b_j + c_j) = \displaystyle\sum_{j=1}^n a_jb_j + \displaystyle\sum_{j=1}^n a_jc_j = \mathbf{a}\cdot\mathbf{b} + \mathbf{a}\cdot\mathbf{c}$
- $\left(\lambda\mathbf{a}\right)\cdot\mathbf{b} = \displaystyle\sum_{j=1}^n (\lambda a_j)b_j = \lambda\displaystyle\sum_{j=1}^n a_jb_j = \lambda\left(\mathbf{a}\cdot\mathbf{b}\right) = \mathbf{a}\cdot\left(\lambda\mathbf{b}\right)$
- $\mathbf{0}\cdot\mathbf{a} = \displaystyle\sum_{j=1}^n 0\,a_j = 0 = \mathbf{a}\cdot\mathbf{0}$
12.3.9 Direction Angle¶
The angle between nonzero vectors $\mathbf{v}$ and $\mathbf{w}$ in vector space $\mathbb{R}^n$ is given by
$$ \cos(\theta) = \dfrac{\mathbf{v}\cdot\mathbf{w}}{|\mathbf{v}|\,|\mathbf{w}|} $$
Example 12.3.10¶
Find the angle between vectors $\mathbf{v} = \langle -5, 6, 8\rangle$, and $\mathbf{w} = \langle 4, 5, 5 \rangle$.
$$
\begin{align*}
\cos(\theta) &= \dfrac{\mathbf{v}\cdot\mathbf{w}}{|\mathbf{v}|\,|\mathbf{w}|} = \dfrac{\mathbf{v}\cdot\mathbf{w}}{\left(\mathbf{v}\cdot\mathbf{v}\right)^{1/2}\,\left(\mathbf{2}\cdot\mathbf{w}\right)^{1/2}} \\
\\
&= \dfrac{ (-5)(4) + 6(5) + 8(5) }{\left((-5)^2 + 6^2 + 8^2\right)^{1/2}\,\left(4^2 + 5^2 + 5^2\right)^{1/2}} \\
\\
&= \dfrac{ \left(-4 + 6 + 8\right)(5) }{ \left(25 + 36 + 64\right)^{1/2}\,\left(16 + 25 + 25\right)^{1/2}} \\
\\
&= \dfrac{50}{\sqrt{125}\sqrt{66}} = \dfrac{50}{5\sqrt{330}} = \dfrac{10}{\sqrt{330}} \\
\\
\theta &\approx 0.9879 \approx 56.6^{\circ}
\end{align*}
$$
The Angle between Two Vectors¶
If the angle between two vectors $\mathbf{a}$ and $\mathbf{b}$ is $\frac{\pi}{2}$, then the scalar product of the two vectors is given by
$$ \mathbf{a}\cdot\mathbf{b} = |\mathbf{a}|\,|\mathbf{b}|\,\cos\left(\frac{\pi}{2}\right) = |\mathbf{a}|\,|\mathbf{b}|\,(0) = 0 $$
Two vectors $\mathbf{a}$ and $\mathbf{b}$ in vector space $\mathbb{R}^n$ are called orthogonal or perpendicular if and only if
$$ \mathbf{a}\cdot\mathbf{b} = 0 $$
Example 12.3.11¶
Show that vectors $\mathbf{x} = 4\jhat - 2\khat$ and $\mathbf{y} = 4\ihat - 5\jhat - 10\khat$ are orthogonal.
$$
\cos(\theta) = \dfrac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{x}|\,|\mathbf{y}|} = \dfrac{(0)(4) + (4)(-5) + (-2)(-10)}{|\mathbf{x}|\,|\mathbf{y}|} = \dfrac{0}{|\mathbf{x}|\,|\mathbf{y}|} = 0
$$
As $0\le\theta\le\pi$, we have that $\theta = \frac{\pi}{2}$.
In $\mathbb{R}^3$, the direction angles of a nonzero vector $\mathbf{a}\in\mathbb{R}^n$ are the angles $\alpha$, $\beta$, and $\gamma$, each on the interval $[0,\pi]$, that vector $\mathbf{a}$ makes with each of the positive $x$-axis, $y$-axis, and $z$-axis, respectively. The cosines of these angles are called the direction cosines of vector $\mathbf{a}$.
Direction Cosines¶
The direction cosines of a vector $\mathbf{a}\in\mathbb{R}^3$ are cosines of the direction angles of the vector and are given by
$$ \begin{align*} \cos(\alpha) &= \dfrac{\mathbf{a}\cdot\ihat}{|\mathbf{a}|\,|\ihat|} = \dfrac{a_1}{|\mathbf{a}|} \\ \\ \cos(\beta) &= \dfrac{\mathbf{a}\cdot\jhat}{|\mathbf{a}|\,|\jhat|} = \dfrac{a_2}{|\mathbf{a}|} \\ \\ \cos(\gamma) &= \dfrac{\mathbf{a}\cdot\khat}{|\mathbf{a}|\,|\khat|} = \dfrac{a_3}{|\mathbf{a}|} \\ \end{align*} $$
Therefore,
$$ \dfrac{\mathbf{a}}{|\mathbf{a}|} = \langle \cos(\alpha),\ \cos(\beta),\ \cos(\gamma) \rangle $$
12.3.10 Projections¶
We return to our image of a vector and its projection onto the horizontal axis.
Here we arrange for vector $\mathbf{w}$ to be on the horizontal axis to simplify our picture. Recall that the component of a nonzero vector $\mathbf{v}$ onto nonzero vector $\mathbf{w}$ is the length of the projection vector $\mathbf{p}$ in our figure.
$$
\text{comp}_{\mathbf{w}}\mathbf{v} = |\mathbf{v}|\,\cos(\theta) = \dfrac{|\mathbf{v}|\,|\mathbf{w}|\,\cos(\theta)}{|\mathbf{w}|} = \dfrac{\mathbf{v}\cdot\mathbf{w}}{|\mathbf{w}|}
$$
In order to compute the coordinates of the projection vector we multiply the length of vector $\mathbf{p}$, or the component by the unit vector $\mathbf{u}$ that points in the same direction $\mathbf{w}$. Recall that
$$
\mathbf{u} = \dfrac{\mathbf{w}}{|\mathbf{w}|}
$$
In this way the projection vector $\mathbf{p}$ is
Component of a Vector¶
If vectors $\mathbf{x}$ and $\mathbf{y}$ are nonzero vectors in vector space $\mathbb{R}^n$, then the Component of $\mathbf{x}$ onto $\mathbf{y}$ is the scalar value
$$ \text{comp}_{\mathbf{y}}\mathbf{x} := \dfrac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{y}|} $$
- The component of $\mathbf{x}$ onto $\mathbf{y}$ is also called the scalar component of $\mathbf{x}$ onto $\mathbf{y}$.
Projection Vector¶
The Projection of vector $\mathbf{x}$ onto vector $\mathbf{y}$ is the vector
$$ \text{proj}_{\mathbf{y}}\mathbf{x} := \left(\dfrac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{y}|}\right)\left(\dfrac{\mathbf{y}}{|\mathbf{y}|}\right) = \left(\dfrac{\mathbf{x}\cdot\mathbf{y}}{|\mathbf{y}|^2}\right)\mathbf{y} = \left(\dfrac{\mathbf{x}\cdot\mathbf{y}}{\mathbf{y}\cdot\mathbf{y}}\right)\mathbf{y} $$
- The vector projection of $\mathbf{x}$ onto $\mathbf{y}$ is also called the vector component, or vector resolution of $\mathbf{x}$ in the direction of $\mathbf{y}$. It is also called the orthogonal projection of vector $\mathbf{x}$ onto vector $\mathbf{y}$.
Example 12.3.12¶
Find the scalar projection and vector projection of vector $\mathbf{v} = \langle -5, -4, 6 \rangle$ onto vector $\mathbf{w} = \langle 4, -1, 8 \rangle$.
$$
\begin{align*}
\text{comp}_{\mathbf{w}}\mathbf{v} &= \dfrac{\mathbf{v}\cdot\mathbf{w}}{|\mathbf{w}|} = \dfrac{(-5)(4) + (-4)(-1) + (6)(8)}{\sqrt{4^2 + (-1)^2 + 8^2}} = \dfrac{-20 + 4 + 48}{\sqrt{16 + 1 + 64}} = \dfrac{32}{\sqrt{81}} = \dfrac{32}{9} \\
\\
\text{proj}_{\mathbf{w}}\mathbf{v} &= \left(\dfrac{\mathbf{v}\cdot\mathbf{w}}{\mathbf{w}\cdot\mathbf{w}}\right)\mathbf{w} = \left(\dfrac{32}{81}\right)\langle 4, -1, 8 \rangle = \left\langle \dfrac{128}{81},\ -\dfrac{32}{81},\ \dfrac{256}{81} \right\rangle
\end{align*}
$$
12.3.11 An Application¶
We will use projections to compute work and force in physics.
Here vector $\mathbf{D}$ is defined by $\mathbf{D} := \overrightarrow{0Q}$.
The scalar projection of the force vector $\mathbf{F}$ in the direction of $\overrightarrow{0Q}$ is given by
$$
\text{proj}_{\overrightarrow{0Q}}\mathbf{F} = |\mathbf{F}|\,\cos(\theta)
$$
The work done pushing a object using constant force vector $\mathbf{F}$ in the direction of $\overrightarrow{0Q}$ is the product of the scalar projection times the distance traveled $|\mathbf{D}|$. Hence
$$
\begin{align*}
W &:= \left(|\mathbf{F}\,\cos(\theta)\right)\,|\mathbf{D}| \\
\\
&= |\mathbf{F}|\,|\mathbf{D}|\,\cos(\theta) \\
\\
&= \mathbf{F}\cdot\mathbf{D} \\
\end{align*}
$$
Example 12.3.13¶
A tractor pulls a sled a distance of 77 meters on level ground using a constant pulling force of 380 N. The tongue of the sled is held at an angle of 0.3 radians. Find the work done by the tractor.
$$
W = \mathbf{F}\cdot\mathbf{D} = |\mathbf{F}|\,|\mathbf{D}|\,\cos(\theta) = (77)(380)\cos(.3) \approx 27,953\,\mathrm{J}\approx 28\,\mathrm{kJ}
$$
Your use of this self-initiated mediated course material is subject to our Creative Commons License 4.0