Vector Products

Let V be a vector space under the field 𝔽, where 𝔽 is either ℚ (ratinal numbers) or ℝ (real numbers) or ℂ (complex numbers). The bilinear functions from V × V into 𝔽 were considered in sections regarding dot product and inner product. In this section, we consider two important vector products, known as cross product and outer product.

It is well-known that a vector space can be equipped with a product operation (besides vecor addition) only for dimensions 1 and 2. The cross product is a successful attempt to implement the product in a three-dimensional vector space, but loosing comutative property of multiplication. On the other hand, the outer product assigns a matrix to two vectors of arbitrary size.

 

Vector or Cross product


Given two space vectors, a and b, we can find a third space vector c, called the cross product of a and b, and denoted by c = a × <>b. The magnitude of c is defined by |c| = |a| |b| sin(θ), where θ is the angle between a and b. The direction of c is given by the right-hand rule: If a is turned to b (note the order in which a and b appear here) through the angle between a and b, a (right-handed) screw that is perpendicular to a and b will advance in the direction of a × b. This definition implies that
\[ {\bf a} \times {\bf b} = - {\bf b} \times {\bf a} . \]
This property is described by saying that the cross product is antisymmetric. The definition also implies that
\[ {\bf a} \cdot \left( {\bf a} \times {\bf b}\right) = {\bf b} \cdot \left( {\bf a} \times {\bf b}\right) = {\bf 0} . \]
That is, a × b is perpendicular to both a and b. The vector product has the following properties:
\begin{align*} {\bf a} \times \left( \alpha {\bf b}\right) &= \left( \alpha {\bf a} \right) \times {\bf b} = \alpha \left( {\bf a} \times {\bf b}\right) , \\ {\bf a} \times \left( {\bf b} + {\bf c} \right) &= {\bf a} \times {\bf b} + {\bf a} \times {\bf c} , \\ {\bf a} \times {\bf a} &= {\bf 0} . \end{align*}
Using these properties, we can write the vector product of two vectors in terms of their components. We are interested in a more general result valid in other coordinate systems as well. So, rather than using x, y, and z as subscripts for unit vectors, we use the numbers 1, 2, and 3. In that case, our results can also be used for spherical and cylindrical coordinates which we shall discuss shortly.
\begin{align*} {\bf a} \times {\bf b} &= \left( \alpha_1 \hat{\bf e}_1 + \alpha_2 \hat{\bf e}_2 + \alpha_3 \hat{\bf e}_3 \right) \times \left( \beta_1 \hat{\bf e}_1 + \beta_2 \hat{\bf e}_2 + \beta_3 \hat{\bf e}_3 \right) \\ &= \alpha_1 \beta_1 \hat{\bf e}_1 \times \hat{\bf e}_1 + \alpha_1 \beta_2 \hat{\bf e}_1 \times \hat{\bf e}_2 + \alpha_1 \beta_3 \hat{\bf e}_1 \times \hat{\bf e}_3 \\ & \quad + \alpha_2 \beta_1 \hat{\bf e}_2 \times \hat{\bf e}_1 + \alpha_2 \beta_2 \hat{\bf e}_2 \times \hat{\bf e}_2 + \alpha_2 \beta_3 \hat{\bf e}_2 \times \hat{\bf e}_3 \\ & \quad + \alpha_3 \beta_1 \hat{\bf e}_3 \times \hat{\bf e}_1 + \alpha_3 \beta_2 \hat{\bf e}_3 \times \hat{\bf e}_2 + \alpha_3 \beta_3 \hat{\bf e}_3 \times \hat{\bf e}_3 \end{align*}
Using the antisymmetry property of cross product, we have
\[ \hat{\bf e}_1 \times \hat{\bf e}_1 = \hat{\bf e}_2 \times \hat{\bf e}_2 = \hat{\bf e}_3 \times \hat{\bf e}_3 = {\bf 0}. \]
Also, if we assume that \( \hat{\bf e}_1 , \ \hat{\bf e}_2 , \ \hat{\bf e}_3 \) form a so-called right-handed set, i.e., if
\begin{align} \notag \hat{\bf e}_1 \times \hat{\bf e}_2 &= - \hat{\bf e}_2 \times \hat{\bf e}_1 = \hat{\bf e}_3 , \\ \hat{\bf e}_1 \times \hat{\bf e}_3 &= - \hat{\bf e}_3 \times \hat{\bf e}_1 = - \hat{\bf e}_2 , \label{EqCross.1} \\ \hat{\bf e}_2 \times \hat{\bf e}_3 &= - \hat{\bf e}_3 \times \hat{\bf e}_2 = \hat{\bf e}_1 , \notag \end{align}
then we obtain
\[ {\bf a} \times {\bf b} = \left( \alpha_2 \beta_3 - \alpha_3 \beta_2 \right) \hat{\bf e}_1 + \left( \alpha_3 \beta_1 - \alpha_1 \beta_3 \right) \hat{\bf e}_2 + \left( \alpha_1 \beta_2 - \alpha_2 \beta_1 \right) \hat{\bf e}_3 . \]
So
\begin{equation} \label{EqCross.2} {\bf a} \times {\bf b} = \det \begin{bmatrix} \hat{\bf e}_1 & \hat{\bf e}_2 & \hat{\bf e}_3 \\ \alpha_1 & \alpha_2 & \alpha_3 \\ \beta_1 & \beta_2 & \beta_3 \end{bmatrix} \end{equation}
Example 1: From the definition of the vector product, it follows that
\[ \left\vert {\bf a} \times {\bf b} \right\vert = \mbox{ area of the parallelogram defined by} \quad {\bf a} \mbox{ and } {\bf b} . \]
So we can use Eq.\eqref{EqCross.2} to find the area of a parallelogram defined by two vectors directly in terms of their components. For instance, the area defined by a = (1, −1, 2) and b = (−2, 3, 1) can be found by calculating their vector product
\[ {\bf a} \times {\bf b} = \det \begin{bmatrix} \hat{\bf e}_1 & \hat{\bf e}_2 & \hat{\bf e}_3 \\ 1 & -1 & 2 \\ -2 & 3 & 1 \end{bmatrix} = -7\,{\bf i} -5\,{\bf j} + {\bf k} \]
Cross[{1,-1,2}, {-2,3,1}]
{-7, -5, 1}
Its absolute value is approximately 8.66025 .
\[ \| (-7,-5,1) \| = \sqrt{7^2 + 5^2 + 1} = \sqrt{49 + 26} = \sqrt{75} = 5\sqrt{3} \approx 8.66025 . \]
Norm[%]
5 Sqrt[3]

Example 2: The volume of a parallelepiped defined by three non-coplanar vectors a, b, and c is given by \( \displaystyle \left\vert {\bf a} \cdot \left( {\bf b} \times {\bf c} \right) \right\vert . \) The absolute value is taken to ensure the positivity of the area. In terms of components we have
\[ \mbox{volume} = \left\vert \det \begin{bmatrix} \alpha_1 & \alpha_2 & \alpha_3 \\ \beta_1 & \beta_2 & \beta_3 \\ \gamma_1 & \gamma _2 & \gamma_3 \end{bmatrix} \right\vert . \]
Taking three vectors a = (1,2,-3), b = (4, -2, 1), and c = (2, -1,-5), we find
\[ \mbox{volume} = \left\vert \det \begin{bmatrix} 1 & \phantom{-}2 & -3 \\ 4 & -2 & \phantom{-}1 \\ 2 & -1 & -5 \end{bmatrix} \right\vert = 55. \]
Det[{{1,2,-3},{4,-2,1},{2,-1,-5}}]
55

Coordinates are “functions” that specify points of a space. The smallest number of these functions necessary to specify a point P is called the dimension of that space. There are two coordinate systems used for a plane, Cartesian, denoted by (x(P), y(P), and polar, denoted by (r(P), θ(P)):

\[ x = r\,\cos\varphi , \qquad y = r\,\sin\varphi , \qquad z=z . \]
There are three widely used coordinate systems in a three-dimensional vector space ℝ³: Cartesian (x(P), y(P), z(P)), cylindrical (ρ(P), φ(P), z(P)), and spherical (r(P), θ(P), φ(P)). The latter φ(P) is called the azimuth or the azimuthal angle of P, while θ(P) is called its polar angle.
\[ x = r\,\sin\theta \,\cos\varphi , \qquad y = r\,\sin\theta \,\sin\varphi , \qquad z = r\,\cos\theta . \]

The unit vectors in the three coordinate systems are not only mutually perpendicular, but in the order in which they are given, they also form a right-handed set [see Equation (1.5)]. Therefore, we can use Equation \eqref{EqCross.2} and write

\[ {\bf a} \times {\bf b} = \underbrace{\det \begin{bmatrix} \hat{\bf e}_r & \hat{\bf e}_{\varphi} & \hat{\bf e}_{z} \\ a_r & a_{\varphi} & a_z \\ b_r & b_{\varphi} & b_z \end{bmatrix}}_{\mbox{in cylindrical CS}} = \underbrace{\det \begin{bmatrix} \hat{\bf e}_r & \hat{\bf e}_{\theta} & \hat{\bf e}_{\varphi} \\ a_r & a_{\theta} & a_{\varphi} \\ b_r & b_{\theta} & b_{\varphi} \end{bmatrix}}_{\mbox{in spherical CS}} . \]

Mathematica has three multiplication commands for vectors: the dot (or inner) and outer products (for arbitrary vectors), and the cross product (for three dimensional vectors).

For three dimensional vectors \( {\bf a} = a_1 \,{\bf i} + a_2 \,{\bf j} + a_3 \,{\bf k} = \left[ a_1 , a_2 , a_3 \right] \) and \( {\bf b} = b_1 \,{\bf i} + b_2 \,{\bf j} + b_3 \,{\bf k} = \left[ b_1 , b_2 , b_3 \right] \) , it is possible to define special multiplication, called the cross-product:

\[ {\bf a} \times {\bf b} = \det \left[ \begin{array}{ccc} {\bf i} & {\bf j} & {\bf k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{array} \right] = {\bf i} \left( a_2 b_3 - b_2 a_3 \right) - {\bf j} \left( a_1 b_3 - b_1 a_3 \right) + {\bf k} \left( a_1 b_2 - a_2 b_1 \right) . \]

The cross product can be done on two vectors. It is important to note that the cross product is an operation that is only functional in three dimensions. The operation can be computed using the Cross[vector 1, vector 2] operation or by generating a cross product operator between two vectors by pressing [Esc] cross [Esc]. ([Esc] refers to the escape button)

Cross[{1,2,7}, {3,4,5}]
{-18,16,-2}

The dot product of two vectors of the same size \( {\bf x} = \left[ x_1 , x_2 , \ldots , x_n \right] \) and \( {\bf y} = \left[ y_1 , y_2 , \ldots , y_n \right] \) (regardless of whether they are columns or rows because Mathematica does not distinguish rows from columns) is the number, denoted either by \( {\bf x} \cdot {\bf y} \) or \( \left\langle {\bf x} , {\bf y} \right\rangle ,\)

\[ \left\langle {\bf x} , {\bf y} \right\rangle = {\bf x} \cdot {\bf y} = x_1 y_1 + x_2 y_2 + \cdots + x_n y_n , \]
when entries are real, or
\[ \left\langle {\bf x} , {\bf y} \right\rangle = {\bf x} \cdot {\bf y} = \overline{x_1} y_1 + \overline{x_2} y_2 + \cdots + \overline{x_n} y_n , \]

when entries are complex. Here \( \overline{\bf x} = \overline{a + {\bf j}\, b} = a - {\bf j}\,b \) is a complex conjugate of a complex number x = a + jb.

The dot product of any two vectors of the same dimension can be done with the dot operation given as Dot[vector 1, vector 2] or with use of a period “. “ .

{1,2,3}.{2,4,6}
28
Dot[{1,2,3},{3,2,1} ]
10
With Euclidean norm ‖·‖2, the dot product formula
\[ {\bf x} \cdot {\bf y} = \| {\bf x} \|_2 \, \| {\bf y} \|_2 \, \cos \theta , \]
defines θ, the angle between two vectors. The dot product was first introduced by the American physicist and mathematician Josiah Willard Gibbs (1839--1903) in the 1880s. ■

 

Outer product


An outer product is the tensor product of two coordinate vectors \( {\bf u} = \left[ u_1 , u_2 , \ldots , u_m \right] \) and \( {\bf v} = \left[ v_1 , v_2 , \ldots , v_n \right] , \) denoted \( {\bf u} \otimes {\bf v} , \) is an m-by-n matrix W such that its coordinates satisfy \( w_{i,j} = u_i v_j . \) The outer product \( {\bf u} \otimes {\bf v} , \) is equivalent to a matrix multiplication \( {\bf u} \, {\bf v}^{\ast} , \) (or \( {\bf u} \, {\bf v}^{\mathrm T} , \) if vectors are real) provided that u is represented as a column \( m \times 1 \) vector, and v as a column \( n \times 1 \) vector. Here \( {\bf v}^{\ast} = \overline{{\bf v}^{\mathrm T}} . \)

For three dimensional vectors \( {\bf a} = a_1 \,{\bf i} + a_2 \,{\bf j} + a_3 \,{\bf k} = \left[ a_1 , a_2 , a_3 \right] \) and \( {\bf b} = b_1 \,{\bf i} + b_2 \,{\bf j} + b_3 \,{\bf k} = \left[ b_1 , b_2 , b_3 \right] \) , it is possible to define special multiplication, called cross-product:

\[ {\bf a} \times {\bf b} = \det \left[ \begin{array}{ccc} {\bf i} & {\bf j} & {\bf k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{array} \right] = {\bf i} \left( a_2 b_3 - b_2 a_3 \right) - {\bf j} \left( a_1 b_3 - b_1 a_3 \right) + {\bf k} \left( a_1 b_2 - a_2 b_1 \right) . \]
Example: For instance, if m = 4 and n = 3, then
\[ {\bf u} \otimes {\bf v} = {\bf u} \, {\bf v}^{\mathrm T} = \begin{bmatrix} u_1 \\ u_2 \\ u_3 \\ u_4 \end{bmatrix} \begin{bmatrix} v_1 & v_2 & v_3 \end{bmatrix} = \begin{bmatrix} u_1 v_1 & u_1 v_2 & u_1 v_3 \\ u_2 v_1 & u_2 v_2 & u_2 v_3 \\ u_3 v_1 & u_3 v_2 & u_3 v_3 \\ u_4 v_1 & u_4 v_2 & u_4 v_3 \end{bmatrix} . \]
In Mathematica, the outer product has a special command:
Outer[Times, {1, 2, 3, 4}, {a, b, c}]
Out[1]= {{a, b, c}, {2 a, 2 b, 2 c}, {3 a, 3 b, 3 c}, {4 a, 4 b, 4 c}}

An outer product is the tensor product of two coordinate vectors \( {\bf u} = \left[ u_1 , u_2 , \ldots , u_m \right] \) and \( {\bf v} = \left[ v_1 , v_2 , \ldots , v_n \right] , \) denoted \( {\bf u} \otimes {\bf v} , \) is an m-by-n matrix W of rank 1 such that its coordinates satisfy \( w_{i,j} = u_i v_j . \) The outer product \( {\bf u} \otimes {\bf v} , \) is equivalent to a matrix multiplication \( {\bf u} \, {\bf v}^{\ast} , \) (or \( {\bf u} \, {\bf v}^{\mathrm T} , \) if vectors are real) provided that u is represented as a column \( m \times 1 \) vector, and v as a column \( n \times 1 \) vector. Here \( {\bf v}^{\ast} = \overline{{\bf v}^{\mathrm T}} . \)

Example 3: Taking, for instance, m = 4 and n = 3, we have
\[ {\bf u} \otimes {\bf v} = {\bf u} \, {\bf v}^{\mathrm T} = \begin{bmatrix} u_1 \\ u_2 \\ u_3 \\ u_4 \end{bmatrix} \begin{bmatrix} v_1 & v_2 & v_3 \end{bmatrix} = \begin{bmatrix} u_1 v_1 & u_1 v_2 & u_1 v_3 \\ u_2 v_1 & u_2 v_2 & u_2 v_3 \\ u_3 v_1 & u_3 v_2 & u_3 v_3 \\ u_4 v_1 & u_4 v_2 & u_4 v_3 \end{bmatrix} . \]
If we take two vectors \( {\bf u} = [1, 2, 3, 4] \) and \( {\bf v} = [-1, 0, 2] , \) then their outer product is
\[ {\bf u} \otimes {\bf v} = {\bf u} \, {\bf v}^{\mathrm T} = \begin{bmatrix} -1 &0&2 \\ -2&0&4 \\ -3&0&6 \\ -4&0&8 \end{bmatrix} , \]
{{1}, {2}, {3}, {4}}.{{-1, 0, 2}}
MatrixRank[%]
Out[2]= 1
which is rank 1 matrix. ■

Example 4:

The outer product operation can be extended for matrices. If A is an m×n matrix and B is an p×q matrix, then their outer product AB is mp×nq matrix:

\[ {\bf A} \otimes {\bf B} = \begin{bmatrix} a_{1,1} {\bf B} & \cdots & a_{1,n} {\bf B} \\ \vdots & \ddots & \vdots \\ a_{m,1} {\bf B} & \cdots & a_{m,n} {\bf B} \end{bmatrix} . \]
Example 5: