# Is the geometric dot product formula equal to the algebraic one and how can I get one from the other in a step by step fashion ?

I can show using the law of cosines ( and there are many proofs of this on the internet !) the dot product is equal to the magnitude of each vector multiplied together and that in turn multiplied by the cosine of the angle between these vectors. No problem. But I would like to show that ( and the direction would not matter of course ) that this derivation is equal to the usual definition of multiplying vectors components with each other and adding them together. ( i.e. ab + cd where < a, c > is one vector and < b , d > is the other vector. I thought I found 2 separate proofs of this on utube. One proof the instructor at the last line he just sticks in the definition. The other proof is a mess and the professor slips in the dot product definition directly in where the law of cosines angle appears. In any event no one seems to take the time to show it…I can only conclude it is obvious to all but me. By the way I am aware there is another question almost identical to mine. I jumped on it right away thinking that was it! but it does not appear in any recognizable form to me. As for example the cosine of the angle between the vectors does not appear that I could see anywhere in the response.

#### Solutions Collecting From Web of "Is the geometric dot product formula equal to the algebraic one and how can I get one from the other in a step by step fashion ?"

Let $ABC$ be a triangle with $\angle BAC=\theta$, and let $\vec{BA} = \mathbf{a}$, $\vec{BC} = \mathbf{b}$. Then by the definition of vector addition, $\vec{AC} = \mathbf{b}-\mathbf{a}$.

By dropping perpendiculars onto the axes, one shows using Pythagoras that $\lvert \mathbf{a} \rvert^2 = a_1^2+a_2^2$, and similarly $\lvert \mathbf{b} \rvert^2 = b_1^2+b_2^2$, $\lvert \mathbf{b}-\mathbf{a} \rvert^2 = (b_1-a_1)^2 + (b_2-a_2)^2$.

Now use the cosine rule on $\triangle ABC$:
$$\lvert \vec{AC} \rvert^2 = \rvert \vec{AB} \rvert^2 + \lvert \vec{BC} \rvert^2 – 2\rvert \vec{AB} \rvert \lvert \vec{BC} \rvert \cos{\theta}$$
Substituting in the definitions, we find
$$\lvert \mathbf{b}-\mathbf{a} \rvert^2 = \rvert \mathbf{a} \rvert^2 + \lvert \mathbf{b} \rvert^2 – 2\rvert \mathbf{a} \rvert \lvert \mathbf{b} \rvert \cos{\theta}.$$
We then replace the squared expressions by the expressions we obtained using Pythagoras:
$$(b_1-a_1)^2 + (b_2-a_2)^2 = a_1^2+a_2^2 + b_1^2+b_2^2 – 2\rvert \mathbf{a} \rvert \lvert \mathbf{b} \rvert \cos{\theta}$$
Expanding the left-hand side gives
$$(b_1-a_1)^2 + (b_2-a_2)^2 = b_1^2+a_1^2-2a_1 b_1 + b_2^2 + a_2^2 – 2a_2 b_2,$$
and we can cancel most of these with terms on the right, so
$$-2(a_1 b_1 + a_2 b_2) = -2\rvert \mathbf{a} \rvert \lvert \mathbf{b} \rvert \cos{\theta},$$
as required.