Cosine Rule (Law of Cosines)
The cosine rule, also known as the law of cosines, relates all 3 sides of a triangle with an angle of a triangle.
It is most useful for solving for missing information in a triangle. For example, if all three sides of the triangle are known, the cosine rule allows one to find any of the angle measures. Similarly, if two sides and the angle between them is known, the cosine rule allows one to find the third side length.
Contents
Statement and Proof of the Theorem
Given the following triangle with corresponding sides length , , and
the law of cosines states that
It can be seen as a generalization of the Pythagorean theorem. Take one arbitrary side of the triangle, for instance, . Then its square equals the sum of the squares of the other two sides, i.e. . If you were to plug in 90 degrees, you would be left with the Pythagorean theorem. Since the angle that faces our arbitrary side is not necessarily , we will have to subtract something, as the identity does not hold yet. The right side of this equation is still "too big." That something we have to subtract becomes .
![]()
We'll prove for side . Let's denote its facing angle as . The other two equations can be done in a similar way.
By definition we have Using the Pythagorean theorem, we get Substituting for and , we get
Notes:
- The identity is also known as the Pythagorean identity.
- This proof isn't perfect. We should have been worried about angles. This can be avoided by using directed angles.
Let denote the dot product between and .
Also, let , , and .
Then
Finding Missing Side Lengths and Angles
Given side-angle-side:
In triangle , we have and . Determine .
Applying the cosine rule on , we get
Hence, .
Note: This is similar to the 'ambiguous case' of sine rule, since we have , which is the condition .
Points and are the midpoints of sides and respectively, of
If and then find the length of
In triangle , . Points and are consecutive points on side such that . If there exists such that and , what is
Given side-side-side:
In triangle , and Find the measure of
Applying the law of cosines on side we get
Try the following problem:
An ant is lost in a square, and his distances to the vertices of the square are 7, 35, 49, and Find
Note: The image is not drawn to scale.
Applications to Bearing and Heading Problems
When it comes to the applications with regards to the law of cosines, it has its own applications towards vector quantities (and not qualities).
See: Bearing
Vector Form of Cosine Rule
We have
Deriving other Laws Using the Cosine Rule
- Triangle Inequality
- Pythagorean Theorem
From the cosine rule, we have
and by taking the square root of both sides, we have , which is also known as the triangle inequality. One useful application of the triangle inequality is to test if three given lengths can define a triangle.
The Pythagorean theorem applies to right triangles, so let be a right angle, i.e., . Then by the cosine rule,
Suppose and are positive reals such that and . Show that .
Since , it follows that and we have similar inequalities for other variables. Hence, the numbers and satisfy the triangle inequality, and there exists a triangle such that . As such
which gives us that . Similarily, we have and , which show that triangle is equilaterial, implying that .
Note: This may also be done directly by summing up the 3 equations to get .
Let , and be real numbers satisfying the system of equations above.
Compute the integral value of .
Hint: See the topic of this question.
Source: HMMT
The figure above shows an isosceles triangle with and .
Let be a point on such that . Given that the lengths of , , , and are all distinct prime numbers, what is the length of
Problem Solving
In , and Given that , find the value of
This problem is not original.
An ant, located in a square field, is from one of the corner posts of the field, from the corner post diagonally opposite to the first one, and from a third corner post. Assuming the land is flat, find the area of the field in
One big and one small circle share the same center .
Then is constructed such that points and are on the big circle while point is on the smaller circle. intersects the smaller circle at and and passes through and , as shown above.
If (red segment), (blue segment), and (green side), what is the radius of the smaller, orange circle?