Cosine Formula for Dot Product/Proof 1

Proof
There are two cases:
 * $(1): \quad \mathbf v$ and $\mathbf w$ are not scalar multiples of each other
 * $(2): \quad \mathbf v$ and $\mathbf w$ are scalar multiples of each other.

Case 1

 * AngleBetweenTwoVectors.png

Let the two vectors $\mathbf v$ and $\mathbf w$ not be scalar multiples of each other.

Then by the definition of angle between vectors, we have $\theta$ defined as in the triangle as shown above.

(Note that from Angle Between Non-Zero Vectors Always Defined, such a triangle is guaranteed to exist).

By the Law of Cosines:


 * $\norm {\mathbf v - \mathbf w}^2 = \norm {\mathbf w}^2 + \norm {\mathbf v}^2 - 2 \norm {\mathbf v} \norm {\mathbf w} \cos \theta$

Now, observe that:

Equating these two expressions for $\norm {\mathbf v - \mathbf w}^2$ gives:

which is exactly the desired result.

Case 2
Let $\mathbf v = \paren {v_1, v_2, \ldots, v_n}$ and $\mathbf w = \paren {w_1, w_2, \ldots, w_n}$.

, let $\mathbf v = c \mathbf w$, where $c$ is some scalar.

If $c > 0$, then by the definition of angle between vectors:


 * $\theta = 0 \implies \cos \theta = 1$

If $c < 0$, then by the definition of angle between vectors:


 * $\theta = \pi \implies \cos \theta = -1$

(Note that $c$ cannot be $0$ because we have stipulated $\mathbf v$ and $\mathbf w$ to be non-zero).

Then: