Skip to main content

Section 1.2 Dot Product

Definition 1.2.1. Dot Product.

The dot product (or scalar product) of two vectors \(\vu=\gv{u_1, \ldots, u_n}\) and \(\vv = \gv{v_1, \ldots, v_n}\) in \(\R^n\) is the scalar
\begin{equation*} \vu \cdot \vv := \sum_i u_iv_i. \end{equation*}
The dot product has three basic properties. For scalar \(\lambda\) and vectors \(\vu, \vv, \vw\text{,}\)
  • Symmetric. \(\vu \cdot \vv = \vv \cdot \vu\text{.}\)
  • Bilinear. \((\vu+\vv)\cdot\vw = \vu\cdot\vw + \vv\cdot\vw\) and \((\lambda\vu)\cdot\vv = \lambda(\vu\cdot\vv)\text{.}\)
  • Positive definite. \(\vv\cdot\vv \ge 0\text{,}\) with equality only when \(\vv=\vz\text{.}\)
The dot product of a vector with itself is \(\vv \cdot \vv = \sum_{i=1}^n v_i^2\text{,}\) the square of the distance from the origin to the point \(\vv\text{.}\) Thus \(\norm{\vv} := \sqrt{\vv \cdot \vv}\) is the length (or magnitude) of the vector \(\vv\text{.}\) A unit vector is a vector of length \(1\text{.}\) For a nonzero vector \(\vv\text{,}\) the unit vector \(\hat{\vv}:=\vv/\norm{\vv}\) is the direction of \(\vv\text{.}\) Two vectors are in opposite direction if their directions are negatives of one another.
If \(\theta\) is the angle between nonzero vectors \(\vu\) and \(\vv\text{,}\) then the dot product measures how much of one vector points in the direction of the other:
\begin{equation*} \vu \cdot \vv = \norm{\vu}\norm{\vv}\cos\theta. \end{equation*}
Two vectors with the projection of one onto the other and the angle between them.
Figure 1.2.2. Angle and projection in the dot product formula.
Cauchy-Schwarz inequality guarantees that the dot product of two unit vectors lies in the interval \([-1,1]\text{,}\) so the angle above is always well defined.

Proof.

The conclusion is clear if one of the vectors is a scalar multiple of the other. So suppose \(\vu\) is not a multiple of \(\vv\text{.}\) Then \(\vu - t\vv\) is nonzero for every scalar \(t\text{,}\) and hence
\begin{equation*} \norm{\vu - t\vv}^2 = \norm{\vu}^2 - 2t\vu\cdot\vv + t^2\norm{\vv}^2 \gt 0. \end{equation*}
The discriminant of this quadratic must be negative:
\begin{equation*} (-2\vu\cdot\vv)^2 \lt 4\norm{\vu}^2\norm{\vv}^2. \end{equation*}
Therefore \(|\vu \cdot \vv| \lt \norm{\vu}\norm{\vv}\text{.}\)
Consequently, for nonzero vectors \(\vu\) and \(\vv\) there is a unique angle \(0 \le \theta \le \pi\) such that
\begin{equation*} \cos(\theta) = \hat{\vu} \cdot \hat{\vv}. \end{equation*}
This angle is the angle between \(\vu\) and \(\vv\text{.}\) Two vectors are orthogonal if their dot product is zero.
As an application, dot products give a convenient equation for a plane in \(\R^3\text{.}\) Suppose a plane passes through a point with position vector \(\vr_0 = \gv{x_0,y_0,z_0}\) and has normal vector \(\vn = \gv{a,b,c}\text{.}\) A point with position vector \(\vr = \gv{x,y,z}\) lies on the plane exactly when the displacement vector \(\vr-\vr_0\) is orthogonal to \(\vn\text{.}\) Therefore the plane equation is
\begin{equation*} \vn \cdot (\vr-\vr_0)=0, \end{equation*}
or in coordinates,
\begin{equation*} a(x-x_0)+b(y-y_0)+c(z-z_0)=0. \end{equation*}

Example 1.2.4.

Find an equation of the plane through the point \((1,0,-2)\) with normal vector \(\gv{2,-1,3}\text{.}\)
Solution.
Here \(\vn=\gv{2,-1,3}\) and \(\vr_0=\gv{1,0,-2}\text{.}\) Using \(\vn\cdot(\vr-\vr_0)=0\text{,}\) we get
\begin{equation*} 2(x-1) - (y-0) + 3(z+2) = 0. \end{equation*}
Simplifying,
\begin{equation*} 2x-y+3z+4=0. \end{equation*}
The dot product also explains matrix multiplication. A matrix is a rectangular array of numbers. An \(m \times n\) matrix \(A\) has \(m\) rows and \(n\) columns, with entries
\begin{equation*} A = \begin{bmatrix} a_{11} \amp a_{12} \amp \cdots \amp a_{1n} \\ a_{21} \amp a_{22} \amp \cdots \amp a_{2n} \\ \vdots \amp \vdots \amp \ddots \amp \vdots \\ a_{m1} \amp a_{m2} \amp \cdots \amp a_{mn} \end{bmatrix}. \end{equation*}
If \(A\) is an \(m \times n\) matrix and \(B\) is an \(n \times p\) matrix, then \(AB\) is an \(m \times p\) matrix whose \((i,j)\)-entry is the dot product of the \(i\)-th row of \(A\) with the \(j\)-th column of \(B\text{:}\)
\begin{equation*} (AB)_{ij} = \sum_{k=1}^n A_{ik}B_{kj}. \end{equation*}

Example 1.2.5.

Let
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 0 \\ -1 \amp 0 \amp 3 \end{bmatrix}, \qquad B = \begin{bmatrix} 2 \amp 1 \\ 0 \amp -1 \\ 1 \amp 0 \end{bmatrix}. \end{equation*}
Compute \(AB\text{.}\)
Solution.
Each entry is a row-column dot product:
\begin{equation*} AB = \begin{bmatrix} (1)(2) + (2)(0) + (0)(1) \amp (1)(1) + (2)(-1) + (0)(0) \\ (-1)(2) + (0)(0) + (3)(1) \amp (-1)(1) + (0)(-1) + (3)(0) \end{bmatrix} = \begin{bmatrix} 2 \amp -1 \\ 1 \amp -1 \end{bmatrix}. \end{equation*}
A linear map is a function between vector spaces that respects vector addition and scalar multiplication:
\begin{equation*} T\left(\sum_i \lambda_i \vv_i\right) = \sum_i \lambda_i T(\vv_i). \end{equation*}
Once bases are chosen, a linear map is represented by a matrix, and matrix multiplication corresponds to composition of linear maps.