[Math] Dot product of two vectors

linear algebravector-spaces

How does one show that the dot product of two vectors is $ A \cdot B = |A| |B| \cos (\Theta) $?

Best Answer

Think about a triangle with sidelengths $|\textbf{a}|,|\textbf{b}|,|\textbf{c}|$. Then we can use the law of cosines.

$$ \begin{align} |\textbf{c}|^2&=|\textbf{a}|^2+|\textbf{b}|^2-2|\textbf{a}||\textbf{b}| \cos \theta \\ \implies 2|\textbf{a}||\textbf{b}| \cos \theta &= |\textbf{a}|^2+|\textbf{b}|^2-|\textbf{c}| = \textbf{a}\cdot \textbf{a} + \textbf{b} \cdot \textbf{b} - \textbf{c}\cdot \textbf{c} \end{align} $$

By the properties of the dot product and from the fact that $\textbf{c}=\textbf{b}-\textbf{a}$ we find that

$$ \begin{align} \textbf{c}\cdot \textbf{c} &=(\textbf{b}-\textbf{a}) \cdot (\textbf{b}-\textbf{a}) \\ &=(\textbf{b}-\textbf{a})\cdot \textbf{b} - (\textbf{b}-\textbf{a}) \cdot \textbf{a} \\ &= \textbf{b}\cdot \textbf{b} - \textbf{a}\cdot \textbf{b} - \textbf{b}\cdot \textbf{a} + \textbf{a}\cdot \textbf{a}. \end{align} $$

By substituting $\textbf{c}\cdot \textbf{c}$, we get $$ \begin{align} 2|\textbf{a}||\textbf{b}| \cos \theta &= \textbf{a}\cdot \textbf{a} + \textbf{b} \cdot \textbf{b} - (\textbf{b}\cdot \textbf{b} - \textbf{a}\cdot \textbf{b} - \textbf{b}\cdot \textbf{a} + \textbf{a}\cdot \textbf{a}) \\ &=2 \textbf{a}\cdot \textbf{b}. \end{align} $$