Even though the Law of Sines enables us to solve many oblique triangles, it does not help with triangles where the known angle is between two known sides or when all three sides are known but no angles are known. We refer to these triangles are SAS (side-angle-side) and SSS (side-side-side) triangles respectively and for these cases, we can use the Law of Cosines to find the unknown angles or sides.
In order to derive the Law of Cosines, we need to use the Generalized Pythagorean Theorem, which is an extension of the Pythagorean Theorem for non-right triangles. To derive this theorem, we place an arbitrary non-right triangle ABC somewhere in the coordinate plane where the vertex A is at the origin, the side c is drawn along the x-axis, and the vertex C is located at some point (x,y) in the plane.
Fig. 1 - Generalized Pythagorean Theorem
note
The triangle could have been placed anywhere in the plane but for the sake of simplicity, we placed it in this specific location making it easier to derive the theorem with.
When we draw a perpendicular line from C to the x-axis, we get a right triangle which lets us get these identities:
Now if we use the side (x−c) as one leg of a right triangle and y as the second leg, we can find the length of hypotenuse a using the Pythagorean Theorem...
The formula we derived is one of the three equations of the Law of Cosines and the other equations can be found in a similar fashion. However, all of these equations state that the square of any side of a triangle is equal to the sum of the squares of the other two sides minus the product of the other two sides and the cosine of the included angle. This means all the equations for the Law of Cosines are...
a2=b2+c2−2bccosα
b2=a2+c2−2accosβ
c2=a2+b2−2abcosγ
...where α, β, and γ are the angles opposite to sides a, b, and c respectively.
note
To make solving for an angle easier, we can rearrange the Law of Cosines in terms of cosine which gives us...
cosα=2bcb2+c2−a2
cosβ=2aca2+c2−b2
cosγ=2aba2+b2−c2
Example
Find the missing side and angles of the given triangle: α=30∘, b=12, c=24.
We can use the Law of Cosine to find the value of the unknown side a. For this case, we will use the formula a2=b2+c2−2bccosα because we know the value of α, b, and c leaving only a as the unknown variable...
We can use the Law of Cosines to derive the Heron's Formula which is a valuable formula because it allows us to find the area of an oblique triangle when we know the lengths of all three sides.
To derive this formula, let a, b, and c be the sides of the triangle and α, β, and γ be the opposite angles to the sides respectively. To derive the formula, we can use any of the Law of Cosines equations to express one of the angles in terms of the sides. In this case, we can use the formula...
cosγ=2aba2+b2−c2
With this formula, a would be the base of the triangle meaning the altitude/height would be bsinγ. Finally, we will also need the trigonometric identity sinγ=1−cos2γ. Putting this all together, we can derive Heron's Formula...
We can simplify this formula even further by substituting s=2a+b+c, which is one half of the perimeter of the triangle also known as the semi-perimeter. This gives us the final form of Heron's Formula...
A=s(s−a)(s−b)(s−c)
where s=2a+b+c is the semi-perimeter of the triangle.
Example
Use Heron's formula to find the area of a triangle with sides of lengths a=29.7 ft, b=42.3 ft, and c=38.4 ft.
First, we need to find the semi-perimeter s...
s=2a+b+c=229.7+42.3+38.4=55.2 ft
Now we can use Heron's formula to find the area of the triangle...
Just like with the Law of Sines, the Law of Cosine is an invaluable tool in various fields because with both these laws, we can solve all possible oblique triangles.
Example
Suppose a boat leaves port, travels 10 miles, turns 20 degrees, and travels another 8 miles. How far from port is the boat?
Fig. 2 - Law of Cosines Real World Example
We can label the values of the triangle as a=8, b=10, and γ=180∘−20∘=160∘. To find the distance from the boat to the port, we will need to find the value of the side c which we can do using the Law of Cosines...