Skip to main content
Mathematics LibreTexts

4.3: Dot and Cross Product

  • Page ID
    197426
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives
    • Compute the dot product of vectors, and use it to compute vector projections.
    • Compute the cross product and the box product of vectors in \(\mathbb{R}^3.\)

    This section explores two fundamental operations for vectors: the dot product and the cross product. These operations are widely used in applications involving vectors in \(\mathbb{R}^{n}\).

    The Dot Product

    There are two ways of multiplying vectors which are of great importance in applications. The first of these is called the dot product. When we take the dot product of vectors, the result is a scalar. For this reason, the dot product is also called the scalar product and sometimes the inner product. The definition is as follows.

    Definition \(\PageIndex{1}\): Dot Product

    Let \(\vec{u},\vec{v}\) be two vectors in \(\mathbb{R}^{n}\). Then we define the dot product \(\vec{u}\bullet \vec{v}\) as \[\vec{u}\bullet \vec{v} = \sum_{k=1}^{n}u_{k}v_{k}\nonumber \]

    The dot product \(\vec{u}\bullet \vec{v}\) is sometimes denoted as \((\vec{u},\vec{v})\). It can also be written as \(\left\langle \vec{u},\vec{v}\right\rangle\). If we write the vectors as column or row matrices, it is equal to the matrix product \(\vec{v}\vec{w}^{T}\).

    With this definition, there are several important properties satisfied by the dot product.

    Proposition \(\PageIndex{1}\): Properties of the Dot Product

    Let \(k\) and \(p\) denote scalars and \(\vec{u},\vec{v},\vec{w}\) denote vectors. Then the dot product \(\vec{u} \bullet \vec{v}\) satisfies the following properties.

    • \(\vec{u}\bullet \vec{v}= \vec{v}\bullet \vec{u}\)
    • \(\vec{u}\bullet \vec{u}\geq 0 \text{ and equals zero if and only if }\vec{u}=\vec{0}\)
    • \(\left( k\vec{u}+p\vec{v}\right) \bullet \vec{w}=k\left( \vec{u}\bullet \vec{w}\right) +p\left( \vec{v}\bullet \vec{w}\right)\)
    • \(\vec{u}\bullet\left( k\vec{v}+p\vec{w}\right) =k\left( \vec{u}\bullet \vec{v}\right) +p\left( \vec{u}\bullet \vec{w}\right)\)
    • \(\| \vec{u}\| ^{2}=\vec{u}\bullet \vec{u}\)
    Proof

    The proof is left as an exercise.

    This proposition tells us that we can also use the dot product to find the length of a vector.

    The Cauchy Schwarz inequality is a fundamental inequality satisfied by the dot product. It is given in the following theorem.

    Theorem \(\PageIndex{1}\): Cauchy Schwarz Inequality

    The dot product satisfies the inequality \[\left\vert \vec{u}\bullet \vec{v}\right\vert \leq \| \vec{u}\| \| \vec{v}\| \label{cauchy}\] Furthermore equality is obtained if and only if one of \(\vec{u}\) or \(\vec{v}\) is a scalar multiple of the other.

    Proof

    First note that if \(\vec{v}=\vec{0}\) both sides of \(\eqref{cauchy}\) equal zero and so the inequality holds in this case. Therefore, it will be assumed in what follows that \(\vec{v}\neq \vec{0}\).

    Define a function of \(t\in \mathbb{R}\) by \[f\left( t\right) =\left( \vec{u}+t\vec{v}\right) \bullet \left( \vec{u}+ t\vec{v}\right)\nonumber \] Then by Proposition \(\PageIndex{1}\), \(f\left( t\right) \geq 0\) for all \(t\in \mathbb{R}\). Also from Proposition \(\PageIndex{1}\) \[\begin{aligned} f\left( t\right) &=\vec{u}\bullet \left( \vec{u}+t\vec{v}\right) + t\vec{v}\bullet \left( \vec{u}+t\vec{v}\right) \\ &=\vec{u}\bullet \vec{u}+t\left( \vec{u}\bullet \vec{v}\right) + t \vec{v}\bullet \vec{u}+ t^{2}\vec{v}\bullet \vec{v} \\ &=\| \vec{u}\| ^{2}+2t\left( \vec{u}\bullet \vec{v}\right) +\| \vec{v}\| ^{2}t^{2}\end{aligned}\]

    Now this means the graph of \(y=f\left( t\right)\) is a parabola which opens up and either its vertex touches the \(t\) axis or else the entire graph is above the \(t\) axis. In the first case, there exists some \(t\) where \(f\left( t\right) =0\) and this requires \(\vec{u}+t\vec{v}=\vec{0}\) so one vector is a multiple of the other. Then clearly equality holds in \(\eqref{cauchy}\). In the case where \(\vec{v}\) is not a multiple of \(\vec{u}\), it follows \(f\left( t\right) >0\) for all \(t\) which says \(f\left( t\right)\) has no real zeros and so from the quadratic formula, \[\left( 2\left( \vec{u}\bullet \vec{v}\right) \right) ^{2}-4\| \vec{u} \| ^{2}\| \vec{v}\| ^{2}<0\nonumber \] which is equivalent to \(\left\vert \vec{u}\bullet \vec{v} \right\vert <\| \vec{u}\| \| \vec{v}\|\).

    Notice that this proof was based only on the properties of the dot product listed in Proposition \(\PageIndex{1}\). This means that whenever an operation satisfies these properties, the Cauchy Schwarz inequality holds. There are many other instances of these properties besides vectors in \(\mathbb{R}^{n}\).

    The Cauchy Schwarz inequality provides another proof of the triangle inequality for distances in \(\mathbb{R}^{n}\).

    Theorem \(\PageIndex{2}\): Triangle Inequality

    For \(\vec{u},\vec{v}\in \mathbb{R}^{n}\) \[\| \vec{u}+\vec{v}\| \leq \| \vec{u}\| +\| \vec{v} \| \label{triangleineq1}\] and equality holds if and only if one of the vectors is a non-negative scalar multiple of the other.

    Also \[\| \| \vec{u}\| -\| \vec{v}\| \| \leq \| \vec{u}-\vec{v}\| \label{triangleineq2}\]

    Proof

    By properties of the dot product and the Cauchy Schwarz inequality, \[\begin{aligned} \| \vec{u}+\vec{v}\| ^{2} &= \left( \vec{u}+\vec{v}\right) \bullet \left( \vec{u}+\vec{v}\right) \\ & =\left( \vec{u}\bullet \vec{u}\right) +\left( \vec{u}\bullet \vec{v}\right) +\left(\vec{v}\bullet \vec{u}\right) +\left( \vec{v}\bullet \vec{v}\right) \\ &=\| \vec{u}\| ^{2}+2\left( \vec{u}\bullet \vec{v}\right)+\| \vec{v}\| ^{2} \\ &\leq \| \vec{u}\| ^{2}+2\left\vert \vec{u}\bullet \vec{v}\right\vert +\| \vec{v}\| ^{2} \\ &\leq \| \vec{u}\| ^{2}+2\| \vec{u}\| \| \vec{v}\| +\| \vec{v}\| ^{2} =\left( \| \vec{u}\| +\| \vec{v}\|\right) ^{2}\end{aligned}\] Hence, \[\| \vec{u}+\vec{v}\| ^{2} \leq \left( \| \vec{u}\| +\| \vec{v}\| \right) ^{2}\nonumber \] Taking square roots of both sides you obtain \(\eqref{triangleineq1}\).

    It remains to consider when equality occurs. Suppose \(\vec{u} = \vec{0}\). Then, \(\vec{u} = 0 \vec{v}\) and the claim about when equality occurs is verified. The same argument holds if \(\vec{v} = \vec{0}\). Therefore, it can be assumed both vectors are nonzero. To get equality in \(\eqref{triangleineq1}\) above, Theorem \(\PageIndex{1}\) implies one of the vectors must be a multiple of the other. Say \(\vec{v}= k \vec{u}\). If \(k <0\) then equality cannot occur in \(\eqref{triangleineq1}\) because in this case \[\vec{u}\bullet \vec{v} =k \| \vec{u}\| ^{2}<0<\left| k \right| \| \vec{u}\| ^{2}=\left| \vec{u}\bullet \vec{v}\right|\nonumber \] Therefore, \(k \geq 0.\)

    To get the other form of the triangle inequality write \[\vec{u}=\vec{u}-\vec{v}+\vec{v}\nonumber \] so \[\begin{aligned} \| \vec{u}\| & =\| \vec{u}-\vec{v}+\vec{v}\| \\ & \leq \| \vec{u}-\vec{v}\| +\| \vec{v}\| \end{aligned}\] Therefore, \[\| \vec{u}\| -\| \vec{v}\| \leq \| \vec{u}-\vec{v} \| \label{triangleineq3}\] Similarly, \[\| \vec{v}\| -\| \vec{u}\| \leq \| \vec{v}-\vec{u} \| =\| \vec{u}-\vec{v}\| \label{triangleineq4}\] It follows from \(\eqref{triangleineq3}\) and \(\eqref{triangleineq4}\) that \(\eqref{triangleineq2}\) holds. This is because \(\left| \| \vec{u}\| -\| \vec{v}\| \right|\) equals the left side of either \(\eqref{triangleineq3}\) or \(\eqref{triangleineq4}\) and either way, \(\left| \| \vec{u}\| -\| \vec{v}\| \right| \leq \| \vec{u}-\vec{v}\|\).

    The Geometric Significance of the Dot Product

    Given two vectors, \(\vec{u}\) and \(\vec{v}\), the included angle is the angle between these two vectors which is given by \(\theta\) such that \(0 \leq \theta \leq \pi\). The dot product can be used to determine the included angle between two vectors. Consider the following picture where \(\theta\) gives the included angle.

    Diagram illustrating vectors in \(\mathbb{R}^{n}\).

    Figure \(\PageIndex{1}\): Diagram illustrates the included angle \(\theta\) between two vectors \(\vec{u}\) and \(\vec{v}\). (CC BY-NC-SA 4.0; Kuttler via A First Course in LINEAR ALGEBRA)
    Proposition \(\PageIndex{2}\): The Dot Product and the Included Angle

    Let \(\vec{u}\) and \(\vec{v}\) be two vectors in \(\mathbb{R}^n\), and let \(\theta\) be the included angle. Then the following equation holds. \[\vec{u}\bullet \vec{v}=\| \vec{u}\| \| \vec{v} \| \cos \theta\nonumber \]

    In words, the dot product of two vectors equals the product of the magnitude (or length) of the two vectors multiplied by the cosine of the included angle. Note this gives a geometric description of the dot product which does not depend explicitly on the coordinates of the vectors.

    Another application of the geometric description of the dot product is in finding the angle between two lines. Typically one would assume that the lines intersect. In some situations, however, it may make sense to ask this question when the lines do not intersect, such as the angle between two object trajectories. In any case we understand it to mean the smallest angle between (any of) their direction vectors. The only subtlety here is that if \(\vec{u}\) is a direction vector for a line, then so is any multiple \(k\vec{u}\), and thus we will find complementary angles among all angles between direction vectors for two lines, and we simply take the smaller of the two.

    Two nonzero vectors are said to be perpendicular, sometimes also called orthogonal, if the included angle is \(\pi /2\) radians (\(90^{\circ }).\)

    Consider the following proposition.

    Proposition \(\PageIndex{3}\): Perpendicular Vectors

    Let \(\vec{u}\) and \(\vec{v}\) be nonzero vectors in \(\mathbb{R}^n\). Then, \(\vec{u}\) and \(\vec{v}\) are said to be perpendicular exactly when \[\vec{u} \bullet \vec{v} = 0\nonumber \]

    Proof

    This follows directly from Proposition \(\PageIndex{2}\). First if the dot product of two nonzero vectors is equal to \(0\), this tells us that \(\cos \theta =0\) (this is where we need nonzero vectors). Thus \(\theta = \pi /2\) and the vectors are perpendicular.

    If on the other hand \(\vec{v}\) is perpendicular to \(\vec{u}\), then the included angle is \(\pi /2\) radians. Hence \(\cos \theta =0\) and \(\vec{u} \bullet \vec{v} = 0\).

    Projections

    In some applications, we wish to write a vector as a sum of two related vectors. Through the concept of projections, we can find these two vectors. First, we explore an important theorem. The result of this theorem will provide our definition of a vector projection.

    Theorem \(\PageIndex{3}\): Vector Projections

    Let \(\vec{v}\) and \(\vec{u}\) be nonzero vectors. Then there exist unique vectors \(\vec{v}_{||}\) and \(\vec{v}_{\bot }\) such that \[\vec{v}=\vec{v}_{||}+\vec{v}_{\bot } \label{projection}\] where \(\vec{v}_{||}\) is a scalar multiple of \(\vec{u}\), and \(\vec{v}_{\bot}\) is perpendicular to \(\vec{u}\).

    Proof

    Suppose \(\eqref{projection}\) holds and \(\vec{v}_{||}= k \vec{u}\). Taking the dot product of both sides of \(\eqref{projection}\) with \(\vec{u}\) and using \(\vec{v}_{\bot }\bullet \vec{u}=0,\) this yields \[\begin{array}{ll} \vec{v}\bullet \vec{u} & = ( \vec{v}_{||}+\vec{v}_{\bot }) \bullet \vec{u} \\ & = k\vec{u} \bullet \vec{u} + \vec{v}_{\bot} \bullet \vec{u} \\ & = k \| \vec{u}\| ^{2} \end{array}\nonumber \] which requires \(k =\vec{v}\bullet \vec{u} / \| \vec{u}\| ^{2}.\) Thus there can be no more than one vector \(\vec{v}_{||}\). It follows \(\vec{v}_{\bot }\) must equal \(\vec{v}-\vec{v}_{||}.\) This verifies there can be no more than one choice for both \(\vec{v}_{||}\) and \(\vec{v}_{\bot }\) and proves their uniqueness.

    Now let \[\vec{v}_{||} = \frac{\vec{v}\bullet \vec{u}}{\| \vec{u}\| ^{2}}\vec{u}\nonumber \] and let \[\vec{v}_{\bot }=\vec{v}-\vec{v}_{||}=\vec{v}-\frac{\vec{v}\bullet \vec{u}} {\| \vec{u}\| ^{2}}\vec{u}\nonumber \] Then \(\vec{v}_{||}= k\vec{u}\) where \(k =\frac{\vec{v}\bullet \vec{u}}{\| \vec{u}\| ^{2}}\). It only remains to verify \(\vec{v}_{\bot }\bullet \vec{u}=0.\) But \[\begin{aligned} \vec{v}_{\bot }\bullet \vec{u} &= \vec{v}\bullet \vec{u}-\frac{\vec{v}\bullet \vec{u}}{\| \vec{u}\| ^{2}}\vec{u}\bullet \vec{u} \\ &= \vec{v}\bullet\vec{u}-\vec{v}\bullet \vec{u}\\ &= 0 \end{aligned}\]

    The vector \(\vec{v}_{||}\) in Theorem \(\PageIndex{3}\) is called the projection of \(\vec{v}\) onto \(\vec{u}\) and is denoted by \[\vec{v}_{||} = \mathrm{proj}_{\vec{u}}\left( \vec{v}\right)\nonumber \]

    We now make a formal definition of the vector projection.

    Definition \(\PageIndex{2}\): Vector Projection

    Let \(\vec{u}\) and \(\vec{v}\) be vectors. Then, the projection of \(\vec{v}\) onto \(\vec{u}\) is given by \[\mathrm{proj}_{\vec{u}}\left( \vec{v}\right) =\left( \frac{\vec{v}\bullet \vec{u}}{\vec{u}\bullet \vec{u}}\right) \vec{u} = \frac{\vec{v}\bullet \vec{u}}{\| \vec{u}\| ^{2}}\vec{u}\nonumber \]

    Consider the following example of a projection.

    Example \(\PageIndex{1}\): Find the Projection of One Vector Onto Another

    Find \(\mathrm{proj}_{\vec{u}}\left( \vec{v}\right)\) if \[\vec{u}= \left[ \begin{array}{r} 2 \\ 3 \\ -4 \end{array} \right], \vec{v}= \left[ \begin{array}{r} 1 \\ -2 \\ 1 \end{array} \right]\nonumber \]

    Solution

    We can use the formula provided in Definition \(\PageIndex{2}\) to find \(\mathrm{proj}_{\vec{u}}\left( \vec{v}\right)\). First, compute \(\vec{v} \bullet \vec{u}\). This is given by \[\begin{aligned} \left[ \begin{array}{r} 1 \\ -2 \\ 1 \end{array} \right] \bullet \left[ \begin{array}{r} 2 \\ 3 \\ -4 \end{array} \right] &= (2)(1) + (3)(-2) + (-4)(1) \\ &= 2 - 6 - 4 \\ &= -8\end{aligned}\] Similarly, \(\vec{u} \bullet \vec{u}\) is given by \[\begin{aligned} \left[ \begin{array}{r} 2 \\ 3 \\ -4 \end{array} \right] \bullet \left[ \begin{array}{r} 2 \\ 3 \\ -4 \end{array} \right] &= (2)(2) + (3)(3) + (-4)(-4) \\ &= 4 + 9 + 16 \\ &= 29\end{aligned}\]

    Therefore, the projection is equal to \[\begin{aligned} \mathrm{proj}_{\vec{u}}\left( \vec{v}\right) &=-\frac{8}{29} \left[ \begin{array}{r} 2 \\ 3 \\ -4 \end{array} \right] \\ &= \left[ \begin{array}{r} - \frac{16}{29} \\ - \frac{24}{29} \\ \frac{32}{29} \end{array} \right]\end{aligned}\]

    We will conclude the dot product discussion with an important application of projections. Suppose a line \(L\) and a point \(P\) are given such that \(P\) is not contained in \(L\). Through the use of projections, we can determine the shortest distance from \(P\) to \(L\).

    Example \(\PageIndex{3}\): Shortest Distance from a Point to a Line

    Let \(P = (1,3,5)\) be a point in \(\mathbb{R}^3\), and let \(L\) be the line which goes through point \(P_0 = (0,4,-2)\) with direction vector \(\vec{d} = \left[ \begin{array}{r} 2 \\ 1 \\ 2 \end{array} \right]\). Find the shortest distance from \(P\) to the line \(L\), and find the point \(Q\) on \(L\) that is closest to \(P\).

    Solution

    In order to determine the shortest distance from \(P\) to \(L\), we will first find the vector \(\overrightarrow{P_0P}\) and then find the projection of this vector onto \(L\). The vector \(\overrightarrow{P_0P}\) is given by \[\left[ \begin{array}{r} 1 \\ 3 \\ 5 \end{array} \right] - \left[ \begin{array}{r} 0 \\ 4 \\ -2 \end{array} \right] = \left[ \begin{array}{r} 1 \\ -1 \\ 7 \end{array} \right]\nonumber \]

    Then, if \(Q\) is the point on \(L\) closest to \(P\), it follows that \[\begin{aligned} \overrightarrow{P_0Q} &= \mathrm{proj}_{\vec{d}}\overrightarrow{P_0P} \\ &= \left( \frac{ \overrightarrow{P_0P}\bullet \vec{d}}{\|\vec{d}\|^2}\right) \vec{d} \\ &= \frac{15}{9} \left[ \begin{array}{r} 2 \\ 1 \\ 2 \end{array} \right] \\ &= \frac{5}{3} \left[ \begin{array}{r} 2 \\ 1 \\ 2 \end{array} \right]\end{aligned}\]

    Now, the distance from \(P\) to \(L\) is given by \[\| \overrightarrow{QP} \| = \| \overrightarrow{P_0P} - \overrightarrow{P_0Q}\| = \sqrt{26}\nonumber \]

    The point \(Q\) is found by adding the vector \(\overrightarrow{P_0Q}\) to the position vector \(\overrightarrow{0P_0}\) for \(P_0\) as follows \[\begin{aligned} \left[ \begin{array}{r} 0 \\ 4 \\ -2 \end{array} \right] + \frac{5}{3} \left[ \begin{array}{r} 2 \\ 1 \\ 2 \end{array} \right] &= \left[ \begin{array}{r} \frac{10}{3} \\ \frac{17}{3} \\ \frac{4}{3} \end{array} \right]\end{aligned}\]

    Therefore, \(Q = (\frac{10}{3}, \frac{17}{3}, \frac{4}{3})\).

    Recall that the dot product is one of two important products for vectors. The second type of product for vectors is called the cross product. It is important to note that the cross product is only defined in \(\mathbb{R}^{3}.\) First we discuss the geometric meaning and then a description in terms of coordinates is given, both of which are important. The geometric description is essential in order to understand the applications to physics and geometry while the coordinate description is necessary to compute the cross product.

    The Cross Product

    Consider the following definition.

    Definition \(\PageIndex{3}\): Right Hand System of Vectors

    Three vectors, \(\vec{u},\vec{v},\vec{w}\) form a right hand system if when you extend the fingers of your right hand along the direction of vector \(\vec{u}\) and close them in the direction of \(\vec{v}\), the thumb points roughly in the direction of \(\vec{w}\).

    For an example of a right handed system of vectors, see the following picture.

    Vectors u, v, and w eminating from the same point, u points left, v points forward, and w points up
    Figure \(\PageIndex{2}\): Diagram illustrates a right-handed coordinate system. The image shows how to determine the direction of the cross product of two vectors using the right-hand rule. (CC BY-NC-SA 4.0; Kuttler via A First Course in LINEAR ALGEBRA)

    In this picture the vector \(\vec{w}\) points upwards from the plane determined by the other two vectors. Point the fingers of your right hand along \(\vec{u}\), and close them in the direction of \(\vec{v}\). Notice that if you extend the thumb on your right hand, it points in the direction of \(\vec{w}\).

    You should consider how a right hand system would differ from a left hand system. Try using your left hand and you will see that the vector \(\vec{w}\) would need to point in the opposite direction.

    Notice that the special vectors, \(\vec{i},\vec{j},\vec{k}\) will always form a right handed system. If you extend the fingers of your right hand along \(\vec{i}\) and close them in the direction \(\vec{j}\), the thumb points in the direction of \(\vec{k}\).

    Vectors i, j, and k eminating from the same point, i points forward, j points right and k points up
    Figure \(\PageIndex{3}\): Diagram illustrates a coordinate system in \(\mathbb{R}^{3}\). The image shows the standard unit vectors \(\vec{i}\), \(\vec{j}\), and \(\vec{k}\) along the \(x\), \(y\), and \(z\) axes, respectively. (CC BY-NC-SA 4.0; Kuttler via A First Course in LINEAR ALGEBRA)

    The following is the geometric description of the cross product. Recall that the dot product of two vectors results in a scalar. In contrast, the cross product results in a vector, as the product gives a direction as well as magnitude.

    Definition \(\PageIndex{4}\): Geometric Definition of Cross Product

    Let \(\vec{u}\) and \(\vec{v}\) be two vectors in \(\mathbb{R}^{3}.\) Then the cross product, written \(\vec{u}\times \vec{v}\), is defined by the following two rules.

    1. Its length is \[\| \vec{u}\times \vec{v}\| =\| \vec{u}\| \| \vec{v}\| \sin \theta, \nonumber \] where \(\theta\) is the included angle between \(\vec{u}\) and \(\vec{v}\).
    2. It is perpendicular to both \(\vec{u}\) and \(\vec{v}\), that is \[\left( \vec{u}\times \vec{v} \right) \cdot \vec{u}=0, \]\[\left( \vec{u}\times \vec{v} \right) \cdot \vec{v}=0, \nonumber\] and \[\vec{u},\vec{v},\vec{u}\times \vec{v} \nonumber\] form a right hand system.

    The cross product of the special vectors \(\vec{i}, \vec{j}, \vec{k}\) is as follows. \[\begin{array}{cc} \vec{i}\times \vec{j}=\vec{k} & \vec{j}\times \vec{i}=-\vec{k} \\ \vec{k}\times \vec{i}=\vec{j} & \vec{i}\times \vec{k}=-\vec{j} \\ \vec{j}\times \vec{k}=\vec{i} & \vec{k}\times \vec{j}=-\vec{i} \end{array}\nonumber \] With this information, the following gives the coordinate description of the cross product.

    Recall that the vector \(\vec{u}= \left[ \begin{array}{ccc} u_1 & u_2 & u_3 \end{array} \right]^T\) can be written in terms of \(\vec{i}, \vec{j}, \vec{k}\) as \(\vec{u}=u_{1}\vec{i}+u_{2}\vec{j}+u_{3}\vec{k}\).

    Theorem \(\PageIndex{4}\): Coordinate Description of Cross Product

    Let \(\vec{u}=u_{1}\vec{i}+u_{2}\vec{j}+u_{3}\vec{k}\) and \(\vec{v}=v_{1}\vec{i}+v_{2}\vec{j}+v_{3}\vec{k}\) be two vectors. Then

    \[\begin{array}{c} \vec{u}\times \vec{v} =\left( u_{2}v_{3}-u_{3}v_{2}\right) \vec{i}-\left( u_{1}v_{3} - u_{3}v_{1}\right) \vec{j}+ \left( u_{1}v_{2}-u_{2}v_{1}\right) \vec{k} \label{crossprod1} \end{array}\]

    Writing \(\vec{u} \times \vec{v}\) in the usual way, it is given by

    \[\vec{u} \times \vec{v} = \left[ \begin{array}{r} u_{2}v_{3}-u_{3}v_{2} \\ -(u_{1}v_{3}-u_{3}v_{1}) \\ u_{1}v_{2}-u_{2}v_{1} \end{array} \right]\nonumber \]

    We now prove this proposition.

    Proof

    From the above table and the properties of the cross product listed, \[\begin{aligned} \vec{u} \times \vec{v} &= \left( u_{1}\vec{i}+u_{2}\vec{j}+u_{3}\vec{k}\right) \times \left( v_{1}\vec{i}+v_{2}\vec{j}+v_{3}\vec{k}\right) \\ &= u_{1}v_{2}\vec{i}\times \vec{j}+u_{1}v_{3}\vec{i}\times \vec{k}+u_{2}v_{1}\vec{j}\times \vec{i}+ u_{2}v_{3}\vec{j}\times \vec{k}+ +u_{3}v_{1}\vec{k}\times \vec{i}+u_{3}v_{2}\vec{k}\times \vec{j} \\ &=u_{1}v_{2}\vec{k}-u_{1}v_{3}\vec{j}-u_{2}v_{1}\vec{k}+u_{2}v_{3} \vec{i}+u_{3}v_{1}\vec{j}-u_{3}v_{2}\vec{i} \\ &=\left( u_{2}v_{3}-u_{3}v_{2}\right) \vec{i}+\left( u_{3}v_{1}-u_{1}v_{3}\right) \vec{j}+\left( u_{1}v_{2}-u_{2}v_{1}\right) \vec{k} \end{aligned}\] \[\label{crossprod2}\]

    There is another version of \(\eqref{crossprod1}\) which may be easier to remember. We can express the cross product as the determinant of a matrix, as follows.

    \[\vec{u}\times \vec{v} = \left\vert \begin{array}{ccc} \vec{i} & \vec{j} & \vec{k} \\ u_{1} & u_{2} & u_{3} \\ v_{1} & v_{2} & v_{3} \end{array} \right\vert \label{crossprod3}\] Expanding the determinant along the top row yields \[\vec{i}\left( -1\right) ^{1+1}\left\vert \begin{array}{cc} u_{2} & u_{3} \\ v_{2} & v_{3} \end{array} \right\vert +\vec{j}\left( -1\right) ^{2+1}\left\vert \begin{array}{cc} u_{1} & u_{3} \\ v_{1} & v_{3} \end{array} \right\vert +\vec{k}\left( -1\right) ^{3+1}\left\vert \begin{array}{cc} u_{1} & u_{2} \\ v_{1} & v_{2} \end{array} \right\vert\nonumber \]\

    \[=\vec{i}\left\vert \begin{array}{cc} u_{2} & u_{3} \\ v_{2} & v_{3} \end{array} \right\vert -\vec{j}\left\vert \begin{array}{cc} u_{1} & u_{3} \\ v_{1} & v_{3} \end{array} \right\vert +\vec{k}\left\vert \begin{array}{cc} u_{1} & u_{2} \\ v_{1} & v_{2} \end{array} \right\vert\nonumber \]

    Expanding these determinants leads to \[\left( u_{2}v_{3}-u_{3}v_{2}\right) \vec{i}-\left( u_{1}v_{3}-u_{3}v_{1}\right) \vec{j}+\left( u_{1}v_{2}-u_{2}v_{1}\right) \vec{k} \nonumber \] which is the same as \(\eqref{crossprod2}\).

    The cross product satisfies the following properties.

    Proposition \(\PageIndex{4}\): Properties of the Cross Product

    Let \(\vec{u}, \vec{v}, \vec{w}\) be vectors in \(\mathbb{R}^3\), and \(k\) a scalar. Then, the following properties of the cross product hold.

    1. \(\vec{u}\times \vec{v}= -\left( \vec{v}\times \vec{u}\right), \mbox{and} \; \vec{u}\times \vec{u}=\vec{0}\)
    2. \(\left( k \vec{u}\right)\times \vec{v}= k \left( \vec{u}\times \vec{v}\right) =\vec{u}\times \left( k \vec{v}\right)\)
    3. \(\vec{u}\times \left( \vec{v}+\vec{w}\right) =\vec{u}\times \vec{v}+\vec{u}\times \vec{w}\)
    4. \(\left( \vec{v}+\vec{w}\right) \times \vec{u}=\vec{v} \times \vec{u}+\vec{w}\times \vec{u}\)
    Proof

    Formula \(1.\) follows immediately from the definition. The vectors \(\vec{u}\times \vec{v}\) and \(\vec{v}\times \vec{u}\) have the same magnitude, \(\left\vert \vec{u}\right\vert \left\vert \vec{v}\right\vert \sin \theta ,\) and an application of the right hand rule shows they have opposite direction.

    Formula \(2.\) is proven as follows. If \(k\) is a non-negative scalar, the direction of \(\left( k \vec{u}\right) \times \vec{v}\) is the same as the direction of \(\vec{u}\times \vec{v}, k \left( \vec{u}\times \vec{v}\right)\) and \(\vec{u}\times \left( k \vec{v}\right)\). The magnitude is \(k\) times the magnitude of \(\vec{u}\times \vec{v}\) which is the same as the magnitude of \(k \left( \vec{u}\times \vec{v}\right)\) and \(\vec{u}\times \left( k \vec{v}\right) .\) Using this yields equality in \(2\). In the case where \(k <0,\) everything works the same way except the vectors are all pointing in the opposite direction and you must multiply by \(\left\vert k \right\vert\) when comparing their magnitudes.

    The distributive laws, \(3.\) and \(4.\), are much harder to establish. For now, it suffices to notice that if we know that \(3.\) is true, \(4.\) follows. Thus, assuming \(3.\), and using \(1.\), \[\begin{aligned} \left( \vec{v}+\vec{w}\right) \times \vec{u}& =-\vec{u}\times \left( \vec{v}+\vec{w}\right) \\ & =-\left( \vec{u}\times \vec{v}+\vec{u}\times \vec{w}\right) \\ & =\vec{v}\times \vec{u}+\vec{w}\times \vec{u}\end{aligned}\]

    An important geometrical application of the cross product is as follows. The size of the cross product, \(\| \vec{u}\times \vec{v}\|\), is the area of the parallelogram determined by \(\vec{u}\) and \(\vec{v}\), as shown in the following picture.

    Area of the parallelogram is illustrated.
    Figure \(\PageIndex{4}\): Diagram illustrating the geometric interpretation of the cross product of two vectors \(\vec{u}\) and \(\vec{v}\). The image shows the parallelogram formed by the two vectors, and the magnitude of the cross product is equal to the area of the parallelogram. (CC BY-NC-SA 4.0; Kuttler via A First Course in LINEAR ALGEBRA)

    We examine this concept in the following example.

    Example \(\PageIndex{3}\): Area of a Parallelogram

    Find the area of the parallelogram determined by the vectors \(\vec{u}\) and \(\vec{v}\) given by

    \[\vec{u} = \left[ \begin{array}{r} 1 \\ -1 \\ 2 \end{array} \right], \vec{v} = \left[ \begin{array}{r} 3 \\ -2 \\ 1 \end{array} \right]\nonumber \]

    Solution

    Notice that these vectors are the same as the ones given in Example \(\PageIndex{1}\). Recall from the geometric description of the cross product, that the area of the parallelogram is simply the magnitude of \(\vec{u} \times \vec{v}\). From Example \(\PageIndex{1}\), \(\vec{u} \times \vec{v} = 3\vec{i}+5\vec{j}+\vec{k}\). We can also write this as

    \[\vec{u} \times \vec{v} = \left[ \begin{array}{r} 3 \\ 5 \\ 1 \end{array} \right]\nonumber \]

    Thus the area of the parallelogram is

    \[\| \vec{u} \times \vec{v} \| = \sqrt{(3)(3) + (5)(5) + (1)(1)} = \sqrt{9+25+1}=\sqrt{35}\nonumber \]

    We can also use this concept to find the area of a triangle. Consider the following example.

    Example \(\PageIndex{4}\): Area of Triangle

    Find the area of the triangle determined by the points \(\left(1, 2, 3 \right) , \left( 0,2,5\right), \left( 5,1, 2 \right)\)

    Solution

    This triangle is obtained by connecting the three points with lines. Picking \(\left( 1,2,3\right)\) as a starting point, there are two displacement vectors, \(\left[ \begin{array}{rrr} -1 & 0 & 2 \end{array} \right]^T\) and \(\left[ \begin{array}{rrr} 4 & -1 & -1 \end{array} \right]^T\). Notice that if we add either of these vectors to the position vector of the starting point, the result is the position vectors of the other two points. Now, the area of the triangle is half the area of the parallelogram determined by \(\left[ \begin{array}{rrr} -1 & 0 & 2 \end{array} \right]^T\) and \(\left[ \begin{array}{rrr} 4 & -1 & -1 \end{array} \right]^T.\) The required cross product is given by

    \[\left[ \begin{array}{r} -1 \\ 0 \\ 2 \end{array} \right] \times \left[ \begin{array}{r} 4 \\ -1 \\ -1 \end{array} \right] = \left[ \begin{array}{rrr} 2 & 7 & 1 \end{array} \right]\nonumber \]

    Taking the size of this vector gives the area of the parallelogram, given by

    \[\sqrt{(2)(2) + (7)(7) + (1)(1)} = \sqrt{4+49+1} = \sqrt{54}\nonumber \] Hence the area of the triangle is \(\frac{1}{2}\sqrt{54}= \frac{3}{2}\sqrt{6}.\)

    In general, if you have three points in \(\mathbb{R}^{3}, P,Q,R\), the area of the triangle is given by \[\frac{1}{2}\| \vec{PQ} \times \vec{PR} \|\nonumber \]

    Recall that \(\vec{PQ}\) is the vector running from point \(P\) to point \(Q\).

    Triangle with vertices P,Q and R.  Adjacent sides are vectos PR and PQ
    Figure \(\PageIndex{5}\): Diagram illustrates a triangle formed by three points P, Q, and R in \(\mathbb{R}^{3}.\) (CC BY-NC-SA 4.0; Kuttler via A First Course in LINEAR ALGEBRA)

    In the next section, we explore another application of the cross product.

    The Box Product

    Recall that we can use the cross product to find the the area of a parallelogram. It follows that we can use the cross product together with the dot product to find the volume of a parallelepiped. We begin with a definition.

    Definition \(\PageIndex{5}\): Parallelepiped

    A parallelepiped determined by the three vectors, \(\vec{u},\vec{v}\), and \(\vec{w}\) consists of \[\left\{ r\vec{u}+s\vec{v}+t\vec{w}:r,s,t\in \left[ 0,1\right] \right\}\nonumber \]

    That is, if you pick three numbers, \(r,s,\) and \(t\) each in \(\left[ 0,1\right]\) and form \(r\vec{u}+s\vec{v}+t\vec{w}\) then the collection of all such points makes up the parallelepiped determined by these three vectors.

    The following is an example of a parallelepiped.

    Diagram illustrating a parallelepiped determined by three vectors
    Figure \(\PageIndex{6}\): Diagram illustrates a parallelepiped determined by three vectors \(\vec{u}\), \(\vec{v}\), and \(\vec{w}\). The image shows the three-dimensional shape formed by the vectors. (CC BY-NC-SA 4.0; Kuttler via A First Course in LINEAR ALGEBRA)

    Notice that the base of the parallelepiped is the parallelogram determined by the vectors \(\vec{u}\) and \(\vec{v}\). Therefore, its area is equal to \(\| \vec{u}\times \vec{v} \|\). The height of the parallelepiped is \(\| \vec{w}\| \cos \theta\) where \(\theta\) is the angle shown in the picture between \(\vec{w}\) and \(\vec{u}\times \vec{v}\). The volume of this parallelepiped is the area of the base times the height which is just \[\| \vec{u}\times \vec{v}\| \| \vec{w}\| \cos \theta = \left( \vec{u}\times\vec{v}\right) \cdot \vec{w}\nonumber \] This expression is known as the box product and is sometimes written as \(\left[ \vec{u},\vec{v},\vec{w}\right] .\) You should consider what happens if you interchange the \(\vec{v}\) with the \(\vec{w}\) or the \(\vec{u}\) with the \(\vec{w}\). You can see geometrically from drawing pictures that this merely introduces a minus sign. In any case the box product of three vectors always equals either the volume of the parallelepiped determined by the three vectors or else \(-1\) times this volume.

    Note: Connection to Determinants

    Recall from Section 3.4 that the determinant is useful in computing the area of a parallelogram formed by two vectors and the volume of the parallelepiped formed by three vectors.

    • In \(\mathbb{R}^2\): Suppose \( \vec v_1 = \langle a, b \rangle \) and \( \vec v_2 = \langle c, d \rangle \). Then, the area of the parallelogram formed by \(\vec v_1\) and \(\vec v_2\) is simply the magnitude of the cross product of the \(\mathbb{R}^3\) vectors \(\langle a, b, 0 \rangle \) and \(\langle c, d, 0 \rangle \). This is simply \(|ad-bc|\), which is the absolute value of the determinant of the \(2 \times 2\) matrix formed by the row vectors \(\vec v_1\) and \(\vec v_2\).
    • In \(\mathbb{R}^3\): Suppose \( \vec v_1 \), \( \vec v_2 \) and \( \vec v_3 \) are vectors in \(\mathbb{R}^3\). Then, the volume of the parallelepiped formed by \(\vec v_1\), \(\vec v_2\) and \(\vec v_3\) is simply the absolute value of the box product of the three vectors. We leave it to the reader to check that indeed this is also the absolute value of the determinant of the \(3 \times 3\) matrix formed by the row vectors \(\vec v_1\), \(\vec v_2\) and \(\vec v_3\).

    This page titled 4.3: Dot and Cross Product is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Doli Bambhania, Fatemeh Yarahmadi, and Bill Wilson.