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 a ⋅ b = ∣ a ∣ ∣ b ∣ cos θ \bm a \cdot \bm b = \lvert \bm a\rvert\lvert \bm b\rvert \cos\theta a ⋅ b = ∣ a ∣ ∣ b ∣ cos θ cos θ \cos\theta cos θ is also known as the direction cosine .
⟮ x 1 y 1 z 1 ⟯ ⋅ ⟮ x 2 y 2 z 2 ⟯ = x 1 x 2 + y 1 y 2 + z 1 z 2 \cvec{x_1}{y_1}{z_1}\cdot\cvec{x_2}{y_2}{z_2} = x_1x_2 + y_1y_2 + z_1z_2 ⎩ ⎧ x 1 y 1 z 1 ⎭ ⎫ ⋅ ⎩ ⎧ x 2 y 2 z 2 ⎭ ⎫ = x 1 x 2 + y 1 y 2 + z 1 z 2 The Cauchy-Schwartz inequality is equivalent to
∣ a ⋅ b ∣ ≤ ∣ a ∣ ∣ b ∣ \lvert\bm a \cdot \bm b\rvert \leq \lvert\bm a\rvert\lvert\bm b\rvert ∣ a ⋅ b ∣ ≤ ∣ a ∣ ∣ b ∣ as ∣ cos θ ∣ ≤ 1 \lvert \cos \theta \rvert \leq 1 ∣ cos θ ∣ ≤ 1 .
Example: Find the angle between p = ⟮ 4 − 2 − 5 ⟯ \bm p = \cvec4{-2}{-5} p = ⎩ ⎧ 4 − 2 − 5 ⎭ ⎫ and q = ⟮ − 2 0 − 1 ⟯ \bm q = \cvec{-2}0{-1} q = ⎩ ⎧ − 2 0 − 1 ⎭ ⎫ .
Rearranging the dot product formula, we have
cos θ = p ⋅ q ∣ p ∣ ∣ q ∣ = 4 ( − 2 ) + ( − 2 ) ( 0 ) + ( − 5 ) ( − 1 ) 16 + 4 + 25 4 + 0 + 1 = − 3 45 5 = − 3 9 5 5 = − 1 5 θ = cos − 1 ( − 1 5 ) ≈ 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*} cos θ θ = ∣ p ∣ ∣ q ∣ p ⋅ q = 16 + 4 + 25 4 + 0 + 1 4 ( − 2 ) + ( − 2 ) ( 0 ) + ( − 5 ) ( − 1 ) = 45 5 − 3 = 9 5 5 − 3 = − 5 1 = cos − 1 ( − 5 1 ) ≈ 1.77 rad ■ 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 a × b is perpendicular to both a \bm a a and b \bm b b . The magnitude of the cross product is the area of the parallelogram spanned by a \bm a a and b \bm b b .
a × b = ∣ a ∣ ∣ b ∣ sin θ n ^ \bm a \times \bm b = \lvert \bm a\rvert\lvert \bm b\rvert \sin\theta \,\bm{\hat n} a × b = ∣ a ∣ ∣ b ∣ sin θ n ^ with n ^ \bm{\hat n} n ^ is some unit vector , perpendicular to both a \bm a a and b \bm b b .
The standard basis consisting of unit vectors i \bm i i , j \bm j j , k \bm k k (ie. unit vectors in the positive x x x , positive y y y and positive z z z directions) satisfies
i × j = k \bm i \times \bm j = \bm k i × j = k j × k = i \bm j \times \bm k = \bm i j × k = i k × i = j \bm k \times \bm i = \bm j k × i = j but also
j × i = − k \bm j \times \bm i = \bm {-k} j × i = − k k × j = − i \bm k \times \bm j = \bm {-i} k × j = − i i × k = − j \bm i \times \bm k = \bm {-j} i × k = − j By using these formulas on individual components, the cross product in components form is
a × b = ⟮ y 1 z 2 − y 2 z 1 z 1 x 2 − z 2 x 1 x 1 y 2 − x 2 y 1 ⟯ \bm a \times \bm b = \cvec{y_1z_2 - y_2z_1}{z_1x_2 - z_2x_1}{x_1y_2 - x_2y_1} a × b = ⎩ ⎧ y 1 z 2 − y 2 z 1 z 1 x 2 − z 2 x 1 x 1 y 2 − x 2 y 1 ⎭ ⎫ There are various ways to make sense of the formula. One way to remember is to first write each vectors twice
x 1 y 1 z 1 x 1 y 1 z 1 x 2 y 2 z 2 x 2 y 2 z 2 \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} x 1 x 2 y 1 y 2 z 1 z 2 x 1 x 2 y 1 y 2 z 1 z 2 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 3 3 3 by 3 3 3 matrix
a × b = ∣ i j k x 1 y 1 z 1 x 2 y 2 z 2 ∣ \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} a × b = i x 1 x 2 j y 1 y 2 k z 1 z 2 You are not required to interpret or simplify a determinant.
Example: Find a vector perpendicular to both v = ⟮ 1 − 2 − 3 ⟯ \bm v = \cvec1{-2}{-3} v = ⎩ ⎧ 1 − 2 − 3 ⎭ ⎫ and w = ⟮ 4 − 5 6 ⟯ \bm w = \cvec4{-5}6 w = ⎩ ⎧ 4 − 5 6 ⎭ ⎫ .
1 − 2 − 3 1 − 2 − 3 4 − 5 6 4 − 5 6 \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} 1 4 − 2 − 5 − 3 6 1 4 − 2 − 5 − 3 6 v × w = ⟮ ( − 2 ) ( 6 ) − ( − 5 ) ( − 3 ) ( − 3 ) ( 4 ) − ( 6 ) ( 1 ) ( 1 ) ( − 5 ) − ( 4 ) ( − 2 ) ⟯ = ⟮ − 12 − 15 − 12 − 6 − 5 − ( − 8 ) ⟯ = ⟮ − 27 − 18 3 ⟯ ■ \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*} v × w = ⎩ ⎧ ( − 2 ) ( 6 ) − ( − 5 ) ( − 3 ) ( − 3 ) ( 4 ) − ( 6 ) ( 1 ) ( 1 ) ( − 5 ) − ( 4 ) ( − 2 ) ⎭ ⎫ = ⎩ ⎧ − 12 − 15 − 12 − 6 − 5 − ( − 8 ) ⎭ ⎫ = ⎩ ⎧ − 27 − 18 3 ⎭ ⎫ ■ 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} ⟨ 9 , 6 , − 1 ⟩ , which is the above vector multiplied by − 1 3 {-\frac13} − 3 1 .
Properties For the following properties, terms other than parallel and perpendicular are not used on exams, but nevertheless be able to apply these properties.
properties dot product cross product parallel vectors a ⋅ b = ∣ a ∣ ∣ b ∣ a ⋅ a = ∣ a ∣ 2 \bm a \cdot \bm b = \lvert\bm a\rvert\lvert\bm b\rvert \\ \bm a \cdot \bm a = \lvert\bm a\rvert^2 a ⋅ b = ∣ a ∣ ∣ b ∣ a ⋅ a = ∣ a ∣ 2 a × b = 0 \bm a \times \bm b = \bm 0 a × b = 0 perpendicular vectors a ⋅ b = 0 \bm a \cdot \bm b = 0 a ⋅ b = 0 a × b = ∣ a ∣ ∣ b ∣ n ^ \bm a \times \bm b = \lvert\bm a\rvert\lvert\bm b\rvert \bm{\hat n} a × b = ∣ a ∣ ∣ b ∣ n ^ commutative a ⋅ b = b ⋅ a \bm a \cdot \bm b = \bm b \cdot \bm a a ⋅ b = b ⋅ a N/A anticommutative N/A a × b = − b × a \bm a \times \bm b = -\bm b \times \bm a a × b = − b × a distributive k ( a ⋅ b ) = ( k a ) ⋅ b = a ⋅ ( k b ) a ⋅ ( b + c ) = a ⋅ b + a ⋅ c k(\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 c k ( a ⋅ b ) = ( k a ) ⋅ b = a ⋅ ( k b ) a ⋅ ( b + c ) = a ⋅ b + a ⋅ c k ( a × b ) = ( k a ) × b = a × ( k b ) a × ( b + c ) = a × b + a × c k(\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 k ( a × b ) = ( k a ) × b = a × ( k b ) a × ( b + c ) = a × b + a × c
Example: Given ∣ a ∣ = 3 \lvert\bm a\rvert = 3 ∣ a ∣ = 3 and ∣ b ∣ = 4 \lvert\bm b\rvert = 4 ∣ b ∣ = 4 and that a + 2 b \bm a + 2\bm b a + 2 b is perpendicular to 3 a − b 3\bm a - \bm b 3 a − b , find the angle between a \bm a a and b \bm b b
( a + 2 b ) ⋅ ( 3 a − b ) = 0 3 ∣ a ∣ 2 + 5 ( a ⋅ b ) − 2 ∣ b ∣ 2 = 0 3 ( 3 ) 2 + 5 ∣ a ∣ ∣ b ∣ cos θ − 2 ( 4 ) 2 = 0 27 + 5 ( 3 ) ( 4 ) cos θ − 32 = 0 60 cos θ = 5 cos − 1 1 12 = θ ■ \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*} ( a + 2 b ) ⋅ ( 3 a − b ) 3 ∣ a ∣ 2 + 5 ( a ⋅ b ) − 2 ∣ b ∣ 2 3 ( 3 ) 2 + 5 ∣ a ∣ ∣ b ∣ cos θ − 2 ( 4 ) 2 27 + 5 ( 3 ) ( 4 ) cos θ − 32 60 cos θ cos − 1 12 1 = 0 = 0 = 0 = 0 = 5 = θ ■ π − cos − 1 1 12 \pi - \cos^{-1} \frac{1}{12} π − cos − 1 12 1 is accepted as well. The π − \pi - π − angle is typically accepted for lines, and here when directions are unknown, but not for segments.