Dot Product#


Revised

10 Mar 2023


Dot Product#


Algebraic Definition#

To find the dot product of two vectors, we multiply corresponding components and add. The result of the dot product is not a vector, but a number called a scalar.

If \(\mathbf{a}=\langle a_1,...,a_n\rangle\) and \(\mathbf{b}=\langle b_1,...,b_n\rangle\), then the dot product of \(\mathbf{a}\) and \(\mathbf{b}\) is the number \(\mathbf{a}\cdot\mathbf{b}\) given by

\( \begin{aligned} \mathbf{a}\cdot\mathbf{b} =\sum_{i=1}^na_ib_i =a_1b_1+...+a_nb_n \end{aligned} \)

If \(\mathbf{a}\) and \(\mathbf{b}\) are interpreted as column vectors, the dot product can be written as a matrix product.

\( \begin{aligned} \mathbf{a}\cdot\mathbf{b} =\mathbf{a}^\top\mathbf{b} =\begin{bmatrix}a_1&\dots&a_n\end{bmatrix}\begin{bmatrix}b_1\\\vdots\\ b_n\end{bmatrix} \end{aligned} \)


Geometric Definition#

Let \(\theta\) be the angle between the representations of \(\mathbf{a}\) and \(\mathbf{b}\) that start at the origin, where \(0\le\theta\le\pi\).

In other words, let \(\mathbf{a}\) and \(\mathbf{b}\) be the line segments \(\vec{OA}\) and \(\vec{OB}\), respectively.

\(\mathbf{a}\cdot\mathbf{b}=\|\mathbf{a}\|\|\mathbf{b}\|\cos\theta\)

If \(\mathbf{a}\) and \(\mathbf{b}\) are parallel, then \(\theta=0\).

If \(\mathbf{a}\) and \(\mathbf{b}\) are antiparallel, then \(\theta=\pi\).

Proof

from the Law of Cosines

\( \begin{aligned} |AB|^2&=|OA|^2+|OB|^2-2|OA||OB|\cos\theta\\ \implies\\ |\mathbf{a}-\mathbf{b}|^2 &=|\mathbf{a}|^2+|\mathbf{b}|^2-2|\mathbf{a}||\mathbf{b}|\cos\theta\\ \end{aligned} \)

\( \begin{aligned} |\mathbf{a}-\mathbf{b}|^2 &=(\mathbf{a}-\mathbf{b})\cdot(\mathbf{a}-\mathbf{b})\\ &=\mathbf{a}\cdot(\mathbf{a}-\mathbf{b})-\mathbf{b}\cdot(\mathbf{a}-\mathbf{b})\\ &=\mathbf{a}\cdot\mathbf{a}-\mathbf{a}\cdot\mathbf{b}-\mathbf{b}\cdot\mathbf{a}+\mathbf{b}\cdot\mathbf{b}\\ &=|\mathbf{a}|^2-2\mathbf{a}\cdot\mathbf{b}+|\mathbf{b}|^2\\ \end{aligned} \)

\( \begin{aligned} |\mathbf{a}-\mathbf{b}|^2 &=|\mathbf{a}|^2+|\mathbf{b}|^2-2|\mathbf{a}||\mathbf{b}|\cos\theta\\ \implies\\ |\mathbf{a}|^2-2\mathbf{a}\cdot\mathbf{b}+|\mathbf{b}|^2 &=|\mathbf{a}|^2+|\mathbf{b}|^2-2|\mathbf{a}||\mathbf{b}|\cos\theta\\ \implies\\ -2\mathbf{a}\cdot\mathbf{b} &=-2|\mathbf{a}||\mathbf{b}|\cos\theta\\ \implies\\ \mathbf{a}\cdot\mathbf{b} &=|\mathbf{a}||\mathbf{b}|\cos\theta\\ \end{aligned} \)

\( \blacksquare \)


Corollary: the angle between two vectors#

If \(\theta\) is the angle between the nonzero vectors \(\mathbf{a}\) and \(\mathbf{b}\), then

\( \begin{aligned} \cos\theta=\frac{\mathbf{a}\cdot\mathbf{b}}{|\mathbf{a}||\mathbf{b}|} \end{aligned} \)


Properties of the Dot Product#


Dot Product of a vector with itself#

Let \(\mathbf{a}\in\mathbb{R}^n\) be a vector.

\( \mathbf{a}\cdot\mathbf{a}=|\mathbf{a}|^2 \)

Proof

\( \begin{aligned} \mathbf{a}\cdot\mathbf{a} &=\langle a_1,...,a_n\rangle\cdot\langle a_1,...,a_n\rangle\\ &=a_1a_1+...+a_na_n\\ &=a_1^2+...+a_n^2\\ &=\left(\sqrt{a_1^2+...+a_n^2}\right)^2\\ &=|\mathbf{a}|^2\\ \end{aligned} \)

\( \blacksquare \)


Commutativity#

Let \(\mathbf{a},\mathbf{b}\in\mathbb{R}^n\) be vectors.

\( \mathbf{a}\cdot\mathbf{b}=\mathbf{b}\cdot\mathbf{a} \)

Proof

\( \begin{aligned} \mathbf{a}\cdot\mathbf{b} &=\langle a_1,...,a_n\rangle\cdot\langle b_1,...,b_n\rangle\\ &=a_1b_1+...+a_nb_n\\ &=b_1a_1+...+b_na_n\\ &=\langle b_1,...,b_n\rangle\cdot\langle a_1,...,a_n\rangle\\ &=\mathbf{b}\cdot\mathbf{a}\\ \end{aligned} \)

\( \blacksquare \)


Distributivity over vector addition#

Let \(\mathbf{a},\mathbf{b},\mathbf{c}\in\mathbb{R}^n\) be vectors.

\( \mathbf{a}\cdot(\mathbf{b}+\mathbf{c})=\mathbf{a}\cdot\mathbf{b}+\mathbf{a}\cdot\mathbf{c} \)

Proof

\( \begin{aligned} \mathbf{a}\cdot(\mathbf{b}+\mathbf{c}) &=\langle a_1,...,a_n\rangle\cdot(\langle b_1,...,b_n\rangle+\langle c_1,...,c_n\rangle)\\ &=\langle a_1,...,a_n\rangle\cdot\langle b_1+c_1,...,b_n+c_n\rangle\\ &=a_1(b_1+c_1)+...+a_n(b_n+c_n)\\ &=a_1b_1+a_1c_1+...+a_nb_n+a_nc_n\\ &=(a_1b_1+...+a_nb_n)+(a_1c_1+...+a_nc_n)\\ &=\langle a_1,...,a_n\rangle\cdot\langle b_1,...,b_n\rangle+\langle a_1,...,a_n\rangle\cdot\langle c_1,...,c_n\rangle\\ &=\mathbf{a}\cdot\mathbf{b}+\mathbf{a}\cdot\mathbf{c}\\ \end{aligned} \)

\( \blacksquare \)


Scalar Multiplication#

Let \(\mathbf{a},\mathbf{b}\in\mathbb{R}^n\) be vectors and \(c\in\mathbb{R}\) a scalar.

\( (c\mathbf{a})\cdot\mathbf{b}=c(\mathbf{a}\cdot\mathbf{b})=\mathbf{a}\cdot(c\mathbf{b}) \)

Proof

\( \begin{aligned} (c\mathbf{a})\cdot\mathbf{b} &=(c\langle a_1,...,a_n\rangle)\cdot\langle b_1,...,b_n\rangle\\ &=\langle ca_1,...,ca_n\rangle\cdot\langle b_1,...,b_n\rangle\\ &=ca_1b_1+...+ca_nb_n\\ &=c(a_1b_1+...+a_nb_n)\\ &=c(\langle a_1,...,a_n\rangle\cdot\langle b_1,...,b_n\rangle)\\ &=c(\mathbf{a}\cdot\mathbf{b})\\ &=a_1cb_1+...+a_ncb_n\\ &=\langle a_1,...,a_n\rangle\cdot\langle cb_1,...,cb_n\rangle\\ &=\langle a_1,...,a_n\rangle\cdot(c\langle b_1,...,b_n\rangle)\\ &=\mathbf{a}\cdot(c\mathbf{b})\\ \end{aligned} \)

\( \blacksquare \)


Dot Product with the zero vector#

Let \(\mathbf{a}\in\mathbb{R}^n\) be a vector.

\( \mathbf{0}\cdot\mathbf{a}=0 \)

Proof

\( \begin{aligned} \mathbf{0}\cdot\mathbf{a} &=\langle0,...,0\rangle\cdot\langle a_1,...,a_n\rangle\\ &=0\cdot a_1+...+0\cdot a_n\\ &=0 \end{aligned} \)

\( \blacksquare \)


Exercises#


\( \langle2,4\rangle\cdot\langle3,-1\rangle =2\cdot3+4\cdot-1 =6-4 =2 \)


\( \langle-1,7,4\rangle\cdot\left\langle6,2,-\frac{1}{2}\right\rangle =-1\cdot6+7\cdot2+4\cdot-\frac{1}{2} =-6+14-2 =6 \)


\( (\mathbf{i}+2\mathbf{j}-3\mathbf{k})\cdot(2\mathbf{j}-\mathbf{k}) =1\cdot0+2\cdot2+-3\cdot-1 =4+3 =7 \)


Terms#

  • [W] Dot Product