I have always been taught about the euclidean product in $\mathbb{R}^n$ the algebraic way, that is $$xy=\sum_1^n x_iy_i$$
Now I find myself having to come to grips with the geometric definition as $xy=\|x\|\|y\|\cos \theta.$
I am trying to understand how to pass from one to the other.
Now if I fix the standard orthonormal basis of $\mathbb{R}^n,$ I have that $x_i=xe_i$ for every $i.$ Then, If I suppose that the geometric definition holds, I have $x_i=xe_i=\|x\|\|e_i\|\cos \theta_i=\|x\|\cos\theta_i, $ and similarly for $y_i,$ hence $$xy=\sum_i\|x\|\|y\|\cos^2 \theta_i=\|x\|\|y\|\sum_i \cos^2 \theta_i$$ How do I proceed from here to conclude the implication geometric $\implies$ algebraic?
And then I need also to show that the algebraic definition implies the geometric one.
Think about the triangle that connects the vectors $x$, $y$, and the origin together. The law of cosines from geometry states that
$$a^2=b^2+c^2-2bc\cos(\alpha)$$
where $\alpha$ is the angle opposite $a$. We will assign $a$ to be the side of the triangle connecting $x$ and $y$, so $\alpha$ is the angle between $x$ and $y$. The equation reads
$$\|x-y\|^2=\|x\|^2+\|y\|^2-2\|x\|\|y\|\cos\alpha$$
The left side can be expanded, since
$$\|x-y\|^2=\|x\|^2-2(x\cdot y)+\|y\|^2$$
and canceling like terms gives
$$\cos\alpha=x\cdot y$$
Hope this helps!