MathLabs
TheoremProved

Dot Product and the Law of Cosines

Statement

For any two vectors u⃗=(x1,y1)\vec{u}=(x_1,y_1) and v⃗=(x2,y2)\vec{v}=(x_2,y_2) forming an angle θ\theta, the geometric dot product u⃗⋅v⃗=∣u⃗∣ ∣v⃗∣cos⁡θ\vec{u}\cdot\vec{v}=|\vec{u}|\,|\vec{v}|\cos\theta equals the coordinate expression x1x2+y1y2x_1x_2+y_1y_2.

Why is it true?

Expanding ∣u⃗−v⃗∣2|\vec{u}-\vec{v}|^2 in coordinates and comparing it with the Law of Cosines on the triangle formed by u⃗\vec{u}, v⃗\vec{v}, and u⃗−v⃗\vec{u}-\vec{v} cancels the squared lengths and isolates the cross-term x1x2+y1y2x_1x_2+y_1y_2.

Proof sketch

Place u⃗=OA→\vec{u}=\overrightarrow{OA} and v⃗=OB→\vec{v}=\overrightarrow{OB} at the origin OO so that AB→=v⃗−u⃗=(x2−x1,y2−y1)\overrightarrow{AB}=\vec{v}-\vec{u}=(x_2-x_1,y_2-y_1). By the Law of Cosines in △OAB\triangle OAB, the squared side length opposite angle θ\theta is ∣v⃗−u⃗∣2=∣u⃗∣2+∣v⃗∣2−2∣u⃗∣ ∣v⃗∣cos⁡θ|\vec{v}-\vec{u}|^2=|\vec{u}|^2+|\vec{v}|^2-2|\vec{u}|\,|\vec{v}|\cos\theta.

On the other hand, computing the squared lengths in coordinates gives ∣u⃗∣2=x12+y12|\vec{u}|^2=x_1^2+y_1^2, ∣v⃗∣2=x22+y22|\vec{v}|^2=x_2^2+y_2^2, and ∣v⃗−u⃗∣2=(x2−x1)2+(y2−y1)2=x12+y12+x22+y22−2(x1x2+y1y2)|\vec{v}-\vec{u}|^2=(x_2-x_1)^2+(y_2-y_1)^2=x_1^2+y_1^2+x_2^2+y_2^2-2(x_1x_2+y_1y_2).

Equating the two expressions for ∣v⃗−u⃗∣2|\vec{v}-\vec{u}|^2 and subtracting x12+y12+x22+y22x_1^2+y_1^2+x_2^2+y_2^2 from both sides yields −2∣u⃗∣ ∣v⃗∣cos⁡θ=−2(x1x2+y1y2)-2|\vec{u}|\,|\vec{v}|\cos\theta=-2(x_1x_2+y_1y_2). Dividing by −2-2 gives u⃗⋅v⃗=∣u⃗∣ ∣v⃗∣cos⁡θ=x1x2+y1y2\vec{u}\cdot\vec{v}=|\vec{u}|\,|\vec{v}|\cos\theta=x_1x_2+y_1y_2.

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. H. S. M. Coxeter, S. L. Greitzer (1967). Geometry Revisited
  2. Murray R. Spiegel (1959). Schaum's Outline of Vector Analysis