The concept of the scalar product provides a way to multiply two vectors to obtain a scalar (a real number). This operation can be viewed from two fundamental perspectives: a geometric one, involving the angle between the vectors, and an analytical one, using their coordinates. A key result in vector algebra, derived from the Law of Cosines, is that these two perspectives are entirely consistent.
Let's explore this by considering two vectors, \(\Vect{u}=\begin{pmatrix} x \\y\\ \end{pmatrix}\) and \(\Vect{v}=\begin{pmatrix} x' \\y'\\ \end{pmatrix}\), with an angle \(\theta\) between them.

The Law of Cosines applied to the triangle formed by \(\Vect{u}\), \(\Vect{v}\), and \(\Vect{v}-\Vect{u}\) states:$$\|\Vect{v}-\Vect{u}\|^2 = \|\Vect{u}\|^2+\|\Vect{v}\|^2-2\|\Vect{u}\|\|\Vect{v}\| \cos \theta$$By expanding the squared norms in terms of coordinates:
- \(\|\Vect{u}\|^2=x^2 +y^2\)
- \(\|\Vect{v}\|^2=x'^2 +y'^2\)
- \(\|\Vect{v}-\Vect{u}\|^2=\left(x'-x\right)^2+\left(y'-y\right)^2\) since \(\Vect{v}-\Vect{u}=\begin{pmatrix} x'-x \\y'-y\\ \end{pmatrix}\).
Substituting these into the Law of Cosines:$$\begin{aligned}\left(x'-x\right)^2+\left(y'-y\right)^2 &= (x^2 +y^2) + (x'^2 +y'^2)-2\|\Vect{u}\|\|\Vect{v}\| \cos \theta \\
x'^2 -2xx'+ x^2 + y'^2 -2yy'+y^2 &= x^2 +y^2 + x'^2 +y'^2-2\|\Vect{u}\|\|\Vect{v}\| \cos \theta \\
-2xx'- 2yy' &= -2\|\Vect{u}\|\|\Vect{v}\| \cos \theta \\
xx'+ yy' &= \|\Vect{u}\|\|\Vect{v}\| \cos \theta \\
\end{aligned}$$This fundamental equality shows that the analytical expression \(xx'+ yy'\) is equivalent to the geometric expression \(\|\Vect{u}\|\|\Vect{v}\| \cos \theta\). This allows us to define the scalar product in two equivalent ways.