# Vectors: basics, operations, dot product

> IB Mathematics: Applications and Interpretation HL · Unit 3: Geometry and trigonometry
> Source: https://www.owlsprep.com/study/ib-math-ai-hl-u3-vectors-basics-operations-dot-product/

This sub-topic introduces core vector concepts for 2D and 3D geometry, including basic operations and the dot product. You will learn to describe positions, calculate angles, and test for perpendicularity, a foundation for lines and planes.

**Prerequisites:** [Coordinate geometry in 2D and 3D](https://www.owlsprep.com/study/ib-math-ai-hl-u3-coordinate-geometry-2d-3d/); Pythagoras' theorem and basic trigonometry

## Learning objectives

- Distinguish between scalars and vectors, and represent vectors in 2D and 3D
- Perform vector addition and scalar multiplication correctly
- Calculate the magnitude of a vector and unit vectors in any direction
- Compute the dot product and use it to find angles between vectors and test for perpendicularity

## Vector Basics

**Scalar vs Vector** — A scalar is a quantity with only magnitude (size). A vector is a quantity with both magnitude and direction.

*Example:* Distance (5 km) is a scalar; displacement (5 km north) is a vector.

For a vector between two points \(A(x_1,y_1,z_1)\) and \(B(x_2,y_2,z_2)\), the components of \(\vec{AB}\) are calculated by subtracting the coordinates of the start point \(A\) from the end point \(B\).

$$\vec{AB} = \begin{pmatrix} x_2 - x_1 \\ y_2 - y_1 \\ z_2 - z_1 \end{pmatrix}, \quad |\vec{v}| = \sqrt{v_1^2 + v_2^2 + v_3^2}$$

**Worked example:** Find \(\vec{AB}\) and its magnitude, where \(A = (1, 2, -3)\) and \(B = (4, 0, 1)\).

1. Subtract start point coordinates from end point coordinates to get components:
2. $$x: 4 - 1 = 3, \quad y: 0 - 2 = -2, \quad z: 1 - (-3) = 4 \\ \vec{AB} = \begin{pmatrix} 3 \\ -2 \\ 4 \end{pmatrix}$$
3. Calculate magnitude using the Pythagorean formula:
4. $$|\vec{AB}| = \sqrt{3^2 + (-2)^2 + 4^2} = \sqrt{9 + 4 + 16} = \sqrt{29} \approx 5.39$$

> **Exam tip:** Always remember: end point minus start point for vectors between two points.

## Vector Addition and Scalar Multiplication

All basic vector operations are done component-wise: you work on each x, y, z component separately to get the result.

- Addition: Add corresponding components: \(\vec{a} + \vec{b} = (a_1 + b_1, a_2 + b_2, a_3 + b_3)\)
- Scalar multiplication: Multiply every component by the scalar: \(k\vec{v} = (kv_1, kv_2, kv_3)\)
- Negative of a vector: Reverse direction: \(-\vec{v} = (-v_1, -v_2, -v_3)\)

**Worked example:** Given \(\vec{a} = \begin{pmatrix} 2 \\ -1 \end{pmatrix}\) and \(\vec{b} = \begin{pmatrix} -3 \\ 4 \end{pmatrix}\), find \(3\vec{a} - 2\vec{b}\).

1. First calculate each scalar multiple:
2. $$3\vec{a} = 3\begin{pmatrix} 2 \\ -1 \end{pmatrix} = \begin{pmatrix} 6 \\ -3 \end{pmatrix}, \quad 2\vec{b} = 2\begin{pmatrix} -3 \\ 4 \end{pmatrix} = \begin{pmatrix} -6 \\ 8 \end{pmatrix}$$
3. Subtract component-wise:
4. $$3\vec{a} - 2\vec{b} = \begin{pmatrix} 6 - (-6) \\ -3 - 8 \end{pmatrix} = \begin{pmatrix} 12 \\ -11 \end{pmatrix}$$

**Check your understanding**

What is the magnitude of \(3\vec{a} - 2\vec{b}\) from the example above?

1. Select the correct answer:

   - \(5\)
   - \(\sqrt{265} \approx 16.3\)
   - \(1\)

   *Answer:* \(\sqrt{265} \approx 16.3\)

   *Why:* You must square each component before adding: \(12^2 + (-11)^2 = 144 + 121 = 265\), so magnitude is \(\sqrt{265}\).

## Dot Product and Applications

**Dot Product (Scalar Product)** — For two vectors \(\vec{a} = (a_1,a_2,a_3)\) and \(\vec{b} = (b_1,b_2,b_3)\), the dot product is a scalar calculated by summing the product of corresponding components. It is linked to the angle \(\theta\) between the vectors.

*Notation:* \(\vec{a} \cdot \vec{b}\)

$$\vec{a} \cdot \vec{b} = a_1b_1 + a_2b_2 + a_3b_3 = |\vec{a}||\vec{b}|\cos\theta$$

The most important geometric property of the dot product: two non-zero vectors are perpendicular if and only if their dot product is zero (since \(\cos 90^\circ = 0\)). We can rearrange the formula to find the angle between any two vectors:

$$\cos\theta = \frac{\vec{a} \cdot \vec{b}}{|\vec{a}||\vec{b}|}$$

**Worked example:** Find the angle between \(\vec{v} = \begin{pmatrix} 2 \\ 1 \\ -1 \end{pmatrix}\) and \(\vec{w} = \begin{pmatrix} 3 \\ -2 \\ 1 \end{pmatrix}\), correct to 1 decimal place.

1. Step 1: Calculate the dot product:
2. $$\vec{v} \cdot \vec{w} = (2)(3) + (1)(-2) + (-1)(1) = 6 - 2 - 1 = 3$$
3. Step 2: Calculate the magnitude of each vector:
4. $$|\vec{v}| = \sqrt{2^2 + 1^2 + (-1)^2} = \sqrt{6} \approx 2.449, \quad |\vec{w}| = \sqrt{3^2 + (-2)^2 + 1^2} = \sqrt{14} \approx 3.742$$
5. Step 3: Calculate \(\cos\theta\) and find the angle:
6. $$\cos\theta = \frac{3}{\sqrt{6}\sqrt{14}} \approx 0.327 \implies \theta = \arccos(0.327) \approx 70.9^\circ$$

> **Exam tip:** Check if the dot product is zero first before calculating magnitudes, this saves time for perpendicularity questions.

## Common pitfalls

- **Wrong:** Subtract end point coordinates from start point when finding \(\vec{AB}\)
  - Why it fails: This gives the vector pointing in the opposite direction, with all components negated, leading to wrong results for angles and magnitudes
  - Correct: Always use: \(\vec{AB} = \text{end point } B - \text{start point } A\)
- **Wrong:** Add components before multiplying when calculating the dot product
  - Why it fails: This confuses vector addition with dot product calculation, leading to an incorrect scalar result
  - Correct: Multiply each pair of corresponding components first, then sum the products
- **Wrong:** Leave the answer as \(\cos\theta\) when asked for the angle between two vectors
  - Why it fails: Examiners expect the actual angle value, not the cosine of the angle, so you will lose marks
  - Correct: Always calculate the inverse cosine (arccos) of your value to get the final angle
- **Wrong:** Calculate magnitude as the sum of components, skipping squares and the square root
  - Why it fails: This confuses magnitude calculation with vector addition, leading to a completely wrong result
  - Correct: Square each component, sum the squares, then take the positive square root
- **Wrong:** Claim two vectors are perpendicular just because their dot product is zero, even if one is the zero vector
  - Why it fails: The zero vector has no defined direction, so perpendicularity does not apply
  - Correct: Confirm both vectors are non-zero before concluding perpendicularity from a zero dot product

## Cheatsheet

| Concept | Formula |
| --- | --- |
| Vector \(\vec{AB}\) (A to B) | \(\begin{pmatrix} x_2-x_1 \\ y_2-y_1 \\ z_2-z_1 \end{pmatrix}\) |
| Magnitude of \(\vec{v} = (v_1,v_2,v_3)\) | \(\|\vec{v}\| = \sqrt{v_1^2 + v_2^2 + v_3^2}\) |
| Vector addition | \(\vec{a} + \vec{b} = (a_1+b_1, a_2+b_2, a_3+b_3)\) |
| Scalar multiplication | \(k\vec{v} = (kv_1, kv_2, kv_3)\) |
| Dot product | \(\vec{a} \cdot \vec{b} = \sum a_i b_i = \|a\|\|b\|\cos\theta\) |
| Angle between two vectors | \(\cos\theta = \frac{\vec{a} \cdot \vec{b}}{\|\vec{a}\|\|\vec{b}\|}\) |
| Perpendicular vectors | \(\vec{a} \cdot \vec{b} = 0\) (non-zero vectors) |

## What's next

Now that you have mastered the basics of vectors, vector operations, and the dot product, you can apply these core skills to working with lines and planes in 2D and 3D space, the next key topic in IB AI HL geometry. A solid understanding of these concepts is essential for finding intersections of lines, calculating distances from points to lines or planes, and solving applied geometric problems in fields like navigation, engineering, and computer graphics. These vector basics also form the foundation for kinematics problems involving velocity and displacement vectors that you will encounter later in the course.

- [Vector Equation of a Line, Intersections](https://www.owlsprep.com/study/ib-math-ai-hl-u3-vector-equation-of-a-line/)
- [Voronoi diagrams: basic construction](https://www.owlsprep.com/study/ib-math-ai-hl-u3-voronoi-diagrams-basic-construction/)
- [Voronoi diagrams: application problems](https://www.owlsprep.com/study/ib-math-ai-hl-u3-voronoi-diagrams-application-problems/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ib-math-ai-hl-u3-vectors-basics-operations-dot-product/
