When two vectors a and b start from the same point, the vector a−b is the arrow that runs from the tip of b to the tip of a — it closes the triangle formed by the two vectors. Its length, ∣a−b∣, is the straight-line distance between those two tips. Computing that length is a bread-and-butter task in vector geometry.
The Working Formula
Start from the fact that any magnitude squared equals a dot product of the vector with itself:
∣a−b∣2=(a−b)⋅(a−b).
Expanding using the distributive rule for the dot product:
∣a−b∣2=a⋅a−2a⋅b+b⋅b.
∣a−b∣2=∣a∣2+∣b∣2−2a⋅b=∣a∣2+∣b∣2−2∣a∣∣b∣cosθ
This is nothing but the law of cosines written in vector language, where θ is the angle between a and b. Take the (non-negative) square root to get ∣a−b∣.
Reading the Formula
The two squared lengths ∣a∣2 and ∣b∣2 set the base size.
The term −2a⋅b is the correction for how the vectors are aligned. If they point nearly the same way, a⋅b is large and positive, so the difference is short (the tips are close). If they point opposite ways, the term adds on and the difference is long.
If a⊥b, then a⋅b=0 and it collapses to plain Pythagoras: ∣a−b∣2=∣a∣2+∣b∣2.
Note
Distinguish two ideas.∣a−b∣ (magnitude of the difference vector) is not the same as ∣a∣−∣b∣ (difference of the two lengths). They agree only when a and b point in the same direction.
A Useful Bound
The two quantities above are linked by the reverse triangle inequality:
Why it's wrong: (a+b)⋅(a−b) is a difference of squares, so the a⋅b terms cancel — it equals ∣a∣2−∣b∣2, not ∣a∣2−2a⋅b+∣b∣2 (that is ∣a−b∣2). Correct approach: expand as ∣a∣2−∣b∣2.
Mistake 2: Forgetting to square the relation ∣a∣=8∣b∣. …