C. Geometry and Algebra of Vectors · Dot and Cross ProductsThe Dot Product in Cartesian Form
C2.4About 65 minutes
Learning goals- I can calculate the dot product of Cartesian vectors in two-space and three-space.
- I can explain, using the cosine law, why the Cartesian and geometric formulas give the same result.
- I can use the dot product to find a length and to solve for an unknown component.
Words to know
Cartesian vector
A vector written in components, such as [2, −1, 3] or 2i − j + 3k.
component
One of the numbers in a Cartesian vector, giving its change along one axis.
Cartesian dot product
u · v = u₁v₁ + u₂v₂ + u₃v₃: the sum of the products of matching components.
cosine law
In any triangle, c² = a² + b² − 2ab cos C.
A faster way to compute
In lesson 1 you needed the angle between two vectors to find their dot product. But vectors are usually given in components, like [3, −2] or [2, −1, 3], and the angle is unknown. Good news: there is a formula that uses only the components, and it is so simple you can do it in your head.
Remember from Vectors in Two-Space and Three-Space: a Cartesian vector u = [u₁, u₂, u₃] can also be written u₁i + u₂j + u₃k, and its magnitude is |u| = √(u₁² + u₂² + u₃²). As in that unit, square brackets [u₁, u₂, u₃] name a vector and round brackets (x, y, z) name a point. (Some textbooks also use round brackets for vectors, so check which is meant.)
The Cartesian formula
In two-space, if u = [u₁, u₂] and v = [v₁, v₂], then
u · v = u₁v₁ + u₂v₂
In three-space, if u = [u₁, u₂, u₃] and v = [v₁, v₂, v₃], then
u · v = u₁v₁ + u₂v₂ + u₃v₃
In words: multiply matching components and add.
To find a · b in Cartesian form, multiply matching components, then add the products. The answer is a single number.Why it works
Place u and v tail to tail. The third side of the triangle they make is u − v. The cosine law (from Grade 11) says
|u − v|² = |u|² + |v|² − 2|u||v| cos θ
Now write each length in components (2-D shown; 3-D is the same with one more term):
- Left side: (u₁ − v₁)² + (u₂ − v₂)² = u₁² − 2u₁v₁ + v₁² + u₂² − 2u₂v₂ + v₂²
- Right side: u₁² + u₂² + v₁² + v₂² − 2|u||v| cos θ
Cancel the squares that appear on both sides: −2u₁v₁ − 2u₂v₂ = −2|u||v| cos θ. Divide by −2:
|u||v| cos θ = u₁v₁ + u₂v₂
The left side is the geometric dot product, so the two definitions always agree.
The vectors u, v and u − v form a triangle with angle θ between u and v. Writing the cosine law in components turns |u||v| cos θ into a simple sum of products.Worked exampleExample 1: Two-space
- Multiply matching components: 3 × 4 = 12 and (−2) × 5 = −10.
- Add: 12 + (−10) = 2.
2. It is positive, so the angle between the vectors is acute.
Worked exampleExample 2: Three-space
Find a · b for a = [2, −1, 3] and b = [4, 0, −5].
- Products: 2 × 4 = 8, (−1) × 0 = 0, 3 × (−5) = −15.
- Sum: 8 + 0 − 15 = −7.
a · b = −7, so the angle between a and b is obtuse.
Worked exampleExample 3: Unit-vector form
Find (2i − 3j + k) · (i + 4j − 2k).
- Read the components: [2, −3, 1] and [1, 4, −2].
- Products: 2(1) = 2, (−3)(4) = −12, (1)(−2) = −2.
- Sum: 2 − 12 − 2 = −12.
Worked exampleExample 4: Solving for an unknown component
Find k so that [k, 3, −2] · [4, −1, k] = 10.
- Dot product: 4k + (3)(−1) + (−2)(k) = 4k − 3 − 2k = 2k − 3.
- Set it equal to 10: 2k − 3 = 10, so 2k = 13.
- Check: k = 6.5 gives [6.5, 3, −2] · [4, −1, 6.5] = 26 − 3 − 13 = 10. ✓
Worked exampleExample 5: The two formulas agree
Let u = [4, 0] and v = [3, 3]. Compute u · v with both formulas.
- Cartesian: 4(3) + 0(3) = 12.
- Geometric: |u| = 4 and |v| = √(9 + 9) = 3√2. u lies along the x-axis and v makes 45° with it, so θ = 45°.
- |u||v| cos θ = 4(3√2)(√2/2) = 12(2)/2 = 12.
Both formulas give the same dot product. The Cartesian one is faster when you know components; the geometric one is faster when you know lengths and the angle.Length from the dot product
A vector dotted with itself gives its length squared: v · v = v₁² + v₂² + v₃² = |v|². So |v| = √(v · v). You will use this again and again.
The dot product outside geometry
The formula "multiply matching entries and add" appears whenever you combine lists of numbers. At a store, if q = [3, 2, 5] is how many of three items you buy and p = [1.50, 4.00, 0.80] is their prices in dollars, then q · p = 4.50 + 8.00 + 4.00 = $16.50 is your bill before tax. Spreadsheets have a built-in function for this, and in university courses on linear algebra, statistics and machine learning, dot products of very long vectors are used everywhere.
Just for funRiddle: what do you get when you multiply two vectors together, component by component, and add up the pieces?
A number so plain it doesn't even know which way it's facing.
Hands-on activityYour grocery receipt is a dot product
You need: a recent grocery or pharmacy receipt (or a flyer), paper, a pencil and a calculator.
- Choose 4 to 6 items from the receipt. Write their quantities as a vector q and their unit prices as a vector p, in the same order.
- Compute q · p by multiplying matching components and adding.
- Compare with the receipt's total for those items (before tax).
- Now suppose every price goes up 10%. The new price vector is 1.1p. Compute q · (1.1p) and compare it with 1.1(q · p).
What to look for: step 2 should match the receipt exactly (items sold by weight already show a price for the amount bought; use quantity 1 for those). In step 4 the two answers are equal. That is the scalar-multiple property you will prove in the next lesson.
Your turn
3Find [1, −2, 4] · [3, 5, 2].
4Find (3i − j + 2k) · (−i + 4j + k).
5Find [0, 7, −3] · [5, 0, 0]. What does the answer tell you?
0 + 0 + 0 = 0. The vectors are perpendicular.
6Find k if [2, k, −1] · [k, 3, 4] = 11.
2k + 3k − 4 = 11, so 5k = 15 and k = 3.
7For a = [1, 2, 2], find a · a and use it to find |a|.
1 + 4 + 4 = 9, so |a| = √9 = 3.
More practice: on your own
1Let u = [2, −3, 1], v = [4, 1, −5] and w = [−1, 2, 2]. Find u · v, u · w and u · (v + w). What do you notice?
u · v = 8 − 3 − 5 = 0; u · w = −2 − 6 + 2 = −6; v + w = [3, 3, −3], so u · (v + w) = 6 − 9 − 3 = −6. Notice u · (v + w) = u · v + u · w (the distributive property).
2A hockey team buys 12 pucks at $2.50, 4 sticks at $18.00 and 30 rolls of tape at $1.25. Write the purchase as a dot product and find the cost.
[12, 4, 30] · [2.50, 18.00, 1.25] = 30 + 72 + 37.50 = $139.50.
3A(1, 2, −1), B(4, 0, 3) and C(2, 5, 1) are points. Find AB · AC.
AB = [3, −2, 4], AC = [1, 3, 2]. Dot product: 3 − 6 + 8 = 5.
4Find all values of k for which [k, k, 1] · [k, −2, −3] = 0.
k² − 2k − 3 = 0, so (k − 3)(k + 1) = 0: k = 3 or k = −1.
5Check that both formulas agree for u = [2, 2] and v = [0, 3].
Cartesian: 0 + 6 = 6. Geometric: |u| = 2√2, |v| = 3, and u makes 45° with the x-axis while v is on the y-axis, so θ = 45°: 2√2 × 3 × √2/2 = 6. Both give 6.
Challenge
1Prove the three-space formula u · v = u₁v₁ + u₂v₂ + u₃v₃ from the cosine law.
The cosine law in the triangle formed by u, v and u − v gives |u − v|² = |u|² + |v|² − 2|u||v| cos θ. The left side is (u₁ − v₁)² + (u₂ − v₂)² + (u₃ − v₃)² = (u₁² + u₂² + u₃²) + (v₁² + v₂² + v₃²) − 2(u₁v₁ + u₂v₂ + u₃v₃) = |u|² + |v|² − 2(u₁v₁ + u₂v₂ + u₃v₃). Comparing, |u||v| cos θ = u₁v₁ + u₂v₂ + u₃v₃. ∎
2Find every vector [x, y] with length 5 whose dot product with [3, 4] is 25.
3x + 4y = 25 and x² + y² = 25. From the first, y = (25 − 3x)/4. Substitute: 16x² + (25 − 3x)² = 400, so 25x² − 150x + 225 = 0, which is x² − 6x + 9 = 0, so x = 3 and y = 4. Only [3, 4]. This makes sense: 25 = 5 × 5 × cos θ forces cos θ = 1, so the vector points the same way as [3, 4].
3Let a = [4, 1, −2] and b = [1, 1, 1]. Find t so that (a + tb) · b = 0.
a + tb = [4 + t, 1 + t, −2 + t]. Dot with b: (4 + t) + (1 + t) + (−2 + t) = 3 + 3t = 0, so t = −1. (Then a − b = [3, 0, −3] is perpendicular to b. This idea becomes the projection in lesson 5.)
Check your understandingQuiz
1. What is [3, −1] · [2, 5]?
2. What is [1, 0, −2] · [4, 3, 1]?
3. What is (2i + 3k) · (i − j + k)?
4. v = [2, −1, 2]. What is v · v?
5. For which value of k is [k, 2] · [3, k] = 15?
6. Which tool is used to prove that the geometric and Cartesian dot products are equal?
For parents and teachersBig idea (C2.4): for Cartesian vectors, u · v = u₁v₁ + u₂v₂ (+ u₃v₃ in three-space): multiply matching components and add. It gives the same number as |u||v| cos θ, which is proved with the cosine law.
How to help: Read out two vectors and ask for the dot product mentally. The grocery-receipt activity is a good way to see that "multiply and add" is a natural operation.
Common difficulties:
- Writing the answer as a vector, like [6, −5], instead of adding the products.
- Sign slips with negative components, especially (−3)(−2) = +6.
- Mixing up i · j (which is 0) with i · i (which is 1).
- Expanding (u₁ − v₁)² incorrectly in the proof; remind them it is u₁² − 2u₁v₁ + v₁².