M5.6.4 Chapter 4

The scalar product

How can you find the angle between two arrows from their numbers alone?

Your guess

Pick one before you read on. It is fine to be wrong.

Your guess
  • You picked A. Read on. At the end, the chapter comes back to your guess.

  • You picked B. Read on. At the end, the chapter comes back to your guess.

  • You picked C. Read on. At the end, the chapter comes back to your guess.

By the end you can

  • Find the angle between two vectors with the scalar product
  • Show that two vectors are perpendicular

There are two ways to multiply vectors, and this chapter has the first. The scalar product of two vectors a and b is written a · b and said "a dot b". Multiply the matching parts and add the results. In a plane, a · b = a₁b₁ + a₂b₂. In space, there is a third term, a₃b₃. The answer is a single number, a scalar, not a vector.

Worked example

Find a · b for a = (3, 1) and b = (1, 2), and find (2, −1, 2) · (1, 2, 2).

  1. Multiply the matching parts: 3 × 1 = 3 and 1 × 2 = 2.
  2. Add them: 3 + 2 = 5. So a · b = 5.
  3. In space, there are three terms: 2 + (−2) + 4.
  4. The total is 4. So (2, −1, 2) · (1, 2, 2) = 4.

Answer: 5 and 4

The scalar product has a second form that gives angles. Draw a and b from one point. Let θ be the angle between them, with 0° ≤ θ ≤ 180°. Then a · b = |a||b| cos θ. Here is why. The two vectors and the vector a − b make a triangle. The cosine rule for it says |a − b|² = |a|² + |b|² − 2|a||b| cos θ.

A grid with the x axis x and the y axis y. A triangle with a corner at the origin. The arrow a runs from the origin to (4, 1) and the arrow b runs from the origin to (2, 3). A dashed arrow labelled a − b joins the end of b to the end of a. The three sides are a, b and a − b.−112345−112340xyaba − b
The vectors a and b and the vector a − b are the three sides of one triangle. The cosine rule works on this triangle.

Now work out |a − b|² a second way, from the parts: (a₁ − b₁)² + (a₂ − b₂)². Multiplying out, this is a₁² + a₂² + b₁² + b₂² − 2(a₁b₁ + a₂b₂), which is |a|² + |b|² − 2(a · b). The two results agree when 2|a||b| cos θ = 2(a · b). So a · b = |a||b| cos θ, and cos θ = (a · b) ÷ (|a||b|).

Worked example

Find the angle between a = (3, 1) and b = (1, 2).

  1. a · b = 3 × 1 + 1 × 2 = 5.
  2. |a| = √(3² + 1²) = √10, and |b| = √(1² + 2²) = √5.
  3. cos θ = 5 ÷ (√10 × √5) = 5 ÷ √50 ≈ 0.7071.
  4. θ = cos⁻¹(0.7071) ≈ 45°.

Answer: 45°

Two arrows start at the point O. The arrow named a points right and slightly up, to (3, 1). The arrow named b points up and to the right, to (1, 2). The angle between them is marked and labelled 45°.45°abO
The vectors (3, 1) and (1, 2) drawn from one point, with the angle 45° between them.

Always draw both vectors from the same point before you read an angle. If you put b at the end of a, the angle at the joint is not the angle between them. It is 180° minus the angle between them.

Worked example

Find the angle between a = (2, −1, 2) and b = (1, 2, 2).

  1. a · b = 2 + (−2) + 4 = 4.
  2. |a| = √(2² + (−1)² + 2²) = √9 = 3. Also |b| = √9 = 3.
  3. cos θ = 4 ÷ (3 × 3) = 4 ÷ 9.
  4. θ = cos⁻¹(4 ÷ 9) ≈ 63.6°.

Answer: 63.6°

Now look at the sign of a · b. Since |a| and |b| are positive, the sign of a · b is the sign of cos θ. A positive scalar product means an acute angle, below 90°. A negative one means an obtuse angle, above 90°. And a · b = 0 means cos θ = 0, so θ = 90°. Two non-zero vectors are perpendicular exactly when a · b = 0.

Two arrows start at the point O. The arrow named a points up and to the right, to (3, 2). The arrow named b points up and to the left, to (-2, 3). A small square marks the right angle between them, labelled 90°.90°abO
(3, 2) · (−2, 3) = −6 + 6 = 0, so the vectors are at right angles. The small square marks 90°.

Worked example

Find k so that (k, 3, 2) and (4, −2, −1) are perpendicular.

  1. The vectors are perpendicular when their scalar product is 0.
  2. (k, 3, 2) · (4, −2, −1) = 4k + 3 × (−2) + 2 × (−1).
  3. That is 4k − 6 − 2, which is 4k − 8.
  4. Set it equal to 0: 4k = 8.
  5. So k = 2.

Answer: k = 2

The scalar product has rules that you can check with numbers. It does not matter in which order: a · b = b · a. It spreads over a sum: a · (b + c) = a · b + a · c. A number can move in or out: (ma) · b = m(a · b). And a · a = |a|², because the angle between a vector and itself is 0° and cos 0° = 1.

The same idea gives the length of a shadow. Shine a torch straight down on a table. The shadow of the vector b on the line of a has length |b| cos θ. Since a · b = |a| × |b| cos θ, the shadow is (a · b) ÷ |a|. This length is the projection of b on a.

Two arrows start at the point O. The arrow named a points right and slightly up, to (4, 1). The arrow named b points up and to the right, to (2, 3). A dashed line drops from the end of b to the line of a and meets it at a right angle at the point F. The angle between a and b is labelled θ. The part of a from O to F is the shadow of b.θabOF
The shadow of b on a is OF. Its length is |b| cos θ = (a · b) ÷ |a| = 11 ÷ √17 ≈ 2.67.

Worked example

Find the length of the shadow of b = (2, 3) on the line of a = (4, 1).

  1. a · b = 4 × 2 + 1 × 3 = 11.
  2. |a| = √(4² + 1²) = √17, which is 4.123.
  3. The shadow is (a · b) ÷ |a| = 11 ÷ 4.123 ≈ 2.67.

Answer: 2.67

See it three ways

With things

Hold a pencil at a slant above a table and shine a torch straight down on it from above. Its shadow lies on the table. The more tilted the pencil is, the shorter the shadow, and a pencil standing upright has almost no shadow.

As a picture

Two arrows start at the point O. The arrow named a points right and slightly up, to (4, 1). The arrow named b points up and to the right, to (2, 3). A dashed line drops from the end of b to the line of a and meets it at a right angle at the point F. The angle between a and b is labelled θ.θabOF

In words

The scalar product is the length of a times the length of the shadow of b on a. It is zero when the shadow has no length, which happens when the vectors are at right angles.

In symbols

a · b = a₁b₁ + a₂b₂ + a₃b₃ = |a||b| cos θ.

Try it

Check the angle with a protractor

You need: squared paper, a ruler, a protractor, a pencil.

  1. Mark a point O near the left of the paper. Draw an arrow from O, 3 squares across and 1 up. Call it a.
  2. From O, draw a second arrow, 1 square across and 2 up. Call it b.
  3. Measure the angle between the two arrows with the protractor.
  4. Work out a · b, |a| and |b|, and then cos⁻¹ of a · b ÷ (|a||b|) with a calculator. Compare.

What you will see: The protractor reads 45°, and so does the calculation. The numbers alone were enough to find the angle.

If you cannot try it, this is what happens.
A table with the heads quantity and value. The rows read a · b and 5, |a||b| and 7.07, and angle and 45°.quantityvaluea · b5|a||b|7.07angle45°

A wrong idea many people have

The scalar product of two vectors is a vector.

Why it feels right: You are combining two vectors, and the sum or difference of two vectors is a vector.

The test that breaks it: Work out (3, 1) · (1, 2). You get 3 × 1 + 1 × 2 = 5. That is one number, with no direction.

What is true: The scalar product takes two vectors and gives a scalar. That is why it has "scalar" in its name. The answer has a size and a sign, and no direction.

A wrong idea many people have

To find the angle between two vectors, put one at the end of the other.

Why it feels right: This is how you add vectors, so the picture of two arrows joined end to end feels natural.

The test that breaks it: Take a = (1, 0) and b = (1, 1). They are 45° apart when drawn from one point. Joined head to tail, the path goes 1 across and then 1 across and 1 up, and the angle inside the corner is 135°, not 45°.

What is true: The angle between two vectors is measured with their tails together, as in the formula. If you join them head to tail, the angle at the corner is 180° minus the angle between them.

Key words

scalar product
a · b = a₁b₁ + a₂b₂ + a₃b₃ = |a||b| cos θ, a single number. Also called the dot product.
perpendicular
at right angles. Two non-zero vectors are perpendicular when their scalar product is 0.
projection
the length of the shadow of one vector on the line of another, (a · b) ÷ |a|.
acute
an angle below 90°, which has a positive scalar product.
obtuse
an angle between 90° and 180°, which has a negative scalar product.

Back to your guess

The answer is C: The vectors (2, 3) and (3, −2) are at right angles.

Multiply the across parts and the up parts, and add: 2 × 3 + 3 × (−2) = 0. A total of 0 is the sign of a right angle. This sum is called the scalar product, and it gives angles from numbers alone.

Check yourself

Try each one before you look. A wrong answer tells you where to go next.

  1. What is (2, −3) · (4, 5)?

    Tap your answer.
    1. Not this one. You multiplied the matching parts but did not add them. The scalar product is a single number. Read this page again. Try another.

    2. Yes, that is right. 2 × 4 + (−3) × 5 = 8 + (−15) = −7.

    3. Not this one. You lost the minus sign. The two products are 8 and −15. The second is larger in size, so the total is negative. Read this page again. Try another.

    4. Not this one. You added all four numbers. Multiply the matching parts first: first with first, second with second. Read this page again. Try another.

    See the answer

    −7

    2 × 4 + (−3) × 5 = 8 + (−15) = −7.

    • If you chose A: You multiplied the matching parts but did not add them. The scalar product is a single number. Read this page again.
    • If you chose C: You lost the minus sign. The two products are 8 and −15. The second is larger in size, so the total is negative. Read this page again.
    • If you chose D: You added all four numbers. Multiply the matching parts first: first with first, second with second. Read this page again.
  2. What is the angle between (4, 3) and (1, 2), to 1 decimal place?

    Tap your answer.
    1. Yes, that is right. a · b = 10, |a| = 5 and |b| = √5 ≈ 2.236. cos θ = 10 ÷ (5 × 2.236) ≈ 0.8944, so θ ≈ 26.6°.

    2. Not this one. That is 90° minus the angle. You may have used sin instead of cos. Use cos θ = (a · b) ÷ (|a||b|). Read this page again. Try another.

    3. Not this one. That is cos θ. Take cos⁻¹ of it to get the angle. Read this page again. Try another.

    4. Not this one. The scalar product is not the angle. Divide it by |a||b|, and then take cos⁻¹. Read this page again. Try another.

    See the answer

    26.6°

    a · b = 10, |a| = 5 and |b| = √5 ≈ 2.236. cos θ = 10 ÷ (5 × 2.236) ≈ 0.8944, so θ ≈ 26.6°.

    • If you chose B: That is 90° minus the angle. You may have used sin instead of cos. Use cos θ = (a · b) ÷ (|a||b|). Read this page again.
    • If you chose C: That is cos θ. Take cos⁻¹ of it to get the angle. Read this page again.
    • If you chose D: The scalar product is not the angle. Divide it by |a||b|, and then take cos⁻¹. Read this page again.
  3. Which pair of vectors is perpendicular?

    Tap your answer.
    1. Not this one. The scalar product is −1, not 0, so these are not at right angles. Read this page again. Try another.

    2. Not this one. The scalar product is 20, not 0, so these are not at right angles. Read this page again. Try another.

    3. Not this one. The scalar product is 12, not 0, so these are not at right angles. Read this page again. Try another.

    4. Yes, that is right. (6, −4) · (2, 3) = 12 + (−12) = 0. A scalar product of 0 means the vectors are perpendicular. The other three pairs have scalar products −1, 20, 12.

    See the answer

    (6, −4) and (2, 3)

    (6, −4) · (2, 3) = 12 + (−12) = 0. A scalar product of 0 means the vectors are perpendicular. The other three pairs have scalar products −1, 20, 12.

    • If you chose A: The scalar product is −1, not 0, so these are not at right angles. Read this page again.
    • If you chose B: The scalar product is 20, not 0, so these are not at right angles. Read this page again.
    • If you chose C: The scalar product is 12, not 0, so these are not at right angles. Read this page again.
  4. The picture shows a = (4, 1) and b = (−2, 3) drawn from one point. Is a · b positive, zero or negative?

    Two arrows start at the point O. The arrow named a points right and slightly up, to (4, 1). The arrow named b points up and to the left, to (-2, 3). The angle between them is marked and labelled θ, and is more than a right angle.θabO
    Tap your answer.
    1. Not this one. A positive scalar product goes with an angle below 90°. This angle is larger than a right angle. Read this page again. Try another.

    2. Not this one. A scalar product of 0 goes with exactly 90°. The marked angle is larger than that. Read this page again. Try another.

    3. Yes, that is right. The angle θ is obtuse, and cos θ is negative for an obtuse angle. By the numbers, a · b = 4 × (−2) + 1 × 3 = −5.

    See the answer

    Negative

    The angle θ is obtuse, and cos θ is negative for an obtuse angle. By the numbers, a · b = 4 × (−2) + 1 × 3 = −5.

    • If you chose A: A positive scalar product goes with an angle below 90°. This angle is larger than a right angle. Read this page again.
    • If you chose B: A scalar product of 0 goes with exactly 90°. The marked angle is larger than that. Read this page again.
  5. From an earlier chapter

    What is the length of the vector (2, −3, 6)?

    Tap your answer.
    1. Not this one. You added the three parts. The length is the diagonal of a box, so use √(x² + y² + z²). Go to M5.6.3. Try another.

    2. Not this one. You did not take the square root. The sum of the squares is |v|². Go to M5.6.3. Try another.

    3. Yes, that is right. √(2² + (−3)² + 6²) = √(4 + 9 + 36) = √49 = 7.

    See the answer

    7

    √(2² + (−3)² + 6²) = √(4 + 9 + 36) = √49 = 7.

    • If you chose A: You added the three parts. The length is the diagonal of a box, so use √(x² + y² + z²). Go to M5.6.3.
    • If you chose B: You did not take the square root. The sum of the squares is |v|². Go to M5.6.3.
  6. Find (5, −2) · (3, 4).

    See the answer

    7

    5 × 3 + (−2) × 4 = 15 + (−8) = 7.

  7. The vectors (k, 6) and (3, −2) are perpendicular. Find k.

    See the answer

    4

    The scalar product must be 0: 3k + 6 × (−2) = 3k − 12 = 0. So 3k = 12 and k = 4.

  8. Find the angle between (2, 3, 6) and (1, −2, 2), in degrees to 1 decimal place.

    See the answer

    67.6

    a · b = 2 + (−6) + 12 = 8. |a| = 7 and |b| = 3. cos θ = 8 ÷ 21, so θ ≈ 67.6°.

  9. a · b = −8, |a| = 4 and |b| = 4. What is the angle between a and b?

    Tap your answer.
    1. Not this one. That is the angle for cos θ = +0.5. The scalar product is negative, so cos θ is negative and the angle is obtuse. Read this page again. Try another.

    2. Yes, that is right. cos θ = −8 ÷ (4 × 4) = −0.5. The angle with cosine −0.5 is 120°.

    3. Not this one. The cosine of this angle is not −0.5. Find cos θ = (a · b) ÷ (|a||b|), and then take cos⁻¹. Read this page again. Try another.

    See the answer

    120°

    cos θ = −8 ÷ (4 × 4) = −0.5. The angle with cosine −0.5 is 120°.

    • If you chose A: That is the angle for cos θ = +0.5. The scalar product is negative, so cos θ is negative and the angle is obtuse. Read this page again.
    • If you chose C: The cosine of this angle is not −0.5. Find cos θ = (a · b) ÷ (|a||b|), and then take cos⁻¹. Read this page again.

Keep it

Copy this into your exercise book.

a · b = a₁b₁ + a₂b₂ + a₃b₃ = |a||b| cos θ. cos θ = (a · b) ÷ (|a||b|). a · b = 0 means perpendicular. Positive means acute, negative means obtuse. Tails together.

Draw: Two arrows from one point with the angle θ between them, and a dashed shadow of one on the other.

Reading with a child? A short page for the adult: what this chapter teaches and three questions to ask.

No internet tomorrow? Save the whole book as one file (864 KB). It opens on any phone.