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 \(\vec{a}\) and \(\vec{b}\) in \(\mathbb{R}^n\), is defined by

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

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

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

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

../_images/3_dot_product.svg

Fig. 3.9 The dot product \(\vec{a} \cdot \vec{b}\) is a scalar that is related to the angle between \(\vec{a}\) and \(\vec{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 \(\vec{a}\perp\vec{b}\) if \(\vec{a}\cdot\vec{b}=0\)

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

Theorem 3.4 (Properties of the dot product)

For any vectors \(\vec{a},\vec{b},\vec{c}\) in \(\mathbb{R}^n\) and any scalar \(k\) in \(\mathbb{R}\):

  • The dot product is distributive over vector addition, i.e., \((\vec{a} + \vec{b})\cdot \vec{c} = \vec{a} \cdot \vec{c} + \vec{b} \cdot \vec{c}\)

  • For any scalar \(k\), \((k \vec{a})\cdot \vec{b} = \vec{a} \cdot (k \vec{b})= k (\vec{a} \cdot \vec{b})\)

  • The dot product is commutative, i.e., \(\vec{a} \cdot \vec{b} = \vec{b} \cdot \vec{a}\);

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

Example 3.4

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

(i)   \(\vec{a} \cdot \vec{b}\)

Solution

Using equation (3.3)

\[\begin{split} \begin{align*} \vec{a} \cdot \vec{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)   the angle between \(\vec{a}\) and \(\vec{b}\)

Solution

Using equation (3.4)

\[\begin{split} \begin{align*} \vec{a} \cdot \vec{b} &= \|\vec{a}\| \|\vec{b}\| \cos(\theta) \\ \therefore \theta &= \cos^{-1} \left( \frac{\vec{a} \cdot \vec{b}}{\|\vec{a}\|\|\vec{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. 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} = \vec{a}_i \cdot \vec{b}_j, \]

where \(\vec{a}_i\) is row \(i\) of \(A\) and \(\vec{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\), \(\vec{a}=(a_1,a_2,a_3)\) and \(\vec{b}=(b_1,b_2,b_3)\) can be calculated using a determinant where

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

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

../_images/3_cross_product.svg

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

Theorem 3.5 (Properties of the cross product)

The cross product has the following properties:

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

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

  • \(\vec{a} \times \vec{b} = -(\vec{b} \times \vec{a})\)   (i.e., there are two vectors perpendicular to \(\vec{a}\) and \(\vec{b}\) pointing in opposite directions)

  • If \(\vec{a}\) and \(\vec{b}\) are parallel vectors, then \(\vec{a}\times \vec{b} = \vec{0}\)

  • The self cross product of a vector is the zero vector, i.e., \(\vec{a} \times \vec{a} = \vec{0}\)

  • The cross product is not commutative, i.e., \(\vec{a} \times \vec{b} \neq \vec{b} \times \vec{a}\)

  • The cross product is distributive over addition, i.e., \(\vec{a} \times (\vec{b} + \vec{c}) = (\vec{a} \times \vec{b}) + (\vec{a} \times \vec{c})\)

  • The cross product is not associative, i.e., \(\vec{a} \times (\vec{b} \times \vec{c}) \neq (\vec{a} \times \vec{b}) \times \vec{c}\)

Example 3.5

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

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

To show that \(\vec{a} \times \vec{b} \perp \vec{a}, \vec{b}\) we calculate the dot product

\[\begin{split} \begin{align*} \vec{a} \cdot (\vec{a} \times \vec{b}) &= \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} \cdot \begin{pmatrix} -3 \\ 6 \\ -3 \end{pmatrix} = -3 + 12 - 9 = 0, \\ \vec{b} \cdot (\vec{a} \times \vec{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 \(\vec{a} \times \vec{b}\) is perpendicular to both \(\vec{a}\) and \(\vec{b}\).