TITLE: Proof of equivalence of algebraic and geometric dot product?
QUESTION [22 upvotes]: Geometrically the dot product of two vectors gives the angle between them (or the cosine of the angle to be precise). Algebraically, the dot product is a sum of products of the vector components between the two vectors.
However, both formulae look quite different but compute the same result. What is an easy/intuitive proof showing the equivalence between the two definitions?
I.e., demonstrate that $a_x b_x + a_y b_y + a_z b_z = \lvert a \rvert \lvert b \rvert \cos{\theta}$

REPLY [11 votes]: It's quite simple after spending some time with it :)
The equivalence is derivable as below:
Geometric definition: (assuming that this is proved and we accept the intuition behind it)

$\vec{a} \cdot \vec{b} = |a|\cdot|b| \space cos\theta$

Decomposing the vector into its 'unit' vectors (assuming 2D for simplicity):

$\vec{a} = a_x \cdot \vec{i} + a_y \cdot \vec{j}$
$\vec{b} = b_x \cdot \vec{i} + b_y \cdot \vec{j}$

Multiplying the two vectors (loosely using the term 'multiplication') i.e., taking their dot product literally:

$ \vec{a} \cdot \vec{b} = a_x \cdot \vec{i} * b_x \cdot \vec{i} + a_x \cdot \vec{i} * b_y \cdot \vec{j} + a_y \cdot \vec{j} * b_x \cdot \vec{i} + a_y \cdot \vec{j} * b_y \cdot \vec{j}$

Using:

$\vec{i} \cdot \vec{i} = 1$ and $\vec{i} \cdot \vec{j} = 0$ (i.e., angle between $\vec{i}$ and $\vec{j}$, $\theta = 90 ^\circ) $  and that $a_x, a_y, b_x, b_y$ are scalars, we can simplify the above equation as:

The algebraic dot product is given by:

$ \vec{a} \cdot \vec{b} = a_x * b_x + a_y * b_y$

$Q.E.D.$