Math Core

Lesson 6.3 · Applications of Trigonometry

The dot product

You can add vectors and multiply them by scalars, but there is also a useful way to multiply two vectors together. The dot product turns two vectors into a single number, and that number tells you how closely the vectors point in the same direction. It gives you the angle between vectors, a quick test for perpendicular lines, and the physics formula for work.

Definition

Definition

Dot product

The dot product of u=⟨u1,u2⟩\mathbf{u} = \langle u_1, u_2 \rangle and v=⟨v1,v2⟩\mathbf{v} = \langle v_1, v_2 \rangle is the scalar

u⋅v=u1v1+u2v2.\mathbf{u} \cdot \mathbf{v} = u_1 v_1 + u_2 v_2.

Multiply matching components, then add.

The result is a number, not a vector. That is why the dot product is sometimes called the scalar product.

Worked example: Computing a dot product

Find ⟨3,4⟩⋅⟨−2,5⟩\langle 3, 4 \rangle \cdot \langle -2, 5 \rangle.

(3)(−2)+(4)(5)=−6+20=14.(3)(-2) + (4)(5) = -6 + 20 = 14.

The dot product follows familiar-looking rules. For vectors u\mathbf{u}, v\mathbf{v}, w\mathbf{w} and a scalar kk:

  • u⋅v=v⋅u\mathbf{u} \cdot \mathbf{v} = \mathbf{v} \cdot \mathbf{u}
  • u⋅(v+w)=u⋅v+u⋅w\mathbf{u} \cdot (\mathbf{v} + \mathbf{w}) = \mathbf{u} \cdot \mathbf{v} + \mathbf{u} \cdot \mathbf{w}
  • (ku)⋅v=k(u⋅v)(k\mathbf{u}) \cdot \mathbf{v} = k(\mathbf{u} \cdot \mathbf{v})
  • v⋅v=v12+v22=∥v∥2\mathbf{v} \cdot \mathbf{v} = v_1^2 + v_2^2 = \|\mathbf{v}\|^2

The last rule links the dot product to length, and it is the key to everything that follows.

The angle between two vectors

Place u\mathbf{u} and v\mathbf{v} tail to tail. They form two sides of a triangle whose third side is u−v\mathbf{u} - \mathbf{v}. The law of cosines from the first lesson in this unit says

∥u−v∥2=∥u∥2+∥v∥2−2∥u∥∥v∥cos⁡θ.\|\mathbf{u} - \mathbf{v}\|^2 = \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2 - 2\|\mathbf{u}\|\|\mathbf{v}\|\cos\theta.

Expanding the left side with the dot product rules gives ∥u∥2−2 u⋅v+∥v∥2\|\mathbf{u}\|^2 - 2\,\mathbf{u} \cdot \mathbf{v} + \|\mathbf{v}\|^2. Compare the two sides and cancel, and you are left with a beautiful formula.

Dot product and angle

If θ\theta is the angle between nonzero vectors u\mathbf{u} and v\mathbf{v} (with 0∘≤θ≤180∘0^\circ \le \theta \le 180^\circ), then

u⋅v=∥u∥ ∥v∥cos⁡θ,socos⁡θ=u⋅v∥u∥ ∥v∥.\mathbf{u} \cdot \mathbf{v} = \|\mathbf{u}\|\,\|\mathbf{v}\|\cos\theta, \qquad\text{so}\qquad \cos\theta = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{u}\|\,\|\mathbf{v}\|}.
Placed tail to tail, two vectors make an angle θ between 0° and 180°.

Because the lengths are always positive, the sign of the dot product matches the sign of cos⁡θ\cos\theta:

u⋅v\mathbf{u} \cdot \mathbf{v}Angle θ\theta
positiveacute (vectors point roughly the same way)
zero90∘90^\circ (perpendicular)
negativeobtuse (vectors point roughly opposite ways)

Worked example: Finding the angle

Find the angle between u=⟨2,1⟩\mathbf{u} = \langle 2, 1 \rangle and v=⟨−1,3⟩\mathbf{v} = \langle -1, 3 \rangle, to the nearest tenth of a degree.

u⋅v=−2+3=1,∥u∥=5,∥v∥=10.\mathbf{u} \cdot \mathbf{v} = -2 + 3 = 1, \qquad \|\mathbf{u}\| = \sqrt{5}, \qquad \|\mathbf{v}\| = \sqrt{10}.cos⁡θ=1510=150≈0.1414,θ≈81.9∘.\cos\theta = \frac{1}{\sqrt{5}\sqrt{10}} = \frac{1}{\sqrt{50}} \approx 0.1414, \qquad \theta \approx 81.9^\circ.

The dot product is small and positive, so the angle is acute but close to 90∘90^\circ, which matches.

Orthogonal vectors

Two vectors are orthogonal when the angle between them is 90∘90^\circ. Since cos⁡90∘=0\cos 90^\circ = 0, this happens exactly when the dot product is zero.

Orthogonality test

Nonzero vectors u\mathbf{u} and v\mathbf{v} are orthogonal if and only if u⋅v=0\mathbf{u} \cdot \mathbf{v} = 0.

This test needs no angles and no square roots, which makes it a fast way to check for right angles in coordinate geometry.

Worked example: Making vectors orthogonal

Find kk so that ⟨k,6⟩\langle k, 6 \rangle is orthogonal to ⟨3,−2⟩\langle 3, -2 \rangle.

Set the dot product to zero: 3k+6(−2)=03k + 6(-2) = 0, so 3k=123k = 12 and k=4k = 4. Check: ⟨4,6⟩⋅⟨3,−2⟩=12−12=0\langle 4, 6 \rangle \cdot \langle 3, -2 \rangle = 12 - 12 = 0.

Common mistake

The dot product of two vectors is a number, so you cannot "dot" three vectors in a row, and u⋅v=0\mathbf{u} \cdot \mathbf{v} = 0 does not mean either vector is zero. Also, don't confuse the dot product with component-by-component multiplication: ⟨3,4⟩⋅⟨−2,5⟩\langle 3, 4 \rangle \cdot \langle -2, 5 \rangle is 1414, not ⟨−6,20⟩\langle -6, 20 \rangle.

Projections

Often you want to know how much of one vector points along another, for example how much of gravity pulls a cart down a ramp. Shine a light perpendicular to v\mathbf{v} and look at the shadow that u\mathbf{u} casts on the line of v\mathbf{v}. That shadow is the projection of u\mathbf{u} onto v\mathbf{v}.

The projection of u onto v is the shadow of u on the line through v. The dashed segment meets that line at a right angle.

Projection formulas

The scalar projection (the signed length of the shadow) and the vector projection of u\mathbf{u} onto v\mathbf{v} are

compv u=u⋅v∥v∥,projv u=(u⋅v∥v∥2)v.\text{comp}_{\mathbf{v}}\,\mathbf{u} = \frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{v}\|}, \qquad \text{proj}_{\mathbf{v}}\,\mathbf{u} = \left(\frac{\mathbf{u} \cdot \mathbf{v}}{\|\mathbf{v}\|^2}\right)\mathbf{v}.

The scalar projection is ∥u∥cos⁡θ\|\mathbf{u}\|\cos\theta, which is the adjacent side of a right triangle with hypotenuse ∥u∥\|\mathbf{u}\|. The vector projection is that length times the unit vector v∥v∥\dfrac{\mathbf{v}}{\|\mathbf{v}\|}.

Worked example: Projecting one vector onto another

Find the vector projection of u=⟨6,2⟩\mathbf{u} = \langle 6, 2 \rangle onto v=⟨3,4⟩\mathbf{v} = \langle 3, 4 \rangle.

u⋅v=18+8=26,∥v∥2=9+16=25.\mathbf{u} \cdot \mathbf{v} = 18 + 8 = 26, \qquad \|\mathbf{v}\|^2 = 9 + 16 = 25.projv u=2625⟨3,4⟩=⟨3.12, 4.16⟩.\text{proj}_{\mathbf{v}}\,\mathbf{u} = \frac{26}{25}\langle 3, 4 \rangle = \langle 3.12,\ 4.16 \rangle.

Check: the leftover piece u−projv u=⟨2.88,−2.16⟩\mathbf{u} - \text{proj}_{\mathbf{v}}\,\mathbf{u} = \langle 2.88, -2.16 \rangle should be orthogonal to v\mathbf{v}, and indeed 3(2.88)+4(−2.16)=8.64−8.64=03(2.88) + 4(-2.16) = 8.64 - 8.64 = 0.

Work

In physics, the work done by a constant force F\mathbf{F} that moves an object along a displacement d\mathbf{d} counts only the part of the force in the direction of motion:

W=F⋅d=∥F∥ ∥d∥cos⁡θ.W = \mathbf{F} \cdot \mathbf{d} = \|\mathbf{F}\|\,\|\mathbf{d}\|\cos\theta.
Only the horizontal part of the pull, ‖F‖ cos 30°, moves the box along the floor.

Worked example: Pulling a box

You drag a box 20 m across a floor by pulling on a rope with a force of 50 N at 30∘30^\circ above the horizontal. How much work do you do?

W=(50)(20)cos⁡30∘=1000⋅32≈866.0 joules.W = (50)(20)\cos 30^\circ = 1000 \cdot \frac{\sqrt{3}}{2} \approx 866.0 \text{ joules}.

If you pulled horizontally, the work would be the full 10001000 joules. The angled pull wastes some effort lifting instead of moving.

Tip

If you already have components, use W=F1d1+F2d2W = F_1 d_1 + F_2 d_2. If you have magnitudes and an angle, use W=∥F∥∥d∥cos⁡θW = \|\mathbf{F}\|\|\mathbf{d}\|\cos\theta. Both compute the same dot product.

Practice

Practice 1

Find ⟨5,−2⟩⋅⟨3,7⟩\langle 5, -2 \rangle \cdot \langle 3, 7 \rangle.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Which pair of vectors is orthogonal?

Practice 3

Find kk so that ⟨2,k⟩\langle 2, k \rangle is orthogonal to ⟨6,−4⟩\langle 6, -4 \rangle.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

Find the angle between ⟨4,−3⟩\langle 4, -3 \rangle and ⟨5,12⟩\langle 5, 12 \rangle, to the nearest tenth of a degree.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Find the scalar projection of ⟨7,1⟩\langle 7, 1 \rangle onto ⟨3,4⟩\langle 3, 4 \rangle.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

Find the vector projection of ⟨4,6⟩\langle 4, 6 \rangle onto ⟨1,1⟩\langle 1, 1 \rangle. Enter it as (a,b)(a, b).

Enter a point like (2, -3)

Practice 7

A child pulls a wagon 100 ft along a flat path, holding the handle at 35∘35^\circ above the horizontal with a force of 40 lb. How much work is done, in foot-pounds, to the nearest tenth?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

A triangle has vertices A(0,0)A(0, 0), B(4,1)B(4, 1) and C(1,3)C(1, 3). Use the dot product to find angle AA, to the nearest tenth of a degree.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.