Lemonmath
Tiếng Việt

The dot product of two vectors

Lesson 4.5 · 18 min read · Updated

You pull a sled along the snow with a rope. Only the part of your pull that points along the ground moves the sled; the part that lifts it up is wasted. Physicists capture this with a single number: force times distance times the cosine of the angle between them. Mathematicians turned the same idea into a product of two vectors whose result is a number: the dot product.

The angle between two vectors

Place two nonzero vectors a⃗\vec{a} and b⃗\vec{b} so that they start at the same point OO. The angle between them, written (a⃗,b⃗)(\vec{a}, \vec{b}), is the angle θ\theta of the figure, with 0∘≤θ≤180∘0^\circ\le\theta\le 180^\circ.

abθO
The angle θ\theta between a⃗\vec{a} and b⃗\vec{b}

If θ=0∘\theta=0^\circ the vectors point the same way; if θ=180∘\theta=180^\circ they point opposite ways; if θ=90∘\theta=90^\circ they are perpendicular, written a⃗⊥b⃗\vec{a}\perp\vec{b}.

Definition of the dot product

The result is a number, not a vector. It is positive for an acute angle, negative for an obtuse angle and 00 for a right angle. In particular a⃗⋅a⃗=∣a⃗∣2\vec{a}\cdot\vec{a}=|\vec{a}|^2 (the angle is 0∘0^\circ and cos⁡0∘=1\cos 0^\circ=1).

Properties

From these we get the identities ∣a⃗+b⃗∣2=∣a⃗∣2+2 a⃗⋅b⃗+∣b⃗∣2,∣a⃗−b⃗∣2=∣a⃗∣2−2 a⃗⋅b⃗+∣b⃗∣2.|\vec{a}+\vec{b}|^2=|\vec{a}|^2+2\,\vec{a}\cdot\vec{b}+|\vec{b}|^2,\qquad |\vec{a}-\vec{b}|^2=|\vec{a}|^2-2\,\vec{a}\cdot\vec{b}+|\vec{b}|^2.

The dot product in coordinates

Two consequences follow at once:

  • a⃗⊥b⃗  ⟺  x1x2+y1y2=0\vec{a}\perp\vec{b}\iff x_1x_2+y_1y_2=0 (for nonzero vectors).
  • cos⁡(a⃗,b⃗)=x1x2+y1y2x12+y12 x22+y22\cos(\vec{a}, \vec{b})=\dfrac{x_1x_2+y_1y_2}{\sqrt{x_1^2+y_1^2}\,\sqrt{x_2^2+y_2^2}}.

Angles in a triangle

To find the angle at a vertex, use the two vectors that leave that vertex.

ABC
Triangle ABCABC

Key terms

Summary

  • a⃗⋅b⃗=∣a⃗∣∣b⃗∣cos⁡(a⃗,b⃗)\vec{a}\cdot\vec{b}=|\vec{a}||\vec{b}|\cos(\vec{a}, \vec{b}) is a number; a⃗⋅a⃗=∣a⃗∣2\vec{a}\cdot\vec{a}=|\vec{a}|^2.
  • It is commutative and distributive, and ∣a⃗±b⃗∣2=∣a⃗∣2±2a⃗⋅b⃗+∣b⃗∣2|\vec{a}\pm\vec{b}|^2=|\vec{a}|^2\pm2\vec{a}\cdot\vec{b}+|\vec{b}|^2.
  • In coordinates, a⃗⋅b⃗=x1x2+y1y2\vec{a}\cdot\vec{b}=x_1x_2+y_1y_2.
  • a⃗⊥b⃗  ⟺  a⃗⋅b⃗=0\vec{a}\perp\vec{b}\iff\vec{a}\cdot\vec{b}=0, and the formula for cos⁡\cos gives angles.

Practice

Show solutions
  1. 5⋅2⋅cos⁡60∘=10⋅12=55\cdot 2\cdot\cos 60^\circ=10\cdot\frac12=5.
  2. 4⋅3⋅cos⁡150∘=12⋅(−32)=−634\cdot 3\cdot\cos 150^\circ=12\cdot\left(-\frac{\sqrt3}{2}\right)=-6\sqrt3.
  3. 1⋅2+(−3)⋅5=2−15=−131\cdot 2+(-3)\cdot 5=2-15=-13.
  4. 2m−4=02m-4=0, so m=2m=2.
  5. a⃗⋅b⃗=3+2=5\vec{a}\cdot\vec{b}=3+2=5, ∣a⃗∣=5|\vec{a}|=\sqrt5, ∣b⃗∣=10|\vec{b}|=\sqrt{10}. cos⁡=550=12\cos=\frac{5}{\sqrt{50}}=\frac1{\sqrt2}, so the angle is 45∘45^\circ.
  6. AB→=(3,0)\overrightarrow{AB}=(3, 0) and AC→=(3,3)\overrightarrow{AC}=(3, 3). Dot product 99; lengths 33 and 323\sqrt2. cos⁡A=992=12\cos A=\frac{9}{9\sqrt2}=\frac1{\sqrt2}, so ∠A=45∘\angle A=45^\circ.
  7. ∣a⃗+b⃗∣2=4−6+9=7|\vec{a}+\vec{b}|^2=4-6+9=7, so 7\sqrt7. ∣a⃗−b⃗∣2=4+6+9=19|\vec{a}-\vec{b}|^2=4+6+9=19, so 19\sqrt{19}.
  8. W=20⋅3⋅cos⁡30∘=60⋅32=303≈51.96W=20\cdot 3\cdot\cos 30^\circ=60\cdot\frac{\sqrt3}{2}=30\sqrt3\approx 51.96 J.
  9. Let b⃗=(x,y)\vec{b}=(x, y). Then 3x+4y=03x+4y=0, so b⃗=t(4,−3)\vec{b}=t(4, -3). ∣b⃗∣=5∣t∣=10|\vec{b}|=5|t|=10 gives t=±2t=\pm2. So b⃗=(8,−6)\vec{b}=(8, -6) or b⃗=(−8,6)\vec{b}=(-8, 6).
  10. (a⃗+b⃗)⋅(a⃗−b⃗)=∣a⃗∣2−∣b⃗∣2=0(\vec{a}+\vec{b})\cdot(\vec{a}-\vec{b})=|\vec{a}|^2-|\vec{b}|^2=0. Check: a⃗+b⃗=(8,4)\vec{a}+\vec{b}=(8, 4), a⃗−b⃗=(−2,4)\vec{a}-\vec{b}=(-2, 4) and −16+16=0-16+16=0. ✓ (This says the diagonals of a rhombus are perpendicular.)