Using the Law of Cosines to Solve Oblique Triangles

The tool we need to solve the problem of the boat’s distance from the port is the Law of Cosines, which defines the relationship among angle measurements and side lengths in oblique triangles. Three formulas make up the Law of Cosines. At first glance, the formulas may appear complicated because they include many variables. However, once the pattern is understood, the Law of Cosines is easier to work with than most formulas at this mathematical level.

Understanding how the Law of Cosines is derived will be helpful in using the formulas. The derivation begins with the Generalized Pythagorean Theorem, which is an extension of the Pythagorean Theorem to non-right triangles. Here is how it works: An arbitrary non-right triangle [latex]ABC[/latex] is placed in the coordinate plane with vertex [latex]A[/latex] at the origin, side [latex]c[/latex] drawn along the x-axis, and vertex [latex]C[/latex] located at some point [latex]\left(x,y\right)[/latex] in the plane, as illustrated in Figure 2. Generally, triangles exist anywhere in the plane, but for this explanation we will place the triangle as noted.

A triangle A B C plotted in quadrant 1 of the x,y plane. Angle A is theta degrees with opposite side a, angles B and C, with opposite sides b and c respectively, are unknown. Vertex A is located at the origin (0,0), vertex B is located at some point (x-c, 0) along the x-axis, and point C is located at some point in quadrant 1 at the point (b times the cos of theta, b times the sin of theta).

Figure 2

We can drop a perpendicular from [latex]C[/latex] to the x-axis (this is the altitude or height). Recalling the basic trigonometric identities, we know that

[latex]\cos \theta =\frac{x\text{(adjacent)}}{b\text{(hypotenuse)}}\text{ and }\sin \theta =\frac{y\text{(opposite)}}{b\text{(hypotenuse)}}[/latex]

In terms of [latex]\theta ,\text{ }x=b\cos \theta [/latex] and [latex]y=b\sin \theta .\text{ }[/latex] The [latex]\left(x,y\right)[/latex] point located at [latex]C[/latex] has coordinates [latex]\left(b\cos \theta ,b\sin \theta \right)[/latex]. Using the side [latex]\left(x-c\right)[/latex] as one leg of a right triangle and [latex]y[/latex] as the second leg, we can find the length of hypotenuse [latex]a[/latex] using the Pythagorean Theorem. Thus,

[latex]\begin{array}{llllll} {a}^{2}={\left(x-c\right)}^{2}+{y}^{2}\hfill & \hfill & \hfill & \hfill & \hfill & \hfill \\ \text{ }={\left(b\cos \theta -c\right)}^{2}+{\left(b\sin \theta \right)}^{2}\hfill & \hfill & \hfill & \hfill & \hfill & \text{Substitute }\left(b\cos \theta \right)\text{ for}x\text{and }\left(b\sin \theta \right)\text{for }y.\hfill \\ \text{ }=\left({b}^{2}{\cos }^{2}\theta -2bc\cos \theta +{c}^{2}\right)+{b}^{2}{\sin }^{2}\theta \hfill & \hfill & \hfill & \hfill & \hfill & \text{Expand the perfect square}.\hfill \\ \text{ }={b}^{2}{\cos }^{2}\theta +{b}^{2}{\sin }^{2}\theta +{c}^{2}-2bc\cos \theta \hfill & \hfill & \hfill & \hfill & \hfill & \text{Group terms noting that }{\cos }^{2}\theta +{\sin }^{2}\theta =1.\hfill \\ \text{ }={b}^{2}\left({\cos }^{2}\theta +{\sin }^{2}\theta \right)+{c}^{2}-2bc\cos \theta \hfill & \hfill & \hfill & \hfill & \hfill & \text{Factor out }{b}^{2}.\hfill \\ {a}^{2}={b}^{2}+{c}^{2}-2bc\cos \theta \hfill & \hfill & \hfill & \hfill & \hfill & \hfill \end{array}[/latex]

The formula derived is one of the three equations of the Law of Cosines. The other equations are found in a similar fashion.

Keep in mind that it is always helpful to sketch the triangle when solving for angles or sides. In a real-world scenario, try to draw a diagram of the situation. As more information emerges, the diagram may have to be altered. Make those alterations to the diagram and, in the end, the problem will be easier to solve.

A General Note: Law of Cosines

The Law of Cosines states that the square of any side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of the other two sides and the cosine of the included angle. For triangles labeled as in Figure 3, with angles [latex]\alpha ,\beta [/latex], and [latex]\gamma [/latex], and opposite corresponding sides [latex]a,b[/latex], and [latex]c[/latex], respectively, the Law of Cosines is given as three equations.

[latex]\begin{array}{l}{a}^{2}={b}^{2}+{c}^{2}-2bc\cos \alpha \\ {b}^{2}={a}^{2}+{c}^{2}-2ac\cos \beta \\ {c}^{2}={a}^{2}+{b}^{2}-2ab\cos \gamma \end{array}[/latex]
A triangle with standard labels: angles alpha, beta, and gamma with opposite sides a, b, and c respectively.

Figure 3

To solve for a missing side measurement, the corresponding opposite angle measure is needed.

When solving for an angle, the corresponding opposite side measure is needed. We can use another version of the Law of Cosines to solve for an angle.

[latex]\begin{array}{l}\hfill \\ \begin{array}{l}\begin{array}{l}\hfill \\ \cos \text{ }\alpha =\frac{{b}^{2}+{c}^{2}-{a}^{2}}{2bc}\hfill \end{array}\hfill \\ \cos \text{ }\beta =\frac{{a}^{2}+{c}^{2}-{b}^{2}}{2ac}\hfill \\ \cos \text{ }\gamma =\frac{{a}^{2}+{b}^{2}-{c}^{2}}{2ab}\hfill \end{array}\hfill \end{array}[/latex]

How To: Given two sides and the angle between them (SAS), find the measures of the remaining side and angles of a triangle.

  1. Sketch the triangle. Identify the measures of the known sides and angles. Use variables to represent the measures of the unknown sides and angles.
  2. Apply the Law of Cosines to find the length of the unknown side or angle.
  3. Apply the Law of Sines or Cosines to find the measure of a second angle. If you use the Law of Sines, you must find the smaller of the two remaining angles.
  4. Compute the measure of the remaining angle.

Example 1: Finding the Unknown Side and Angles of a SAS Triangle

Find the unknown side and angles of the triangle in Figure 4.

A triangle with standard labels. Side a = 10, side c = 12, and angle beta = 30 degrees.

Figure 4

Solution

First, make note of what is given: two sides and the angle between them. This arrangement is classified as SAS and supplies the data needed to apply the Law of Cosines.

Each one of the three laws of cosines begins with the square of an unknown side opposite a known angle. For this example, the first side to solve for is side [latex]b[/latex], as we know the measurement of the opposite angle [latex]\beta [/latex].

[latex]\begin{array}{ll}{b}^{2}={a}^{2}+{c}^{2}-2ac\cos \beta \hfill & \hfill \\ {b}^{2}={10}^{2}+{12}^{2}-2\left(10\right)\left(12\right)\cos \left({30}^{\circ }\right)\begin{array}{cccc}& & & \end{array}\hfill & \text{Substitute the measurements for the known quantities}.\hfill \\ {b}^{2}=100+144 - 240\left(\frac{\sqrt{3}}{2}\right)\hfill & \text{Evaluate the cosine and begin to simplify}.\hfill \\ {b}^{2}=244 - 120\sqrt{3}\hfill & \hfill \\ b=\sqrt{244 - 120\sqrt{3}}\hfill & \text{Use the square root property}.\hfill \\ b\approx 6.013\hfill & \hfill \end{array}[/latex]

Because we are solving for a length, we use only the positive square root. Now that we know the length [latex]b[/latex], we can use the Law of Sines to fill in the remaining angles of the triangle. Since side [latex]a[/latex] is smaller than side [latex]c[/latex], we will solve for angle [latex]\alpha [/latex]. Solving for angle [latex]\alpha [/latex], we have

[latex]\begin{array}{ll}\frac{\sin \alpha }{a}=\frac{\sin \beta }{b}\hfill & \hfill \\ \frac{\sin \alpha }{10}=\frac{\sin \left(30^\circ \right)}{6.013}\hfill & \hfill \\ \sin \alpha =\frac{10\sin \left(30^\circ \right)}{6.013}\hfill & \text{Multiply both sides of the equation by 10}.\hfill \\ \alpha ={\sin }^{-1}\left(\frac{10\sin \left(30^\circ \right)}{6.013}\right)\begin{array}{cccc}& & & \end{array}\hfill & \text{Find the inverse sine of }\frac{10\sin \left(30^\circ \right)}{6.013}.\hfill \\ \alpha \approx 56.3^\circ \hfill & \hfill \end{array}[/latex]

The other possibility for [latex]\alpha [/latex] would be [latex]\alpha =180^\circ -56.3^\circ \approx 123.7^\circ [/latex]. In the original diagram, [latex]\alpha [/latex] is adjacent to the longest side, so [latex]\alpha [/latex] is an acute angle and, therefore, [latex]123.7^\circ [/latex] does not make sense. Notice that if we choose to apply the Law of Cosines, we arrive at a unique answer. We do not have to consider the other possibilities, as cosine is unique for angles between [latex]0^\circ [/latex] and [latex]180^\circ [/latex]. Proceeding with [latex]\alpha \approx 56.3^\circ [/latex], we can then find the third angle of the triangle.

[latex]\gamma =180^\circ -30^\circ -56.3^\circ \approx 93.7^\circ [/latex]

The complete set of angles and sides is

[latex]\begin{array}{ll}\alpha \approx 56.3^\circ \begin{array}{cccc}& & & \end{array}\hfill & a=10\hfill \\ \beta =30^\circ \hfill & b\approx 6.013\hfill \\ \gamma \approx 93.7^\circ \hfill & c=12\hfill \end{array}[/latex]

Try It 1

Find the missing side and angles of the given triangle: [latex]\alpha =30^\circ ,b=12,c=24[/latex].

Solution

Example 2: Solving for an Angle of a SSS Triangle

Find the angle [latex]\alpha [/latex] for the given triangle if side [latex]a=20[/latex], side [latex]b=25[/latex], and side [latex]c=18[/latex].

Solution

For this example, we have no angles. We can solve for any angle using the Law of Cosines. To solve for angle [latex]\alpha [/latex], we have

[latex]\begin{array}{llll}\hfill & \hfill & \hfill & \hfill \\ \text{ }{a}^{2}={b}^{2}+{c}^{2}-2bc\cos \alpha \hfill & \hfill & \hfill & \hfill \\ \text{ }{20}^{2}={25}^{2}+{18}^{2}-2\left(25\right)\left(18\right)\cos \alpha \hfill & \hfill & \hfill & \text{Substitute the appropriate measurements}.\hfill \\ \text{ }400=625+324 - 900\cos \alpha \hfill & \hfill & \hfill & \text{Simplify in each step}.\hfill \\ \text{ }400=949 - 900\cos \alpha \hfill & \hfill & \hfill & \hfill \\ \text{ }-549=-900\cos \alpha \hfill & \hfill & \hfill & \text{Isolate cos }\alpha .\hfill \\ \text{ }\frac{-549}{-900}=\cos \alpha \hfill & \hfill & \hfill & \hfill \\ \text{ }0.61\approx \cos \alpha \hfill & \hfill & \hfill & \hfill \\ {\cos }^{-1}\left(0.61\right)\approx \alpha \hfill & \hfill & \hfill & \text{Find the inverse cosine}.\hfill \\ \text{ }\alpha \approx 52.4^\circ \hfill & \hfill & \hfill & \hfill \end{array}[/latex]

See Figure 5.

A triangle with standard labels. Side b =25, side a = 20, side c = 18, and angle alpha = 52.4 degrees.

Figure 5

Analysis of the Solution

Because the inverse cosine can return any angle between 0 and 180 degrees, there will not be any ambiguous cases using this method.

Try It 2

Given [latex]a=5,b=7[/latex], and [latex]c=10[/latex], find the missing angles.

Solution