• Foundation
  • About 20 min
  • 5 practice questions

Scalar (dot) product and projection

Define the scalar product, compute it from components, find the angle between vectors, test for perpendicularity, find the projection of one vector on another, and use the Cauchy-Schwarz and triangle inequalities.

If something looks wrong, please tell us.

There are two useful ways to multiply two vectors. One gives a number (a scalar) and the other gives a vector. The scalar product measures how much two vectors point the same way; in physics, the work done by a force F in a displacement d is F · d. This lesson develops the scalar product and its main use, finding angles and projections.

Definition

The scalar (dot) product of two non-zero vectors a and b is a · b = |a| |b| cos θ, where θ (0 ≤ θ ≤ π) is the angle between them. If a = 0 or b = 0, θ is not defined and we set a · b = 0.

  1. a · b is a real number, positive when θ is acute, negative when θ is obtuse.
  2. For non-zero a and b, a · b = 0 if and only if a and b are perpendicular.
  3. If θ = 0, a · b = |a| |b|; in particular a · a = |a|². If θ = π, a · b = −|a| |b|.
  4. For the unit vectors: î · î = ĵ · ĵ = k̂ · k̂ = 1 and î · ĵ = ĵ · k̂ = k̂ · î = 0.
  5. The angle between non-zero vectors is given by cos θ = (a · b)/(|a| |b|).
  6. The scalar product is commutative: a · b = b · a.

Two further properties hold: it is distributive, a · (b + c) = a · b + a · c, and (λa) · b = λ(a · b) = a · (λb). Expanding (a₁î + a₂ĵ + a₃k̂) · (b₁î + b₂ĵ + b₃k̂) term by term and using item 4, all the cross terms vanish, which gives the working formula:

a · b = |a| |b| cos θ = a₁b₁ + a₂b₂ + a₃b₃. Non-zero vectors are perpendicular exactly when a · b = 0.

Projection of a vector on a line

If a makes an angle θ with a directed line l, the projection of a on l is |a| cos θ (a scalar; negative if θ is obtuse), and the projection vector is (|a| cos θ) p̂, where p̂ is the unit vector along l. If l is the direction of a vector b, then |a| cos θ = (a · b)/|b| = a · b̂. In particular, the components a₁, a₂, a₃ of a are its projections on the x-, y- and z-axes. If θ = π/2 the projection is zero.

Angle and projection from components

  1. Compute a · b = a₁b₁ + a₂b₂ + a₃b₃
  2. Compute |a| and |b|
  3. Angle: cos θ = a · b / (|a| |b|)
  4. Projection of a on b: a · b / |b|

Worked examples

Worked example 1: angle between two vectors

Find the angle between a = î + 2ĵ + 2k̂ and b = 2î − ĵ + 2k̂. a · b = 2 − 2 + 4 = 4; |a| = √(1 + 4 + 4) = 3; |b| = √(4 + 1 + 4) = 3. So cos θ = 4/9 and θ = cos⁻¹(4/9).

Worked example 2: perpendicular vectors

Find λ so that 2î + λĵ + k̂ is perpendicular to î − 2ĵ + 3k̂. Their dot product must be zero: 2(1) + λ(−2) + 1(3) = 0, so 5 − 2λ = 0 and λ = 5/2.

Worked example 3: projection

Find the projection of a = 3î − ĵ + 4k̂ on b = 2î + 3ĵ − 6k̂. a · b = 6 − 3 − 24 = −21 and |b| = √(4 + 9 + 36) = 7. Projection = −21/7 = −3. The negative sign tells us the angle between a and b is obtuse.

Worked example 4: magnitudes without components

If |a| = 3, |b| = 4 and a · b = 6, find |a + b|. Use |a + b|² = (a + b) · (a + b) = |a|² + 2 a · b + |b|² = 9 + 12 + 16 = 37, so |a + b| = √37. In the same way, (a + b) · (a − b) = |a|² − |b|² = 9 − 16 = −7.

Worked example 5: a right angle

Show that A(1, 1, 1), B(2, 3, 1) and C(3, 0, 1) form a right-angled triangle. AB = î + 2ĵ and AC = 2î − ĵ. AB · AC = 2 − 2 + 0 = 0, so AB ⊥ AC and the angle at A is 90°.

Two inequalities

Cauchy-Schwarz inequality: |a · b| ≤ |a| |b|, because |a · b| = |a| |b| |cos θ| and |cos θ| ≤ 1. Triangle inequality: |a + b| ≤ |a| + |b|. Proof: |a + b|² = |a|² + 2 a · b + |b|² ≤ |a|² + 2|a| |b| + |b|² = (|a| + |b|)², using Cauchy-Schwarz. Equality in the triangle inequality for AB + BC = AC means |AC| = |AB| + |BC|, which happens exactly when A, B, C are collinear (with B between A and C).

Key takeaways

  • a · b = |a| |b| cos θ = a₁b₁ + a₂b₂ + a₃b₃, a scalar.
  • a · b = 0 for non-zero vectors means they are perpendicular.
  • a · a = |a|², which is how magnitudes like |a + b| are found.
  • Projection of a on b = a · b/|b|; its sign shows whether the angle is acute or obtuse.
  • |a · b| ≤ |a| |b| and |a + b| ≤ |a| + |b|.

Check your understanding

  1. 1. Find a · b for a = 2î − ĵ + 3k̂ and b = î + 4ĵ − k̂.

    1. 5
    2. −5
    3. 1
    4. −1
    Show answer

    Answer: B. a · b = (2)(1) + (−1)(4) + (3)(−1) = 2 − 4 − 3 = −5.

  2. 2. If |a| = 2, |b| = 3 and a · b = 3, what is the angle between a and b?

    1. π/6
    2. π/4
    3. π/3
    4. π/2
    Show answer

    Answer: C. cos θ = a · b/(|a| |b|) = 3/6 = 1/2, so θ = π/3.

  3. 3. For what value of λ is î + λĵ + 2k̂ perpendicular to 3î − ĵ + k̂?

    1. −5
    2. 1
    3. −1
    4. 5
    Show answer

    Answer: D. The dot product must be 0: 3 − λ + 2 = 0, so λ = 5.

  4. 4. What is the projection of a = î + ĵ + k̂ on b = 2î − 2ĵ + k̂?

    1. 1/3
    2. 1
    3. √3
    4. 1/9
    Show answer

    Answer: A. a · b = 2 − 2 + 1 = 1 and |b| = √(4 + 4 + 1) = 3. Projection = a · b/|b| = 1/3.

  5. 5. Assertion (A): If a · b = 0 for two non-zero vectors a and b, then a and b are perpendicular. Reason (R): a · b = |a| |b| cos θ with 0 ≤ θ ≤ π, and in this range cos θ = 0 only when θ = π/2.

    1. Both A and R are true, and R is the correct explanation of A
    2. Both A and R are true, but R is not the correct explanation of A
    3. A is true, but R is false
    4. A is false, but R is true
    Show answer

    Answer: A. Since |a| and |b| are non-zero, a · b = 0 forces cos θ = 0, and R says this means θ = π/2. So R is exactly why A holds.

Sign in to keep track of the lessons you finish.

Next lesson → Vector (cross) product and areas

Privacy · Terms · Refunds · Delivery