If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:9:26

Proof of the law of cosines


Video transcript

in the last video we had a word problem where we had we essentially had to figure out the sides of a triangle but instead of you know just being able to the Pythagorean theorem and and because it was a right triangle was just kind of a normal triangle and it wasn't a right triangle and we just kind of chugged through it using sohcahtoa and just our very simple trig functions and we got the right answer what I want to do now is introduce you to something called the law of cosines which we essentially proved in the last video but I want to kind of prove it in a more you know without the word problem getting in the way and I want to show you once you know the law of cosines you can then apply it to a problem like we did in the past and you'll do it faster I have a bit of a mixed opinion about it because I'm not a big fan of memorizing things you know when you're when you're 40 years old you probably won't have the law of cosines still memorized but if you have that ability to start with the trig functions and just move forward then you'll always be set and I'd be impressed if you're still doing trig at 40 but but who knows so let's go let's go and let's and let's see what this law of cosines is all about so let's say that I know this angle theta I know this angle theta and I know let's call this side I don't know a let's call this side B I'm being a little arbitrary here let's call that Oh actually let me let me stay in the colors of the of the side so that way let's call that B and let's call let's call this C and then let's call this side a so if this was a right triangle then we could use the Pythagorean theorem somehow but now now we we can't so what do we do so we know a well let's put let's let's assume that we know B we know C we know theta and then we want to solve for a but in general we can you know if as long as you know three of these you can solve for the fourth and once you know the law of cosines so how can we do it well we're going to do it the exact same way we did that last problem we can drop a line here to make oh my god that's messy I thought I was using the line tool edit undo undo so I can drop a line like that trying to make so I have two right angles and then once I have right triangles and now I can start to use trig functions and Pythagorean theorem etc etc so so let's see so this is a right angle this is a right angle so what is what is this side here what is what is let me pick another color I'm probably going to get too involved with all of the colors but it's for your improvement so what is this side here what is the length of that side that purple side well that purple side is just you know we use sohcahtoa oh it's good to write sohcahtoa up here so to-- so this purple side is adjacent to theta and then this blue or mol side b is is is the hypotenuse right of this right triangle so we know that so I'm going to stick to one color because it'll take me forever if I keep switching colors we know that cosine of theta let's call this side let's call this kind of sub side let's call this I don't know let's call this D side D we know that cosine of theta is equal to D over B right and we know B or that D is equal to what it equals B cosine theta now let's call this side e right here E well what's e well e is this whole seaside C so I know that's engine this whole seaside - this D side right so E is equal to C minus D we just solved for D so side E is equal to C minus B cosine of theta B cosine of theta so that's e we got a out of the way and what's this magenta side going to be well let's call this magenta so let's call it M for magenta and well M is opposite to the two theta and so if we what-what involves we could not we know it we've solved for C as well but we know B and B is simple so what relationship gives us M over B or involves the opposite in the hypotenuse well let's sign opposite over hypotenuse so we know that M over B is equal to sine of theta we know that let me go here M over B right because it's hypotenuse is equal to sine of theta or that M is equal to B sine of theta right so we figured out M we figured out E and now we want to figure out a and this should jump out at you we have two sides of a right triangle and we want to figure out the hypotenuse we can use the Pythagorean theorem Pythagorean theorem tells us a squared is equal to M squared plus e squared right just the square of the other two sides well what's M squared plus e squared let me switch to another color just to be arbitrary so a squared is equal to M Squared M is B sine of theta so it's B sine of theta squared plus E squared well e we figured out is this so it's plus C minus B cosine theta squared now let's just chug through some algebra so that equals B sine B squared signs sine squared theta sine squared theta just means sine of theta squared right plus and we just boil this out I although I don't like using foil I just multiply it out but C squared minus 2 C B cosine theta plus B squared cosine data right I just expanded this out by multiplying it out and now let's see if we can do anything interesting well if we take this term and this term we get that those two terms are B squared sine squared of theta plus B squared cosine that should be there should be a squared there right because we squared it B squared cosine squared of theta and then we have plus c squared minus 2bc cosine theta well what does this simplify to well this is the same thing as this equals B squared times the sine squared theta plus cosine squared of theta something should be jumping out at you and that's plus c squared minus 2bc cosine of theta well this thing cosine sine squared plus cosine squared of any angle is one that's that's one of the earlier identities that's just you know that's the Pythagorean identity right there so this equals one so then we're left with we're left with going back to my original color we're almost there a squared is equal to this term just becomes 1 so B squared we're just left with a B squared right plus C squared plus c squared minus 2bc cosine of theta that's that's pretty neat and this is called the law of cosines and it's it's useful because you know if you know an angle and two of the sides of any triangle you can now solve for the other side and and or really if you want to if you know three sides of a triangle you can now solve for any angle so that also is very useful the only reason why I'm a little bit you know here there is I don't it is good if you are in trigonometry right now and you might have a test you should member because it'll make you faster and you'll get the answer right quicker I'm not a big fan of of just memorizing it without knowing where it came from because a year from now or two years from now when you go to college and you're it's been four years since you took trigonometry you probably won't have this memorized and if you face a trig problem all of a sudden it's good to kind of get there from scratch with that said this is a law of cosines and if you use the law of cosines you could have done that problem we just did a lot faster because we just you know you just have to set up the triangle and then just substitute into this and you could have solved for a in that ship off course problem I'll see you in the next video