Two Definitions, One Dot Product

In Euclidean space, the vector dot product is usually introduced in one of two ways. The component definition sums the products of corresponding coordinates. The geometric definition multiplies the magnitudes of the two vectors by the cosine of the angle between them. Both definitions are standard, but their equivalence is not always obvious. The figure below shows the components of two vectors and the angle between them, where the length of the arrow for **a** is |a|.

Vectors a and b in the cartesian plane

Two proofs establish that these definitions agree. The first relies on geometry; the second on vector projections.

Proof by Law of Cosines

Consider vectors **a** and **b** and the vector **a** - **b**:

Vectors a, b and c in the cartesian plane

Applying the law of cosines to the triangle formed by these three vectors:

|a - b|^2 = |a|^2 + |b|^2 - 2|a||b|cos(θ)

For any vector **v**, the identity **v** · **v** = |v|^2 holds (see Appendix). Rewriting:

(**a** - **b**) · (**a** - **b**) = **a** · **a** + **b** · **b** - 2|a||b|cos(θ)

Since the dot product distributes over addition (see Appendix), expanding the left side and simplifying gives the component definition:

**a** · **b** = |a||b|cos(θ)

Proof by Projection

This proof starts from the geometric definition and derives the component form. Let {**e**_1, **e**_2, ..., **e**_n} be the standard orthonormal basis for R^n, as illustrated in 2D:

Projection of vector a on basis vectors

For an arbitrary vector **a**, its dot product with a basis vector is, by the geometric definition:

**a** · **e**_i = |a|cos(θ_i)

This is exactly the component of **a** along the direction of **e**_i, a fact that follows from basic trigonometry or vector projection.

Now express both **a** and **b** as linear combinations of the basis:

**a** = Σ a_i **e**_i,   **b** = Σ b_i **e**_i

Compute **a** · **b** by rewriting **b** in its basis representation and applying distributivity:

**a** · **b** = **a** · (Σ b_i **e**_i) = Σ b_i (**a** · **e**_i)

From the earlier result, **a** · **e**_i = a_i. Therefore:

**a** · **b** = Σ a_i b_i

That is the component definition.

Appendix: Dot Product as an Inner Product

The dot product is a special case of the inner product, an operation on a vector space with the following properties for all vectors **u**, **v**, **w** and scalar c:

  • Symmetry: <**u**, **v**> = <**v**, **u**>
  • Linearity in the first argument: <c**u** + **v**, **w**> = c<**u**, **w**> + <**v**, **w**>
  • Positive-definiteness: if **u** ≠ 0, then <**u**, **u**> > 0

For R^n, the component-wise inner product is defined as:

<**a**, **b**> = Σ a_i b_i

These requirements hold straightforwardly from properties of scalar arithmetic. Symmetry is immediate. Linearity follows from the distributive and associative laws of real numbers. For positive-definiteness, if **u** ≠ 0, at least one component u_i is nonzero, so u_i^2 > 0 and the sum is positive.

Satisfying these conditions makes R^n an inner product space. From these axioms, additional useful properties follow, including <**u**, 0> = <0, **u**> = 0 and <**u**, c**v**> = c<**u**, **v**>. In particular, the inner product is bilinear and distributes over addition. These properties are proven here for the component definition; distributivity for the geometric definition can be shown via projections.

Norm

The norm of a vector is defined as ||**v**|| = sqrt(<**v**, **v**>), so its square is <**v**, **v**>. In Cartesian coordinates, this norm is a generalization of the Pythagorean theorem, capturing the notion of a vector's length or magnitude.


[1]By this we mean \mathbb{R}^n, where each vector is an n-tuple of real numbers, with the usual mathematical operations making this a vector space.
[2]Which is a very fundamental theorem in geometry; it is (or rather, its non-trigonometric version) is proven from the basic Euclidean axioms in The Elements.