Grade by Grade
C. Geometry and Algebra of Vectors · Dot and Cross Products

The 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.

ab24×8−10×03−5×−15matchadda · b = 8 + 0 − 15 = −7
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.

xy123456712345u = [6, 1]v = [2, 4]u − vθCosine law in the triangle:|u − v|² = |u|² + |v|² − 2|u||v| cos θExpand both sides in components;everything cancels exceptu · v = u₁v₁ + u₂v₂
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 example

Example 1: Two-space

Find [3, −2] · [4, 5].

  1. Multiply matching components: 3 × 4 = 12 and (−2) × 5 = −10.
  2. Add: 12 + (−10) = 2.

2. It is positive, so the angle between the vectors is acute.

Worked example

Example 2: Three-space

Find a · b for a = [2, −1, 3] and b = [4, 0, −5].

  1. Products: 2 × 4 = 8, (−1) × 0 = 0, 3 × (−5) = −15.
  2. Sum: 8 + 0 − 15 = −7.

a · b = −7, so the angle between a and b is obtuse.

Worked example

Example 3: Unit-vector form

Find (2i − 3j + k) · (i + 4j − 2k).

  1. Read the components: [2, −3, 1] and [1, 4, −2].
  2. Products: 2(1) = 2, (−3)(4) = −12, (1)(−2) = −2.
  3. Sum: 2 − 12 − 2 = −12.

−12

Worked example

Example 4: Solving for an unknown component

Find k so that [k, 3, −2] · [4, −1, k] = 10.

  1. Dot product: 4k + (3)(−1) + (−2)(k) = 4k − 3 − 2k = 2k − 3.
  2. Set it equal to 10: 2k − 3 = 10, so 2k = 13.
  3. Check: k = 6.5 gives [6.5, 3, −2] · [4, −1, 6.5] = 26 − 3 − 13 = 10. ✓

k = 6.5

Worked example

Example 5: The two formulas agree

Let u = [4, 0] and v = [3, 3]. Compute u · v with both formulas.

  1. Cartesian: 4(3) + 0(3) = 12.
  2. Geometric: |u| = 4 and |v| = √(9 + 9) = 3√2. u lies along the x-axis and v makes 45° with it, so θ = 45°.
  3. |u||v| cos θ = 4(3√2)(√2/2) = 12(2)/2 = 12.

Both give 12.

xy123451234u = [4, 0]v = [3, 3]45°Cartesian: 4(3) + 0(3) = 12Geometric: (4)(3√2) cos 45°= 12√2 × √2/2 = 12Same answer ✓
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 fun

Riddle: 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 activity

Your grocery receipt is a dot product

You need: a recent grocery or pharmacy receipt (or a flyer), paper, a pencil and a calculator.

  1. 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.
  2. Compute q · p by multiplying matching components and adding.
  3. Compare with the receipt's total for those items (before tax).
  4. 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

1

Find [2, 5] · [3, −1].

2

Find [−4, 3] · [2, 6].

3

Find [1, −2, 4] · [3, 5, 2].

4

Find (3i − j + 2k) · (−i + 4j + k).

5

Find [0, 7, −3] · [5, 0, 0]. What does the answer tell you?

6

Find k if [2, k, −1] · [k, 3, 4] = 11.

7

For a = [1, 2, 2], find a · a and use it to find |a|.

More practice: warm-up

1

[1, 1] · [1, 1]

2

[2, 0] · [0, 5]

3

[3, 4] · [3, 4]

4

[1, 2, 3] · [1, 1, 1]

5

[−1, 0, 2] · [4, 9, 3]

More practice: on your own

1

Let 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?

2

A 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.

3

A(1, 2, −1), B(4, 0, 3) and C(2, 5, 1) are points. Find AB · AC.

4

Find all values of k for which [k, k, 1] · [k, −2, −3] = 0.

5

Check that both formulas agree for u = [2, 2] and v = [0, 3].

Challenge

1

Prove the three-space formula u · v = u₁v₁ + u₂v₂ + u₃v₃ from the cosine law.

2

Find every vector [x, y] with length 5 whose dot product with [3, 4] is 25.

3

Let a = [4, 1, −2] and b = [1, 1, 1]. Find t so that (a + tb) · b = 0.

Check your understanding

Quiz

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 teachers

Big 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₁².