3.6. Dot and cross products#

There are two ways in which we calculate the product of two vectors, these are known as the dot product and the cross product.


3.6.1. Dot product#

Definition 3.6 (The dot product)

The dot product (also known as the scalar product) of two vectors \(\mathbf{a}\) and \(\mathbf{b}\) in \(\mathbb{R}^n\), is defined by

(3.3)#\[ \mathbf{a} \cdot \mathbf{b} = \sum_{i=1}^n a_ib_i = a_1b_1 + a_2b_2 + \cdots + a_nb_n. \]

The dot product of two vectors \(\mathbf{a}\) and \(\mathbf{b}\), can be defined in geometric terms by

(3.4)#\[ \mathbf{a} \cdot \mathbf{b} = \|\mathbf{a}\| \|\mathbf{b}\| \cos(\theta), \]

where \(\theta\) is the angle between \(\mathbf{a}\) and \(\mathbf{b}\) (Fig. 3.8).

../_images/3_dot_product.svg

Fig. 3.8 The dot product \(\mathbf{a} \cdot \mathbf{b}\) is a scalar that is related to the angle between \(\mathbf{a}\) and \(\mathbf{b}\).#

From the definition of the dot product, we can observe the following:

  • The dot product produces is a scalar quantity (an element of \(\mathbb{R}\))

  • The dot product of two perpendicular vectors is zero, we write \(\mathbf{a}\perp\mathbf{b}\) if \(\mathbf{a}\cdot\mathbf{b}=0\)

  • The dot product of two co-directional (parallel) vectors \(\mathbf{a}\) and \(\mathbf{b}\) is equal to \(\|\mathbf{a}\| \|\mathbf{b}\|\)

Theorem 3.4 (Properties of the dot product)

For any three vectors \(\mathbf{a},\mathbf{b},\mathbf{c}\) in \(\mathbb{R}^n\) and any scalar \(k\) in \(\mathbb{R}\) the following properties are satisfied

  • \((\mathbf{a} + \mathbf{b})\cdot \mathbf{c} = \mathbf{a} \cdot \mathbf{c} + \mathbf{b} \cdot \mathbf{c}\)   (distributive over vector addition)

  • \((k \mathbf{a})\cdot \mathbf{b} = \mathbf{a} \cdot (k \mathbf{b})= k (\mathbf{a} \cdot \mathbf{b})\)   (associative over scalar multiplication)

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

  • \(\mathbf{a} \cdot \mathbf{a} = \|\mathbf{a}\|^2 \geq 0 \text{ and } \mathbf{a} \cdot \mathbf{a} = 0 \iff \mathbf{a} = \mathbf{0}\)

Example 3.3

Given the vectors \(\mathbf{a} = (1, 2, 3)\) and \(\mathbf{b} = (3, -1, 0)\). Calculate:

(i)   \(\mathbf{a} \cdot \mathbf{b}\);   (ii)   the angle between \(\mathbf{a}\) and \(\mathbf{b}\)


Solution

(i)   Using equation (3.3)

\[\begin{split} \begin{align*} \mathbf{a} \cdot \mathbf{b} = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} \cdot \begin{pmatrix} 3 \\ -1 \\ 0 \end{pmatrix} = 1(3) + 2(-1) + 3(0) = 3 - 2 + 0 = 1 \end{align*} \end{split}\]

(ii)   Using equation (3.4)

\[\begin{split} \begin{align*} \mathbf{a} \cdot \mathbf{b} &= \|\mathbf{a}\| \|\mathbf{b}\| \cos(\theta) \\ \therefore \theta &= \cos^{-1} \left( \frac{\mathbf{a} \cdot \mathbf{b}}{\|\mathbf{a}\|\|\mathbf{b}\|}\right) \\ &= \cos^{-1} \left( \frac{1}{\sqrt{14}\sqrt{10}}\right) \approx 1.4862. \end{align*} \end{split}\]

Note: angles should be expressed in radians at all times.

3.6.1.1. Dot product in matrix multiplication#

We have already seen that the multiplication of two matrices is defined by

\[ [AB]_{ij} = \sum_{k = 1}^n a_{ik}b_{kj}. \]

You may note that the term in the summation is similar to the dot product. In fact, when we multiply two matrices together we are calculating the dot product between the rows of the left-hand matrix and the columns of the right-hand matrix, i.e.,

\[ [AB]_{ij} = \mathbf{a}_i \cdot \mathbf{b}_j, \]

where \(\mathbf{a}_i\) is row \(i\) of \(A\) and \(\mathbf{b}_j\) is column \(j\) of \(B\).


3.6.2. The cross product#

Definition 3.7 (The cross product)

The cross product (also known as the vector product) of two vectors in \(\mathbb{R}^3\), \(\mathbf{a}=(a_1,a_2,a_3)\) and \(\mathbf{b}=(b_1,b_2,b_3)\) can be calculated using a determinant where

(3.5)#\[\begin{split}\mathbf{a} \times \mathbf{b} = \det \begin{pmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{pmatrix}. \end{split}\]

and \(\mathbf{i} = (1, 0, 0)\), \(\mathbf{j} = (0, 1, 0)\) and \(\mathbf{k} = (0, 0, 1)\). The cross product between two vectors \(\mathbf{a}\) and \(\mathbf{b}\) returns a vector that is perpendicular to both \(\mathbf{a}\) and \(\mathbf{b}\).

../_images/3_cross_product.svg

Fig. 3.9 The cross product \(\mathbf{a} \times \mathbf{b}\) is another vector perpendicular to both \(\mathbf{a}\) and \(\mathbf{b}\).#

Theorem 3.5 (Properties of the cross product)

Given three vectors \(\mathbf{a}, \mathbf{b}, \mathbf{c} \in \mathbb{R}^3\) the following properties are satisfied:

  • \(\mathbf{a}\times \mathbf{b}\) produces a vector in the same space as \(\mathbf{a}\) and \(\mathbf{b}\)

  • \(\mathbf{a}\times \mathbf{b}\) produces a vector that is perpendicular to both \(\mathbf{a}\) and \(\mathbf{b}\)

  • \(\mathbf{a} \times \mathbf{b} = -(\mathbf{b} \times \mathbf{a})\)

  • \(\mathbf{a}\times \mathbf{b} = \mathbf{0} \implies \mathbf{a} \parallel \mathbf{b}\)   (if the cross product of two vectors is the zero vector then the two vectors are parallel)

  • \(\mathbf{a} \times \mathbf{b} = \mathbf{0}\)

  • \(\mathbf{a} \times \mathbf{b} \neq \mathbf{b} \times \mathbf{a}\)   (non-commutative)

  • \(\mathbf{a} \times (\mathbf{b} + \mathbf{c}) = (\mathbf{a} \times \mathbf{b}) + (\mathbf{a} \times \mathbf{c})\)   (distributive over vector addition)

  • \(\mathbf{a} \times (\mathbf{b} \times \mathbf{c}) \neq (\mathbf{a} \times \mathbf{b}) \times \mathbf{c}\)   (non-associative)

Example 3.4

Calculate the cross product between the vectors \(\mathbf{a} = (1, 2, 3)\) and \(\mathbf{b} = (4, 5, 6)\) and show that it is perpendicular to both \(\mathbf{a}\) and \(\mathbf{b}\).


Solution

\[\begin{split} \begin{align*} \mathbf{a} \times \mathbf{b} &= \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ 1 & 2 & 3 \\ 4 & 5 & 6 \end{vmatrix} = (12 - 15)\mathbf{i} - (6 - 12) \mathbf{j} + (5 - 8) \mathbf{k} \\ &= -3\mathbf{i} + 6 \mathbf{j} - 3\mathbf{k} = (-3, 6, -3). \end{align*} \end{split}\]

To show that \(\mathbf{a} \times \mathbf{b} \perp \mathbf{a}, \mathbf{b}\) we check whether the dot product between \((3, 6, -3)\) and the vectors \(\mathbf{a}\) and \(\mathbf{b}\) is zero

\[\begin{split} \begin{align*} \mathbf{a} \cdot (\mathbf{a} \times \mathbf{b}) &= \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} \cdot \begin{pmatrix} -3 \\ 6 \\ -3 \end{pmatrix} = -3 + 12 - 9 = 0, \\ \mathbf{b} \cdot (\mathbf{a} \times \mathbf{b}) &= \begin{pmatrix} 4 \\ 5 \\ 6 \end{pmatrix} \cdot \begin{pmatrix} -3 \\ 6 \\ -3 \end{pmatrix} = -12 + 30 - 18 = 0, \end{align*} \end{split}\]

therefore \(\mathbf{a} \times \mathbf{b}\) is perpendicular to both \(\mathbf{a}\) and \(\mathbf{b}\).