# Vectors Dot Product

Justabeginner

## Homework Statement

Prove that if u and v are nonzero vectors, and theta is the angle between them then u dot product v = ||u|| ||v|| cos (theta). Consider the triangle with sides u ,v , and u-v. The Law of Cosines implies that ||u-v||^2 = ||u||^2 + ||v||^2 - 2||u|| ||v|| cos(theta). On the other hand, ||u-v||^2 = (u-v) dot product (u-v)... Simplify this last expression, then equate the two formulas for ||u-v||^2.

## The Attempt at a Solution

I have no idea how to start! I thought of doing
cos(theta)= uxvx + uyvy / sqrt[(uxvy- vxuy)^2] + (uxvx + uyvy)^2] When x and y are subscripts, because
u= uxi + uyj
v= vxi + vyj

Gold Member
Expand the dot product ##(u-v) \cdot (u-v)## using distributivity.

Justabeginner
Yes I did that, and I get u^2 - 2uv + v^2.
But as for the left side ||u-v||^2, I get [sqrt(u^2 + v^2)]^2 = u^2 + v^2.
That isn't equal though.

Gold Member
Yes I did that, and I get u^2 - 2uv + v^2
Since u and v are vectors, you should write that as||u||2-2(u . v) + ||v||2. Now compare this with the law of cosines.

Justabeginner
So how is -2 ( u dot v) = -2 ||u|| ||v|| cos theta?
I don't understand. I thought once you take the norm of u and v you'll be left with -2 u times v cos theta?

Gold Member
So how is -2 ( u dot v) = -2 ||u|| ||v|| cos theta?
I don't understand. I thought once you take the norm of u and v you'll be left with -2 u times v cos theta?
The full expression before simplification is ##u \cdot u -2(u \cdot v) + v \cdot v##. The middle term is a projection, while the first and third terms are the norm of the vectors squared (which is also the projection of a vector onto itself)