The Scalar (Dot) Product

Vectors can be multiplied in two ways. The first, the scalar (or dot) product, outputs a number:

a⃗⋅b⃗=∣a⃗∣ ∣b⃗∣cos⁡θ\vec{a} \cdot \vec{b} = |\vec{a}|\,|\vec{b}|\cos\theta

where θ\theta (0≤θ≤π0 \leq \theta \leq \pi) is the angle between a⃗\vec{a} and b⃗\vec{b}. If either vector is 0⃗\vec{0}, define a⃗⋅b⃗=0\vec{a} \cdot \vec{b} = 0.

Dot product definition with angle and projection of a vector on a line

What the sign tells you

  1. a⃗⋅b⃗>0\vec{a} \cdot \vec{b} > 0 — acute angle; a⃗⋅b⃗<0\vec{a} \cdot \vec{b} < 0 — obtuse angle.
  2. Perpendicularity test: for nonzero vectors, a⃗⋅b⃗=0  ⟺  a⃗⊥b⃗\vec{a} \cdot \vec{b} = 0 \iff \vec{a} \perp \vec{b}.
  3. θ=0\theta = 0 gives a⃗⋅b⃗=∣a⃗∣∣b⃗∣\vec{a} \cdot \vec{b} = |\vec{a}||\vec{b}|; in particular a⃗⋅a⃗=∣a⃗∣2\vec{a} \cdot \vec{a} = |\vec{a}|^2 — dotting a vector with itself squares its length.
  4. θ=π\theta = \pi gives a⃗⋅b⃗=−∣a⃗∣∣b⃗∣\vec{a} \cdot \vec{b} = -|\vec{a}||\vec{b}|.
  5. For the axis unit vectors: i^⋅i^=j^⋅j^=k^⋅k^=1\hat{i} \cdot \hat{i} = \hat{j} \cdot \hat{j} = \hat{k} \cdot \hat{k} = 1 and i^⋅j^=j^⋅k^=k^⋅i^=0\hat{i} \cdot \hat{j} = \hat{j} \cdot \hat{k} = \hat{k} \cdot \hat{i} = 0.

Properties and the component formula

The dot product is commutative (a⃗⋅b⃗=b⃗⋅a⃗\vec{a} \cdot \vec{b} = \vec{b} \cdot \vec{a}), distributive over addition (a⃗⋅(b⃗+c⃗)=a⃗⋅b⃗+a⃗⋅c⃗\vec{a} \cdot (\vec{b} + \vec{c}) = \vec{a} \cdot \vec{b} + \vec{a} \cdot \vec{c}), and scalars slide through ((λa⃗)⋅b⃗=λ(a⃗⋅b⃗)(\lambda\vec{a}) \cdot \vec{b} = \lambda(\vec{a} \cdot \vec{b})). Expanding two component-form vectors using these rules and the axis table collapses nine terms to three:

a⃗⋅b⃗=a1b1+a2b2+a3b3\vec{a} \cdot \vec{b} = a_1b_1 + a_2b_2 + a_3b_3

Angle between vectors

cos⁡θ=a⃗⋅b⃗∣a⃗∣ ∣b⃗∣=a1b1+a2b2+a3b3a12+a22+a32 b12+b22+b32\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{a}|\,|\vec{b}|} = \frac{a_1b_1 + a_2b_2 + a_3b_3}{\sqrt{a_1^2 + a_2^2 + a_3^2}\,\sqrt{b_1^2 + b_2^2 + b_3^2}}

Key Point: the two most-used identities in the whole chapter come from expanding dots of sums:

∣a⃗+b⃗∣2=∣a⃗∣2+2 a⃗⋅b⃗+∣b⃗∣2∣a⃗−b⃗∣2=∣a⃗∣2−2 a⃗⋅b⃗+∣b⃗∣2\left|\vec{a} + \vec{b}\right|^2 = |\vec{a}|^2 + 2\,\vec{a}\cdot\vec{b} + |\vec{b}|^2 \qquad \left|\vec{a} - \vec{b}\right|^2 = |\vec{a}|^2 - 2\,\vec{a}\cdot\vec{b} + |\vec{b}|^2

They convert between lengths and dot products in both directions — most "find ∣a⃗−b⃗∣|\vec{a} - \vec{b}|" and "find a⃗⋅b⃗\vec{a}\cdot\vec{b}" problems are one application of these.

Projection of a Vector

Let a⃗\vec{a} make angle θ\theta with a directed line ll. The projection vector p⃗\vec{p} is the shadow of a⃗\vec{a} on ll: magnitude ∣∣a⃗∣cos⁡θ∣\left||\vec{a}|\cos\theta\right|, direction along ll (or opposite, if cos⁡θ<0\cos\theta < 0). The signed number ∣a⃗∣cos⁡θ|\vec{a}|\cos\theta is called the projection of a⃗\vec{a} on ll.

Formulas

  1. If p^\hat{p} is the unit vector along ll: projection =a⃗⋅p^= \vec{a} \cdot \hat{p}.
  2. Projection of a⃗\vec{a} on another vector b⃗\vec{b}:

projb⃗ a⃗=a⃗⋅b^=a⃗⋅b⃗∣b⃗∣\text{proj}_{\vec{b}}\,\vec{a} = \vec{a} \cdot \hat{b} = \frac{\vec{a} \cdot \vec{b}}{|\vec{b}|}

  1. θ=0\theta = 0: the projection vector is a⃗\vec{a} itself; θ=π\theta = \pi: it is −a⃗-\vec{a}; θ=π2\theta = \dfrac{\pi}{2} or 3π2\dfrac{3\pi}{2}: it is 0⃗\vec{0}.

Key Point (whose magnitude divides?): projection of a⃗\vec{a} on b⃗\vec{b} divides by ∣b⃗∣|\vec{b}| — the magnitude of the vector being projected onto. Swapping the two gives the projection of b⃗\vec{b} on a⃗\vec{a}, a different number unless the magnitudes agree.

Components are projections

For a⃗=a1i^+a2j^+a3k^\vec{a} = a_1\hat{i} + a_2\hat{j} + a_3\hat{k}: a1=a⃗⋅i^a_1 = \vec{a} \cdot \hat{i}, a2=a⃗⋅j^a_2 = \vec{a} \cdot \hat{j}, a3=a⃗⋅k^a_3 = \vec{a} \cdot \hat{k} — the scalar components are the projections on the axes. The direction cosines are cos⁡α=a1∣a⃗∣\cos\alpha = \dfrac{a_1}{|\vec{a}|} etc., and a unit vector can be written entirely from its direction cosines:

a^=cos⁡α i^+cos⁡β j^+cos⁡γ k^\hat{a} = \cos\alpha\,\hat{i} + \cos\beta\,\hat{j} + \cos\gamma\,\hat{k}

Two famous inequalities

  1. Cauchy-Schwarz: ∣a⃗⋅b⃗∣≤∣a⃗∣ ∣b⃗∣\left|\vec{a} \cdot \vec{b}\right| \leq |\vec{a}|\,|\vec{b}| — because ∣cos⁡θ∣≤1|\cos\theta| \leq 1.
  2. Triangle inequality: ∣a⃗+b⃗∣≤∣a⃗∣+∣b⃗∣\left|\vec{a} + \vec{b}\right| \leq |\vec{a}| + |\vec{b}| — proved by expanding ∣a⃗+b⃗∣2\left|\vec{a}+\vec{b}\right|^2 and applying Cauchy-Schwarz to the cross term.

Equality in the triangle inequality means the vectors point the same way — used to prove collinearity of points: if ∣AC→∣=∣AB→∣+∣BC→∣\left|\overrightarrow{AC}\right| = \left|\overrightarrow{AB}\right| + \left|\overrightarrow{BC}\right|, then A,B,CA, B, C lie on one line.

Solved Examples

Example 1: Angle from the definition

Find the angle between two vectors with magnitudes 11 and 22, given that their dot product is 11.

Solution:

  1. Rearrange the definition: cos⁡θ=a⃗⋅b⃗∣a⃗∣∣b⃗∣=11×2=12\cos\theta = \dfrac{\vec{a}\cdot\vec{b}}{|\vec{a}||\vec{b}|} = \dfrac{1}{1 \times 2} = \dfrac{1}{2}.
  2. Read the angle: θ=π3\theta = \dfrac{\pi}{3}.

Answer: π3\dfrac{\pi}{3} (60∘60^\circ).


Example 2: Angle from components

Find the angle between a⃗=i^+j^−k^\vec{a} = \hat{i} + \hat{j} - \hat{k} and b⃗=i^−j^+k^\vec{b} = \hat{i} - \hat{j} + \hat{k}.

Solution:

  1. Dot product: a⃗⋅b⃗=1−1−1=−1\vec{a}\cdot\vec{b} = 1 - 1 - 1 = -1.
  2. Magnitudes: ∣a⃗∣=∣b⃗∣=3|\vec{a}| = |\vec{b}| = \sqrt{3}.
  3. Angle: cos⁡θ=−13\cos\theta = \dfrac{-1}{3}, so θ=cos⁡−1(−13)\theta = \cos^{-1}\left(-\dfrac{1}{3}\right).

Answer: cos⁡−1(−13)\cos^{-1}\left(-\dfrac{1}{3}\right) — obtuse, as the negative dot product announced in advance.


Example 3: Perpendicular combinations

For a⃗=5i^−j^−3k^\vec{a} = 5\hat{i} - \hat{j} - 3\hat{k} and b⃗=i^+3j^−5k^\vec{b} = \hat{i} + 3\hat{j} - 5\hat{k}, show that a⃗+b⃗\vec{a} + \vec{b} and a⃗−b⃗\vec{a} - \vec{b} are perpendicular.

Solution:

  1. Compute both: a⃗+b⃗=6i^+2j^−8k^\vec{a} + \vec{b} = 6\hat{i} + 2\hat{j} - 8\hat{k} and a⃗−b⃗=4i^−4j^+2k^\vec{a} - \vec{b} = 4\hat{i} - 4\hat{j} + 2\hat{k}.
  2. Dot them: 24−8−16=024 - 8 - 16 = 0.

Answer: the dot product vanishes, so the vectors are perpendicular. (Deeper reason: (a⃗+b⃗)⋅(a⃗−b⃗)=∣a⃗∣2−∣b⃗∣2\left(\vec{a}+\vec{b}\right)\cdot\left(\vec{a}-\vec{b}\right) = |\vec{a}|^2 - |\vec{b}|^2, and here ∣a⃗∣=∣b⃗∣=35|\vec{a}| = |\vec{b}| = \sqrt{35} — the diagonals of a rhombus are perpendicular.)


Example 4: A projection

Find the projection of a⃗=2i^+3j^+2k^\vec{a} = 2\hat{i} + 3\hat{j} + 2\hat{k} on b⃗=i^+2j^+k^\vec{b} = \hat{i} + 2\hat{j} + \hat{k}.

Solution:

  1. Formula: projection =a⃗⋅b⃗∣b⃗∣= \dfrac{\vec{a}\cdot\vec{b}}{|\vec{b}|}.
  2. Compute: a⃗⋅b⃗=2+6+2=10\vec{a}\cdot\vec{b} = 2 + 6 + 2 = 10 and ∣b⃗∣=6|\vec{b}| = \sqrt{6}.
  3. Divide: 106=536\dfrac{10}{\sqrt{6}} = \dfrac{5}{3}\sqrt{6}.

Answer: 106=563\dfrac{10}{\sqrt{6}} = \dfrac{5\sqrt{6}}{3} — division by ∣b⃗∣|\vec{b}|, the vector being projected onto.


Example 5: Length of a difference

If ∣a⃗∣=2|\vec{a}| = 2, ∣b⃗∣=3|\vec{b}| = 3 and a⃗⋅b⃗=4\vec{a}\cdot\vec{b} = 4, find ∣a⃗−b⃗∣\left|\vec{a} - \vec{b}\right|.

Solution:

  1. Expand: ∣a⃗−b⃗∣2=∣a⃗∣2−2 a⃗⋅b⃗+∣b⃗∣2\left|\vec{a}-\vec{b}\right|^2 = |\vec{a}|^2 - 2\,\vec{a}\cdot\vec{b} + |\vec{b}|^2.
  2. Substitute: 4−8+9=54 - 8 + 9 = 5.

Answer: ∣a⃗−b⃗∣=5\left|\vec{a}-\vec{b}\right| = \sqrt{5}.


Example 6: An unknown magnitude

If a⃗\vec{a} is a unit vector and (x⃗−a⃗)⋅(x⃗+a⃗)=8\left(\vec{x} - \vec{a}\right)\cdot\left(\vec{x} + \vec{a}\right) = 8, find ∣x⃗∣|\vec{x}|.

Solution:

  1. Expand (difference of squares works for dots): x⃗⋅x⃗−a⃗⋅a⃗=∣x⃗∣2−1\vec{x}\cdot\vec{x} - \vec{a}\cdot\vec{a} = |\vec{x}|^2 - 1.
  2. Solve: ∣x⃗∣2−1=8|\vec{x}|^2 - 1 = 8, so ∣x⃗∣2=9|\vec{x}|^2 = 9.

Answer: ∣x⃗∣=3|\vec{x}| = 3 (magnitudes are non-negative — discard −3-3).


Example 7: The two inequalities

Prove (i) ∣a⃗⋅b⃗∣≤∣a⃗∣∣b⃗∣\left|\vec{a}\cdot\vec{b}\right| \leq |\vec{a}||\vec{b}| and (ii) ∣a⃗+b⃗∣≤∣a⃗∣+∣b⃗∣\left|\vec{a}+\vec{b}\right| \leq |\vec{a}| + |\vec{b}|.

Solution:

  1. (i) For nonzero vectors, ∣a⃗⋅b⃗∣=∣a⃗∣∣b⃗∣∣cos⁡θ∣≤∣a⃗∣∣b⃗∣\left|\vec{a}\cdot\vec{b}\right| = |\vec{a}||\vec{b}||\cos\theta| \leq |\vec{a}||\vec{b}| since ∣cos⁡θ∣≤1|\cos\theta| \leq 1; the zero cases hold trivially.
  2. (ii) Expand: ∣a⃗+b⃗∣2=∣a⃗∣2+2 a⃗⋅b⃗+∣b⃗∣2≤∣a⃗∣2+2∣a⃗∣∣b⃗∣+∣b⃗∣2=(∣a⃗∣+∣b⃗∣)2\left|\vec{a}+\vec{b}\right|^2 = |\vec{a}|^2 + 2\,\vec{a}\cdot\vec{b} + |\vec{b}|^2 \leq |\vec{a}|^2 + 2|\vec{a}||\vec{b}| + |\vec{b}|^2 = \left(|\vec{a}| + |\vec{b}|\right)^2, using a⃗⋅b⃗≤∣a⃗⋅b⃗∣\vec{a}\cdot\vec{b} \leq \left|\vec{a}\cdot\vec{b}\right| and then (i).
  3. Take roots (both sides non-negative).

Answer: both inequalities hold; equality in (ii) exactly when the vectors point the same way.


Example 8: Collinearity by lengths

Show that A(−2i^+3j^+5k^)A\left(-2\hat{i} + 3\hat{j} + 5\hat{k}\right), B(i^+2j^+3k^)B\left(\hat{i} + 2\hat{j} + 3\hat{k}\right) and C(7i^−k^)C\left(7\hat{i} - \hat{k}\right) are collinear.

Solution:

  1. Joining vectors: AB→=3i^−j^−2k^\overrightarrow{AB} = 3\hat{i} - \hat{j} - 2\hat{k}, BC→=6i^−2j^−4k^\overrightarrow{BC} = 6\hat{i} - 2\hat{j} - 4\hat{k}, AC→=9i^−3j^−6k^\overrightarrow{AC} = 9\hat{i} - 3\hat{j} - 6\hat{k}.
  2. Spot the proportionality: BC→=2AB→\overrightarrow{BC} = 2\overrightarrow{AB} and AC→=3AB→\overrightarrow{AC} = 3\overrightarrow{AB} — all three are parallel and share points.
  3. Length check: ∣AB→∣=14\left|\overrightarrow{AB}\right| = \sqrt{14}, ∣BC→∣=214\left|\overrightarrow{BC}\right| = 2\sqrt{14}, ∣AC→∣=314\left|\overrightarrow{AC}\right| = 3\sqrt{14}, so ∣AC→∣=∣AB→∣+∣BC→∣\left|\overrightarrow{AC}\right| = \left|\overrightarrow{AB}\right| + \left|\overrightarrow{BC}\right| — equality in the triangle inequality.

Answer: A,B,CA, B, C are collinear: the "triangle" is degenerate, its longest side exactly the sum of the other two.