Dot product and cross product (HL)

Last edited: 2026-06-09 changed to proper vector notations and updated examples

Contents

Angle between vectors

The angle θ\theta between vectors is the angle formed when their tails coincide.

Dot product

ab=abcosθ\bm a \cdot \bm b = \lvert \bm a\rvert\lvert \bm b\rvert \cos\theta

cosθ\cos\theta is also known as the direction cosine.

x1y1z1x2y2z2=x1x2+y1y2+z1z2\cvec{x_1}{y_1}{z_1}\cdot\cvec{x_2}{y_2}{z_2} = x_1x_2 + y_1y_2 + z_1z_2

The Cauchy-Schwartz inequality  is equivalent to

abab\lvert\bm a \cdot \bm b\rvert \leq \lvert\bm a\rvert\lvert\bm b\rvert

as cosθ1\lvert \cos \theta \rvert \leq 1.

Example: Find the angle between p=425\bm p = \cvec4{-2}{-5} and q=201\bm q = \cvec{-2}0{-1}.


Rearranging the dot product formula, we have

cosθ=pqpq=4(2)+(2)(0)+(5)(1)16+4+254+0+1=3455=3955=15θ=cos1(15)1.77  rad\begin{align*} \cos \theta &= \frac{\bm p \cdot \bm q}{\lvert\bm p\rvert\lvert\bm q\rvert} \\ &= \frac{4(-2)+(-2)(0)+(-5)(-1)}{\sqrt{16+4+25}\sqrt{4+0+1}} \\ &= \frac{-3}{\sqrt{45}\sqrt{5}} \\ &= \frac{-3}{\sqrt9 \sqrt5\sqrt5} \\ &= -\frac{1}{5} \\ \theta &= \cos^{-1}\left(-\frac15\right) \approx 1.77\;\text{rad} \qed \end{align*}

This is an obtuse angle. Later in angles using vectors we have to be careful whether to take the acute or obtuse angle.

Cross product

The cross product a×b\bm a \times \bm b is perpendicular to both a\bm a and b\bm b. The magnitude of the cross product is the area of the parallelogram spanned by a\bm a and b\bm b.

a×b=absinθn^\bm a \times \bm b = \lvert \bm a\rvert\lvert \bm b\rvert \sin\theta \,\bm{\hat n}

with n^\bm{\hat n} is some unit vector, perpendicular to both a\bm a and b\bm b.

The standard basis consisting of unit vectors i\bm i, j\bm j, k\bm k (ie. unit vectors in the positive xx, positive yy and positive zz directions) satisfies

i×j=k\bm i \times \bm j = \bm k
j×k=i\bm j \times \bm k = \bm i
k×i=j\bm k \times \bm i = \bm j

but also

j×i=k\bm j \times \bm i = \bm {-k}
k×j=i\bm k \times \bm j = \bm {-i}
i×k=j\bm i \times \bm k = \bm {-j}

By using these formulas on individual components, the cross product in components form is

a×b=y1z2y2z1z1x2z2x1x1y2x2y1\bm a \times \bm b = \cvec{y_1z_2 - y_2z_1}{z_1x_2 - z_2x_1}{x_1y_2 - x_2y_1}

There are various ways to make sense of the formula. One way to remember is to first write each vectors twice

x1y1z1x1y1z1x2y2z2x2y2z2\begin{matrix} \sout{\color{grey}x_1} & y_1 & z_1 & x_1 & y_1 & \sout{\color{grey}z_1} \\ \sout{\color{grey}x_2} & y_2 & z_2 & x_2 & y_2 & \sout{\color{grey}z_2} \end{matrix}

The components of the cross product, after ignoring first and last columns, are “diagonal down minus diagonal up” for each 2 by 2 grid.

Alternatively, using the determinant of a 33 by 33 matrix

a×b=ijkx1y1z1x2y2z2\bm a \times \bm b = \begin{vmatrix} \bm i & \bm j & \bm k \\ x_1 & y_1 & z_1 \\ x_2 & y_2 & z_2 \end{vmatrix}

You are not required to interpret or simplify a determinant.

Example: Find a vector perpendicular to both v=123\bm v = \cvec1{-2}{-3} and w=456\bm w = \cvec4{-5}6.


123123456456\begin{matrix} \sout{\color{grey}1} & -2 & -3 & 1 & -2 & \sout{\color{grey}-3} \\ \sout{\color{grey}4} & -5 & 6 & 4 & -5 & \sout{\color{grey}6} \end{matrix}
v×w=(2)(6)(5)(3)(3)(4)(6)(1)(1)(5)(4)(2)=12151265(8)=27183\begin{align*} \bm v \times \bm w &= \cvec{(-2)(6)-(-5)(-3)}{(-3)(4) - (6)(1)}{(1)(-5)-(4)(-2)} \\ &= \cvec{-12-15}{-12 - 6}{-5-(-8)} \\ &= \cvec{-27}{-18}3 \qed \end{align*}

It is worth while to write out all of the above to avoid mistakes in plus or minus signs.

Note that this vector can be scaled by any non-zero constant, so the answer is far from unique. One such scalar multiple is 9,6,1\rvec{9, 6, -1}, which is the above vector multiplied by 13{-\frac13}.

Properties

For the following properties, terms other than parallel and perpendicular are not used on exams, but nevertheless be able to apply these properties.

propertiesdot productcross product
parallel vectorsab=abaa=a2\bm a \cdot \bm b = \lvert\bm a\rvert\lvert\bm b\rvert \\ \bm a \cdot \bm a = \lvert\bm a\rvert^2a×b=0\bm a \times \bm b = \bm 0
perpendicular vectorsab=0\bm a \cdot \bm b = 0a×b=abn^\bm a \times \bm b = \lvert\bm a\rvert\lvert\bm b\rvert \bm{\hat n}
commutativeab=ba\bm a \cdot \bm b = \bm b \cdot \bm aN/A
anticommutativeN/Aa×b=b×a\bm a \times \bm b = -\bm b \times \bm a
distributivek(ab)=(ka)b=a(kb)a(b+c)=ab+ack(\bm a \cdot \bm b) = (k\bm a) \cdot \bm b = \bm a \cdot (k\bm b) \\ \bm a \cdot (\bm b + \bm c) = \bm a \cdot \bm b + \bm a \cdot \bm ck(a×b)=(ka)×b=a×(kb)a×(b+c)=a×b+a×ck(\bm a \times \bm b) = (k\bm a) \times \bm b = \bm a \times (k\bm b) \\ \bm a\times(\bm b + \bm c) = \bm a \times \bm b + \bm a \times \bm c

Example: Given a=3\lvert\bm a\rvert = 3 and b=4\lvert\bm b\rvert = 4 and that a+2b\bm a + 2\bm b is perpendicular to 3ab3\bm a - \bm b, find the angle between a\bm a and b\bm b


(a+2b)(3ab)=03a2+5(ab)2b2=03(3)2+5abcosθ2(4)2=027+5(3)(4)cosθ32=060cosθ=5 cos1112=θ\begin{align*} (\bm a + 2\bm b) \cdot (3\bm a - \bm b) &= 0 \\ 3\lvert\bm a\rvert^2 + 5(\bm a \cdot \bm b) - 2\lvert\bm b\rvert^2 &= 0 \\ 3(3)^2 + 5\lvert\bm a\rvert\lvert\bm b\rvert \cos\theta - 2(4)^2 &= 0 \\ 27 + 5(3)(4) \cos\theta - 32 &= 0 \\ 60 \cos \theta &= 5\ \\ \cos^{-1} \frac{1}{12} &= \theta \qed \end{align*}

πcos1112\pi - \cos^{-1} \frac{1}{12} is accepted as well. The π\pi - angle is typically accepted for lines, and here when directions are unknown, but not for segments.