This note covers the scalar product (dot product) of two vectors, in component form and in terms of the angle between them. It is the main tool for finding angles in three dimensions and for testing whether two vectors are perpendicular or parallel.
Key ideas
The scalar product of two vectors is a single number, not a vector. There are two ways to calculate it, and the link between them is what makes it useful.
Component form. For \(\mathbf{u}=\begin{pmatrix}u_1\\u_2\\u_3\end{pmatrix}\) and \(\mathbf{v}=\begin{pmatrix}v_1\\v_2\\v_3\end{pmatrix}\), \[\mathbf{u}\cdot\mathbf{v}=u_1v_1+u_2v_2+u_3v_3.\] Multiply matching components and add. In two dimensions use only two terms.
Geometric form. If \(\theta\) is the angle between \(\mathbf{u}\) and \(\mathbf{v}\), then \[\mathbf{u}\cdot\mathbf{v}=|\mathbf{u}||\mathbf{v}|\cos\theta.\] The angle is measured when both vectors start at the same point, with \(0^\circ\le\theta\le180^\circ\). When you place one vector head to tail with another, the angle inside the shape may be the supplement of the angle between the vectors, so be careful.
Equating the two forms gives the angle formula \[\cos\theta=\frac{\mathbf{u}\cdot\mathbf{v}}{|\mathbf{u}||\mathbf{v}|}.\] The sign of the scalar product tells you about the angle. If \(\mathbf{u}\cdot\mathbf{v}\gt0\), the angle is acute. If \(\mathbf{u}\cdot\mathbf{v}\lt0\), the angle is obtuse. If \(\mathbf{u}\cdot\mathbf{v}=0\), the angle is \(90^\circ\).
Perpendicular vectors. Two non-zero vectors are perpendicular if and only if \(\mathbf{u}\cdot\mathbf{v}=0\). This is the standard test, and a way to find unknown components.
Parallel vectors. If \(\mathbf{u}\) and \(\mathbf{v}\) are parallel and in the same direction, \(\theta=0^\circ\) and \(\mathbf{u}\cdot\mathbf{v}=|\mathbf{u}||\mathbf{v}|\). If they are in opposite directions, \(\theta=180^\circ\) and \(\mathbf{u}\cdot\mathbf{v}=-|\mathbf{u}||\mathbf{v}|\). In particular, \(\mathbf{u}\cdot\mathbf{u}=|\mathbf{u}|^2\), which is another way to compute a magnitude.
Algebraic properties.
- Commutative: \(\mathbf{u}\cdot\mathbf{v}=\mathbf{v}\cdot\mathbf{u}\).
- Distributive: \(\mathbf{u}\cdot(\mathbf{v}+\mathbf{w})=\mathbf{u}\cdot\mathbf{v}+\mathbf{u}\cdot\mathbf{w}\).
- Scalar multiples: \((k\mathbf{u})\cdot\mathbf{v}=k(\mathbf{u}\cdot\mathbf{v})\).
These let you expand brackets, for example \(|\mathbf{u}+\mathbf{v}|^2=|\mathbf{u}|^2+2\,\mathbf{u}\cdot\mathbf{v}+|\mathbf{v}|^2\).
Angle in a triangle. To find the angle at vertex \(B\) of triangle \(ABC\), use the two vectors that start at \(B\): \(\overrightarrow{BA}\) and \(\overrightarrow{BC}\). Using \(\overrightarrow{AB}\) with \(\overrightarrow{BC}\) gives the exterior angle and the wrong answer.
Calculator use. Once you have \(\cos\theta\), use the inverse cosine function on your GDC to find the angle. Make sure the calculator is in degree mode if the answer is wanted in degrees. Cosine is one-to-one on \(0^\circ\) to \(180^\circ\), so the angle is unique.
Why the two forms agree. Place \(\mathbf{u}\) and \(\mathbf{v}\) so they start at the same point. The third side of the triangle they form is \(\mathbf{u}-\mathbf{v}\). The cosine rule gives \(|\mathbf{u}-\mathbf{v}|^2=|\mathbf{u}|^2+|\mathbf{v}|^2-2|\mathbf{u}||\mathbf{v}|\cos\theta\). Expanding the left side with components gives \(|\mathbf{u}|^2+|\mathbf{v}|^2-2(u_1v_1+u_2v_2+u_3v_3)\). Comparing the two shows that \(u_1v_1+u_2v_2+u_3v_3=|\mathbf{u}||\mathbf{v}|\cos\theta\). You do not need to reproduce this argument, but it explains why the formula is true and why it works in any number of dimensions.
Using the scalar product in context. In physics, the work done by a constant force \(\mathbf{F}\) over a displacement \(\mathbf{d}\) is \(\mathbf{F}\cdot\mathbf{d}\). If the force is at right angles to the movement, no work is done. In geometry, a triangle has a right angle at \(B\) exactly when \(\overrightarrow{BA}\cdot\overrightarrow{BC}=0\). This is a quick way to test whether three given points form a right-angled triangle.
Perpendicular lines in two dimensions. A line with direction \(\begin{pmatrix}a\\b\end{pmatrix}\) has gradient \(b/a\). A perpendicular line has direction \(\begin{pmatrix}-b\\a\end{pmatrix}\), because \(a(-b)+ba=0\). Its gradient is \(-a/b\), which is the negative reciprocal. So the scalar product gives the familiar rule for perpendicular gradients.
Finding unknowns. Questions often give an angle and ask for an unknown component. Write \(\cos\theta\) using the formula, substitute the known angle, and solve. If the unknown is inside a square root, isolate the root and square both sides. Then check your answers, since squaring can introduce a value that does not satisfy the original equation.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| \(\mathbf{u}\cdot\mathbf{v}=u_1v_1+u_2v_2+u_3v_3\) | Scalar product from components. |
| \(\mathbf{u}\cdot\mathbf{v}=|\mathbf{u}||\mathbf{v}|\cos\theta\) | Scalar product from magnitudes and the angle between the vectors. |
| \(\cos\theta=\dfrac{\mathbf{u}\cdot\mathbf{v}}{|\mathbf{u}||\mathbf{v}|}\) | Angle between two vectors. |
| \(\mathbf{u}\cdot\mathbf{v}=0\) | The non-zero vectors are perpendicular. |
| \(\mathbf{u}\cdot\mathbf{u}=|\mathbf{u}|^2\) | Square of the magnitude. |
Worked examples
Example 1 Find the angle between \(\mathbf{u}=\begin{pmatrix}2\\1\\-2\end{pmatrix}\) and \(\mathbf{v}=\begin{pmatrix}3\\-4\\12\end{pmatrix}\).
\(\mathbf{u}\cdot\mathbf{v}=2\times3+1\times(-4)+(-2)\times12=6-4-24=-22\).
\(|\mathbf{u}|=\sqrt{4+1+4}=3\) and \(|\mathbf{v}|=\sqrt{9+16+144}=13\).
\(\cos\theta=\dfrac{-22}{3\times13}=-\dfrac{22}{39}\).
Use the inverse cosine function on your GDC: \(\theta=124.34^\circ\).
The negative scalar product agrees with an obtuse angle.
Answer: \(\theta=124^\circ\) (3 s.f.).
Example 2 Find the value of \(k\) for which \(\begin{pmatrix}k\\2\\-1\end{pmatrix}\) is perpendicular to \(\begin{pmatrix}3\\-1\\4\end{pmatrix}\).
Perpendicular vectors have a scalar product of zero.
\(3k+2\times(-1)+(-1)\times4=0\), so \(3k-2-4=0\).
\(3k=6\), so \(k=2\).
Check: \(\begin{pmatrix}2\\2\\-1\end{pmatrix}\cdot\begin{pmatrix}3\\-1\\4\end{pmatrix}=6-2-4=0\).
Answer: \(k=2\).
Example 3 Triangle \(ABC\) has vertices \(A(1,0,2)\), \(B(3,1,0)\) and \(C(4,-2,1)\). Find angle \(ABC\).
The angle at \(B\) is between the vectors that start at \(B\).
\(\overrightarrow{BA}=\begin{pmatrix}1-3\\0-1\\2-0\end{pmatrix}=\begin{pmatrix}-2\\-1\\2\end{pmatrix}\) and \(\overrightarrow{BC}=\begin{pmatrix}4-3\\-2-1\\1-0\end{pmatrix}=\begin{pmatrix}1\\-3\\1\end{pmatrix}\).
\(\overrightarrow{BA}\cdot\overrightarrow{BC}=-2+3+2=3\).
\(|\overrightarrow{BA}|=\sqrt{4+1+4}=3\) and \(|\overrightarrow{BC}|=\sqrt{1+9+1}=\sqrt{11}\).
\(\cos\theta=\dfrac{3}{3\sqrt{11}}=\dfrac{1}{\sqrt{11}}=0.30151\), so \(\theta=72.45^\circ\) on the GDC.
Answer: angle \(ABC=72.5^\circ\) (3 s.f.).
Common errors
- Using vectors that do not start at the same point, for example \(\overrightarrow{AB}\) and \(\overrightarrow{BC}\), and so finding the exterior angle.
- Forgetting that the scalar product is a number. Writing the answer as a vector is wrong.
- Dropping the denominator \(|\mathbf{u}||\mathbf{v}|\) when finding an angle, or forgetting the square roots in the magnitudes.
- Assuming that \(\mathbf{u}\cdot\mathbf{v}=0\) means one vector is zero. It can also mean the vectors are perpendicular.
- Having the GDC in radian mode when the question asks for degrees.
Exam tip: If the scalar product comes out negative, expect an obtuse angle. Compare your final answer with this to catch a slip.
Check yourself
- Calculate \(\begin{pmatrix}4\\-1\\2\end{pmatrix}\cdot\begin{pmatrix}1\\6\\-3\end{pmatrix}\).
Answer
\(4-6-6=-8\). - Vectors \(\mathbf{a}\) and \(\mathbf{b}\) have \(|\mathbf{a}|=4\), \(|\mathbf{b}|=5\) and angle \(60^\circ\) between them. Find \(\mathbf{a}\cdot\mathbf{b}\).
Answer
\(4\times5\times\cos60^\circ=20\times0.5=10\). - Find \(m\) so that \(\begin{pmatrix}m\\3\end{pmatrix}\) is perpendicular to \(\begin{pmatrix}6\\-2\end{pmatrix}\).
Answer
\(6m-6=0\), so \(m=1\). - Find the angle between \(\begin{pmatrix}1\\1\end{pmatrix}\) and \(\begin{pmatrix}1\\0\end{pmatrix}\).
Answer
\(\cos\theta=\dfrac{1}{\sqrt2\times1}=\dfrac{1}{\sqrt2}\), so \(\theta=45^\circ\).