← Back to Math 005C

12.3 The Dot Product: Class Notes

12.3a

Recall

Scalar multiplication: ca→=⟨ca1,ca2,ca3⟩

There are two types of vector multiplication: the dot product and the cross product.

Definitions of the dot product: Let 𝐚=⟨a1,a2,a3⟩ and 𝐛=⟨b1,b2,b3⟩.

𝐚⋅𝐛=a1b1+a2b2+a3b3

Exercise

Find the dot product 𝐚⋅𝐛 of 𝐚=⟨2,−4,7⟩ and 𝐛=⟨−12,5,13⟩.

Solution

Multiply matching components and add: 2⋅(−12)=−1, (−4)⋅5=−20, and 7⋅13=91.

a→⋅b→=−1−20+91a→⋅b→=70

Or, written with the standard basis vectors:

(2ı^−4ȷ^+7k^)⋅(−12ı^+5ȷ^+13k^)=70

Answer: a→⋅b→=70

Note: the result of the dot product is a scalar (or a real-valued variable expression), NOT A VECTOR.

𝐚⋅𝐛=|𝐚||𝐛|cos⁡θ, where θ is the angle between 𝐚 and 𝐛.

Exercise

Find the angle between 𝐚 and 𝐛 from the previous exercise.

Solution

Find both magnitudes: |a→|=4+16+49=69 and |b→|=14+25+169=194.25. With a→⋅b→=70:

cos⁡θ=7069194.25⇒θ≈52.8∘

So θ≈52.8∘ is the angle between a→ and b→.

Answer: θ≈52.8∘

To connect the two definitions, let a→ and b→ share an initial point in ℝ3, and let Q and P be their terminal points, respectively.

Vectors a and b from a common point with angle theta, and the vector PQ = a minus b joining their heads

Left: a→ (length |a→|) and b→ (length |b→|) start at the same point with angle θ between them; a→ ends at Q and b→ ends at P. The third side of the triangle is PQ→=a→−b→, with length |a→−b→|. Right (the Law of Cosines, in orange): a triangle with vertices A, B, C and opposite sides a, b, c satisfies c2=a2+b2−2abcos⁡C.

The third side of the triangle is PQ→=a→−b→, with length |a→−b→|. The Law of Cosines says that a triangle with sides a, b, c and angle C opposite c satisfies c2=a2+b2−2abcos⁡C. Here the angle θ is opposite the side a→−b→.

By the Law of Cosines,

|a→−b→|2=|a→|2+|b→|2−2|a→||b→|cos⁡θ

Write each squared length in components:

(a1−b1)2+(a2−b2)2+(a3−b3)2=a12+a22+a32+b12+b22+b32−2|a→||b→|cos⁡θ

Expand each square on the left, for example (a1−b1)2=a12−2a1b1+b12. The squares a12,…,b32 appear on both sides and cancel, leaving

−2(a1b1+a2b2+a3b3)=−2|a→||b→|cos⁡θ

Divide both sides by −2:

|a→||b→|cos⁡θ=a1b1+a2b2+a3b3=a→⋅b→

In ℝ2 the sum stops at a1b1+a2b2; in ℝ3 it is a1b1+a2b2+a3b3.

Orthogonal vectors

If the angle between 𝐚 and 𝐛 is θ=90∘, then 𝐚⋅𝐛=0.

Two vectors that meet at a right angle are said to be orthogonal.

Properties of the Dot Product

If 𝐚, 𝐛, and 𝐜 are vectors in V3 and c is a scalar, then

𝐚⋅𝐛=𝐛⋅𝐚
𝐚⋅𝐚=|𝐚|2
𝐚⋅(𝐛+𝐜)=𝐚⋅𝐛+𝐚⋅𝐜
𝟎⋅𝐚=0
(c𝐚)⋅𝐛=c(𝐚⋅𝐛)=𝐚⋅(c𝐛)

12.3b

Direction cosines: let α, β, and γ be angles made between a vector 𝐚=⟨a1,a2,a3⟩ and the x-, y-, and z-axes, respectively.

Vector a with its direction angles alpha, beta, gamma to the x-, y-, and z-axes

The vector a→=⟨a1,a2,a3⟩ drawn from the origin, with the unit vectors ı^=⟨1,0,0⟩, ȷ^, and k^ along the axes. The angle from a→ to the x-axis is α, to the y-axis is β, and to the z-axis is γ.

Recall

The angle between two vectors satisfies cos⁡θ=a→⋅b→|a→||b→|.

If we replace b→ with ı^ (whose length is 1), we get

cos⁡α=a→⋅ı^|a→||ı^|=a1|a→|

Likewise,

cos⁡β=a→⋅ȷ^|a→||ȷ^|andcos⁡γ=a→⋅k^|a→||k^|

cos⁡α=a1|𝐚|,   cos⁡β=a2|𝐚|,   cos⁡γ=a3|𝐚|

These are called the direction cosines. Note that cos2⁡α+cos2⁡β+cos2⁡γ=1.

We can also represent a→ as

a→=⟨a1,a2,a3⟩=⟨|a→|cos⁡α,|a→|cos⁡β,|a→|cos⁡γ⟩a→=|a→|⟨cos⁡α,cos⁡β,cos⁡γ⟩

⇒a→|a→|=⟨cos⁡α,cos⁡β,cos⁡γ⟩

so ⟨cos⁡α,cos⁡β,cos⁡γ⟩ is a unit vector in the direction of a→.

12.3c

Scalar projection of 𝐛 onto 𝐚

Components of b along the axes, and the projection of b onto a with length |b| cos theta

Left: a vector b→ at angle θ to the positive x-axis has horizontal part |b→|cos⁡θ along the x-axis and vertical part |b→|sin⁡θ along the y-axis. Right: a→ and b→ share a tail with angle θ between them. A dashed segment drops from the head of b→ perpendicular to a→; the arrow along a→ from the common tail to the foot of that segment is the projection of b→ onto a→, with length |b→|cos⁡θ.

In the plane, b→=⟨|b→|cos⁡θ,|b→|sin⁡θ⟩, where θ is the angle from the x-axis. In the same way, when θ is the angle between b→ and a→, the projection of b→ onto a→ has length |b→|cos⁡θ.

The length of the projection vector is the scalar projection of b→ onto a→ and is denoted compa→b→ (the component of b→ in the direction of a→).

comp𝐚𝐛=𝐚⋅𝐛|𝐚|

Recall

a→⋅b→=|a→||b→|cos⁡θ, so a→⋅b→|a→|=|b→|cos⁡θ.

Vector projection of 𝐛 onto 𝐚

The projection vector has the same direction as a→ and length compa→b→. This is written

proja→b→=a→⋅b→|a→|a→|a→|=a→⋅b→|a→|2a→

The first factor, the length, is a→⋅b→|a→|; the second, the unit vector (direction), is a→|a→|. Together they give the vector projection of b→ onto a→.

proj𝐚𝐛=𝐚⋅𝐛|𝐚|2𝐚

12.3d

Exercise

Find the scalar and vector projections of 𝐛 onto 𝐚.
𝐚=⟨−1,4,8⟩, 𝐛=⟨12,1,2⟩

Solution

Scalar projection: compa→b→=a→⋅b→|a→|   Vector projection: proja→b→=a→⋅b→|a→|2a→

Both are taken onto a→, so both use the length of a→:

a→⋅b→=−12+4+16=8,|a→|=1+16+64=9

a) compa→b→=89

Answer: compa→b→=89

b)

proja→b→=881⟨−1,4,8⟩proja→b→=⟨−881,3281,6481⟩

Answer: proja→b→=⟨−881,3281,6481⟩