Unit 1, lesson 2

The Dot Product

How one number built from two vectors measures lengths, angles, perpendicularity, projections and the work done by a constant force, and why it can never exceed the product of the lengths.

  • Theory part 3
  • Practice part 4
  • Coordinates, Vectors, and Products

Push a stuck cart at an angle and only part of your effort moves it forward. The rest presses it into the ground or pushes it sideways. The dot product measures exactly how much of one vector points along another, and that single number turns out to answer questions about angles, shadows, right angles and work.

Key terms

Dot product

Definition The dot product of a=⟨a1,a2,a3⟩\mathbf{a} = \langle a_1, a_2, a_3 \rangle and b=⟨b1,b2,b3⟩\mathbf{b} = \langle b_1, b_2, b_3 \rangle is the real number

a⋅b=a1b1+a2b2+a3b3.\mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3.

For all vectors a\mathbf{a}, b\mathbf{b}, c\mathbf{c} and every real number tt it satisfies

a⋅b=b⋅a,0⋅a=0,a⋅(b+c)=a⋅b+a⋅c,(t a)⋅b=t (a⋅b).\begin{gathered} \mathbf{a} \cdot \mathbf{b} = \mathbf{b} \cdot \mathbf{a}, \qquad \mathbf{0} \cdot \mathbf{a} = 0, \\[0.4em] \mathbf{a} \cdot (\mathbf{b} + \mathbf{c}) = \mathbf{a} \cdot \mathbf{b} + \mathbf{a} \cdot \mathbf{c}, \\[0.4em] (t\,\mathbf{a}) \cdot \mathbf{b} = t\,(\mathbf{a} \cdot \mathbf{b}). \end{gathered}

The same formula with two components defines the dot product in the plane.

In plain words Multiply matching components and add. The answer is a number, not a vector.

Example For a=⟨2,−1,3⟩\mathbf{a} = \langle 2, -1, 3 \rangle and b=⟨4,1,−2⟩\mathbf{b} = \langle 4, 1, -2 \rangle,

a⋅b=8−1−6=1.\mathbf{a} \cdot \mathbf{b} = 8 - 1 - 6 = 1.

Length from the dot product

Definition For every vector a\mathbf{a},

a⋅a=a12+a22+a32=∣a∣2,\mathbf{a} \cdot \mathbf{a} = a_1^2 + a_2^2 + a_3^2 = \lvert \mathbf{a} \rvert^2,

so ∣a∣=a⋅a\lvert \mathbf{a} \rvert = \sqrt{\mathbf{a} \cdot \mathbf{a}}. In particular a⋅a≥0\mathbf{a} \cdot \mathbf{a} \ge 0, with equality only when a=0\mathbf{a} = \mathbf{0}.

In plain words Dotting a vector with itself gives its length squared. This is how lengths get into dot product calculations.

Example For a=⟨2,−1,3⟩\mathbf{a} = \langle 2, -1, 3 \rangle, a⋅a=4+1+9=14\mathbf{a} \cdot \mathbf{a} = 4 + 1 + 9 = 14, so ∣a∣=14\lvert \mathbf{a} \rvert = \sqrt{14}. Expanding with the rules above also gives a useful identity,

∣a−b∣2=∣a∣2−2 a⋅b+∣b∣2.\lvert \mathbf{a} - \mathbf{b} \rvert^2 = \lvert \mathbf{a} \rvert^2 - 2\,\mathbf{a} \cdot \mathbf{b} + \lvert \mathbf{b} \rvert^2.

Angle between vectors

Definition Let a\mathbf{a} and b\mathbf{b} be nonzero vectors, and let θ\theta be the angle between them when they are drawn from a common initial point, chosen with 0≤θ≤π0 \le \theta \le \pi. Then

a⋅b=∣a∣ ∣b∣cos⁡θ,\mathbf{a} \cdot \mathbf{b} = \lvert \mathbf{a} \rvert \, \lvert \mathbf{b} \rvert \cos \theta,

which follows from comparing the identity above with the law of cosines in the triangle with sides a\mathbf{a}, b\mathbf{b} and a−b\mathbf{a} - \mathbf{b}. Solving for the angle,

θ=arccos⁡a⋅b∣a∣ ∣b∣.\theta = \arccos \frac{\mathbf{a} \cdot \mathbf{b}}{\lvert \mathbf{a} \rvert \, \lvert \mathbf{b} \rvert}.

The range [0,π][0, \pi] of arccos is exactly the range of possible angles. For the zero vector no angle is defined.

In plain words The dot product is large and positive when the vectors point roughly the same way, zero at a right angle, and negative when they point roughly opposite ways.

Example The face diagonals a=⟨1,1,0⟩\mathbf{a} = \langle 1, 1, 0 \rangle and b=⟨1,0,1⟩\mathbf{b} = \langle 1, 0, 1 \rangle of the unit cube give a⋅b=1\mathbf{a} \cdot \mathbf{b} = 1 and ∣a∣=∣b∣=2\lvert \mathbf{a} \rvert = \lvert \mathbf{b} \rvert = \sqrt{2}, so

cos⁡θ=12⋅2=12,θ=π3.\cos \theta = \frac{1}{\sqrt{2} \cdot \sqrt{2}} = \frac{1}{2}, \qquad \theta = \frac{\pi}{3}.

That makes sense, since together with ⟨0,1,−1⟩\langle 0, 1, -1 \rangle these diagonals form an equilateral triangle.

Orthogonality

Definition Two vectors a\mathbf{a} and b\mathbf{b} are orthogonal when a⋅b=0\mathbf{a} \cdot \mathbf{b} = 0. For nonzero vectors this happens exactly when cos⁡θ=0\cos \theta = 0, that is when θ=π2\theta = \frac{\pi}{2} and the vectors are perpendicular. By this definition the zero vector is orthogonal to every vector.

In plain words A zero dot product is the test for a right angle. No angle needs to be computed.

Example The vectors ⟨3,−2,1⟩\langle 3, -2, 1 \rangle and ⟨1,2,1⟩\langle 1, 2, 1 \rangle are orthogonal, since 3−4+1=03 - 4 + 1 = 0. To make ⟨1,c,2⟩\langle 1, c, 2 \rangle orthogonal to ⟨3,1,−4⟩\langle 3, 1, -4 \rangle, solve 3+c−8=03 + c - 8 = 0, which gives c=5c = 5.

Direction cosines

Definition For a nonzero vector a=⟨a1,a2,a3⟩\mathbf{a} = \langle a_1, a_2, a_3 \rangle, the direction angles α\alpha, β\beta, γ\gamma in [0,π][0, \pi] are the angles that a\mathbf{a} makes with i\mathbf{i}, j\mathbf{j} and k\mathbf{k}. Their cosines, the direction cosines, are

cos⁡α=a1∣a∣,cos⁡β=a2∣a∣,cos⁡γ=a3∣a∣.\begin{gathered} \cos \alpha = \frac{a_1}{\lvert \mathbf{a} \rvert}, \quad \cos \beta = \frac{a_2}{\lvert \mathbf{a} \rvert}, \\[0.4em] \cos \gamma = \frac{a_3}{\lvert \mathbf{a} \rvert}. \end{gathered}

They are the components of the unit vector a/∣a∣\mathbf{a} / \lvert \mathbf{a} \rvert, so

cos⁡2α+cos⁡2β+cos⁡2γ=1.\cos^2 \alpha + \cos^2 \beta + \cos^2 \gamma = 1.

In plain words The direction cosines say how much a direction leans toward each axis. Together they are just the unit vector in that direction.

Example For a=⟨2,3,6⟩\mathbf{a} = \langle 2, 3, 6 \rangle the length is 77, so the direction cosines are 27\frac{2}{7}, 37\frac{3}{7} and 67\frac{6}{7}. Their squares add to 4+9+3649=1\frac{4 + 9 + 36}{49} = 1. The angle with the zz axis is γ=arccos⁡67≈31.0∘\gamma = \arccos \frac{6}{7} \approx 31.0^\circ, so this vector points steeply upward.

Scalar and vector projection

Definition Let a≠0\mathbf{a} \ne \mathbf{0}. The scalar projection of b\mathbf{b} onto a\mathbf{a} and the vector projection of b\mathbf{b} onto a\mathbf{a} are

comp⁡ab=a⋅b∣a∣,proj⁡ab=a⋅b∣a∣2 a.\begin{aligned} \operatorname{comp}_{\mathbf{a}} \mathbf{b} &= \frac{\mathbf{a} \cdot \mathbf{b}}{\lvert \mathbf{a} \rvert}, \\[0.4em] \operatorname{proj}_{\mathbf{a}} \mathbf{b} &= \frac{\mathbf{a} \cdot \mathbf{b}}{\lvert \mathbf{a} \rvert^2} \, \mathbf{a}. \end{aligned}

The scalar projection equals ∣b∣cos⁡θ\lvert \mathbf{b} \rvert \cos \theta when b≠0\mathbf{b} \ne \mathbf{0} and is negative when the angle is obtuse. The remainder b−proj⁡ab\mathbf{b} - \operatorname{proj}_{\mathbf{a}} \mathbf{b} is orthogonal to a\mathbf{a}, so b\mathbf{b} splits into a part parallel to a\mathbf{a} and a part perpendicular to it.

In plain words Shine a light straight down onto the line of a\mathbf{a}. The shadow of b\mathbf{b} is the vector projection, and its signed length is the scalar projection.

Example Project b=⟨1,1,2⟩\mathbf{b} = \langle 1, 1, 2 \rangle onto a=⟨1,0,1⟩\mathbf{a} = \langle 1, 0, 1 \rangle. Here a⋅b=3\mathbf{a} \cdot \mathbf{b} = 3 and ∣a∣2=2\lvert \mathbf{a} \rvert^2 = 2, so

comp⁡ab=32,proj⁡ab=⟨32,0,32⟩.\begin{aligned} \operatorname{comp}_{\mathbf{a}} \mathbf{b} &= \frac{3}{\sqrt{2}}, \\[0.4em] \operatorname{proj}_{\mathbf{a}} \mathbf{b} &= \Big\langle \frac{3}{2}, 0, \frac{3}{2} \Big\rangle. \end{aligned}

The remainder ⟨−12,1,12⟩\langle -\tfrac{1}{2}, 1, \tfrac{1}{2} \rangle has dot product 00 with a\mathbf{a}, as it should. Its length 3/2=62\sqrt{3/2} = \frac{\sqrt{6}}{2} is the distance from the point (1,1,2)(1, 1, 2) to the line through the origin in the direction of a\mathbf{a}.

Work

Definition If a constant force F\mathbf{F} acts on an object that moves in a straight line from PP to QQ, the work done by the force is

W=F⋅PQ→=∣F∣ ∣PQ→∣cos⁡θ,W = \mathbf{F} \cdot \overrightarrow{PQ} = \lvert \mathbf{F} \rvert \, \lvert \overrightarrow{PQ} \rvert \cos \theta,

where θ\theta is the angle between the force and the displacement. With force in newtons and distance in meters, work is in joules (J). Forces that vary, or paths that curve, need line integrals, which come later in the course.

In plain words Only the part of the force along the motion does work. A force at a right angle to the motion does none, and a force against the motion does negative work.

Example A constant force F=⟨3,4,5⟩\mathbf{F} = \langle 3, 4, 5 \rangle newtons moves an object from P(1,0,2)P(1, 0, 2) to Q(4,2,2)Q(4, 2, 2), in meters. The displacement is ⟨3,2,0⟩\langle 3, 2, 0 \rangle, so

W=9+8+0=17 joules.W = 9 + 8 + 0 = 17 \text{ joules.}

The zz component of the force does nothing here, since the object never changes height.

Cauchy-Schwarz inequality

Definition For all vectors a\mathbf{a} and b\mathbf{b},

∣a⋅b∣≤∣a∣ ∣b∣,\lvert \mathbf{a} \cdot \mathbf{b} \rvert \le \lvert \mathbf{a} \rvert \, \lvert \mathbf{b} \rvert,

with equality exactly when one of the vectors is a scalar multiple of the other. For nonzero vectors it follows from the angle formula and ∣cos⁡θ∣≤1\lvert \cos \theta \rvert \le 1, and it is trivial when either vector is 0\mathbf{0}. The inequality is what guarantees that the quotient inside arccos lies in [−1,1][-1, 1], and it implies the triangle inequality ∣a+b∣≤∣a∣+∣b∣\lvert \mathbf{a} + \mathbf{b} \rvert \le \lvert \mathbf{a} \rvert + \lvert \mathbf{b} \rvert.

In plain words The dot product can never be bigger in size than the two lengths multiplied together. It reaches that size only when the vectors lie along one line.

Example For a=⟨1,2,2⟩\mathbf{a} = \langle 1, 2, 2 \rangle and b=⟨2,−1,4⟩\mathbf{b} = \langle 2, -1, 4 \rangle, the dot product is 2−2+8=82 - 2 + 8 = 8, while

∣a∣ ∣b∣=321≈13.75.\lvert \mathbf{a} \rvert \, \lvert \mathbf{b} \rvert = 3\sqrt{21} \approx 13.75.

With b=2a=⟨2,4,4⟩\mathbf{b} = 2\mathbf{a} = \langle 2, 4, 4 \rangle instead, both sides equal 1818.

Check yourself

  1. Find the angle between ⟨3,0,4⟩\langle 3, 0, 4 \rangle and ⟨0,5,12⟩\langle 0, 5, 12 \rangle, to the nearest tenth of a degree.
Show the answer

The dot product is 4848 and the lengths are 55 and 1313, so

θ=arccos⁡4865≈42.4∘.\theta = \arccos \frac{48}{65} \approx 42.4^\circ.
  1. Find the vector projection of ⟨4,1,3⟩\langle 4, 1, 3 \rangle onto ⟨2,2,1⟩\langle 2, 2, 1 \rangle.
Show the answer

The dot product is 8+2+3=138 + 2 + 3 = 13 and ∣⟨2,2,1⟩∣2=9\lvert \langle 2, 2, 1 \rangle \rvert^2 = 9, so the projection is

139⟨2,2,1⟩=⟨269,269,139⟩.\frac{13}{9} \langle 2, 2, 1 \rangle = \Big\langle \frac{26}{9}, \frac{26}{9}, \frac{13}{9} \Big\rangle.
  1. A force of 1010 newtons points in the direction of ⟨1,1,1⟩\langle 1, 1, 1 \rangle and moves an object in a straight line from the origin to (2,3,1)(2, 3, 1), in meters. How much work does it do?
Show the answer

The force is 103⟨1,1,1⟩\frac{10}{\sqrt{3}} \langle 1, 1, 1 \rangle, and the displacement is ⟨2,3,1⟩\langle 2, 3, 1 \rangle, so

W=103⋅6=203≈34.6 J.W = \frac{10}{\sqrt{3}} \cdot 6 = 20\sqrt{3} \approx 34.6 \text{ J.}

How this lesson connects

It also uses Vector components, magnitude, unit vectors, elementary trigonometry and algebra.