Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Prove the law of cosines.

  1. Nov 3, 2011 #1
    1. The problem statement, all variables and given/known data

    Prove the law of cosines: If v and w are vectors in R^2, then

    |v-w|^2 = |v|^2 + |w|^2 - 2|v||w|cosθ

    where θ is the angle between v and w.

    2. Relevant equations/info

    |x| refers to length, and not absolute value (If that doesn't make any sense then I must be wrong, but our prof. insisted on only using single lines to define a value as 'length', which can be confusing at times).

    3. The attempt at a solution

    I got blindsided by this question (missed the lecture..). Even just a starting point, or even an online resource would be greatly appreciated, and to go as far fully providing me with the solution would be extremely helpful (but I suppose possibly detrimental).

    Also, the rest of the assignment deals with orthogonal projections, and cross products, as well as distances from points to planes, and lines - do these sort of questions involve the usage of the above law?
  2. jcsd
  3. Nov 3, 2011 #2
    Do you mean you want to prove the following:

  4. Nov 3, 2011 #3


    User Avatar
    Science Advisor
    Homework Helper

    Assuming you know the explicit form of the dot product ([itex]\vec a \cdot \vec b = |\vec a| |\vec b| \cos\theta[/itex] with [itex]\theta[/itex] the angle between them) you can just write it out using the properties of the dot product:
    [tex]|v - w|^2 = (v - w) \cdot (v - w) = \cdots[/tex]
  5. Nov 4, 2011 #4
    Thanks for the reply!


    So I get:

    v2 - 2vw +w2 = v2 + w2 - 2vwcosθ


    -2vw = -2vwcosθ

    so for that to be true cosθ needs to equal 1, meaning theta is 0.

    ..now what?
  6. Nov 4, 2011 #5


    User Avatar
    Science Advisor
    Homework Helper

    Sorry, what?
    Where is the left hand side coming from?
    And what does "2vwcosθ" mean? v and w are vectors, vw is not a valid product.
    Please try to be a bit more precise in your notation, it is important here!
  7. Nov 4, 2011 #6
    Right sorry,

    So doing the dot product of the LHS gives us:

    |v|2 + |w|2

    Then, we substract the lengths |v|2 + |w|2 of the RHS from the lengths |v|2 + |w|2 of the LHS , which leaves

    0 = 2 |v| |w| cosθ

    I'm still confused as to where this is going. I really am sorry for being so clueless on this matter.
  8. Nov 4, 2011 #7
    Hold on.. If 0 = 2 |v| |w| cos (theta) then that means cos of theta has to equal 0 (so cos of 2 over pi) meaning the angle is 90 degrees, meaning the two vectors are perpendicular.

  9. Nov 4, 2011 #8


    User Avatar
    Science Advisor
    Homework Helper

    Yes, I think you are missing my point.
    The equality I wrote,
    [tex]|v - w|^2 = (v - w) \cdot (v - w),[/tex]
    is the definition of |v - w|, because the length of a vector is the square of the dot product with itself.
    You can then work out the dot product, but note that wherever you get v . v, you don't really get v2, but you get |v|2 (again, by the same definition).
  10. Nov 4, 2011 #9


    User Avatar
    Science Advisor
    Homework Helper

    Yep, and two arbitrary vectors aren't perpendicular, in general.
    So there's a big clue something went wrong :-)
  11. Nov 4, 2011 #10
    Alright, so let me try again.

    |v-w|2 = |v|2 + |w|2 - 2|v||w|cosθ


    2|v||w|cosθ = |v|2 + |w|2 - |v-w|2

    " " = |v|2 + |w|2 - (|v|2 + |w|2 -2(v)(w))

    " " = 2(v)(w)

    |v||w|cosθ = (v)(w)

    Yes? But is that saying that the dot product between v and w is equal to length of v times length of w times the cosinus of the angle between them? Does that make sense?..
  12. Nov 4, 2011 #11

    S=A + B
    ... etc
  13. Nov 5, 2011 #12

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    Yes. That is how it is sometimes defined.

  14. Nov 5, 2011 #13


    User Avatar
    Science Advisor
    Homework Helper

  15. Nov 5, 2011 #14
    I can't tell if you just insulted me or told me that I finally arrived at the appropriate answer.. Either way thanks for all your help (everyone)!
  16. Nov 6, 2011 #15


    User Avatar
    Science Advisor
    Homework Helper

    Nope, it was not meant as an insult.
    I was just reminding you that what you've written there is what you told us in your first post is the thing you want to prove.

    The conclusion is usually taken as the definition of the inner product, as Ray pointed out. So in a sense, you'd have to read your post backwards.

    Am I correct in sensing that you are a bit confused about what the definitions are here, and what you want to prove, and how to write that down?
  17. Nov 6, 2011 #16
    Yes, very much so. :\
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook