Law of Cosines – Examples and Practice Problems

The law of cosines is an equation that relates the lengths of two sides of a triangle and their intermediate angle. We can apply the law of cosines when we want to find the length of the third side of a triangle and we know the other two sides and their intermediate angle. Furthermore, we can also apply the law of cosines when we want to find an angle and we have the lengths of the three sides of the triangle.

Here, we will do a review of the law of cosines. Then, we will use a formula to solve some practice problems.

TRIGONOMETRY
diagram of the law of cosines

Relevant for

Exploring some solved examples of the law of cosines.

See examples

TRIGONOMETRY
diagram of the law of cosines

Relevant for

Exploring some solved examples of the law of cosines.

See examples

Summary of the law of cosines

The law of cosines has different variations depending on the sides and angles that we consider. The following are the formulas for the law of cosines of a triangle ABC:

$latex {{a}^2}={{b}^2}+{{c}^2}-2bc\cos(\alpha)$

$latex {{b}^2}={{a}^2}+{{c}^2}-2ac\cos(\beta)$

$latex {{c}^2}={{a}^2}+{{b}^2}-2ab\cos(\gamma)$

where, a, b, c represent the lengths of the sides of the triangle and α, β, γ represent the angles of the triangle ABC shown in the diagram below.

triangle with sides and different angles

The law of cosines can be applied when we have the following situations:

  • We have the lengths of two sides of a triangle and the angle between these sides and we want to find the length of the third side.
  • We have the lengths of the three sides of the triangle and we want to find the measure of any angle.

For example, in the triangle above, we can apply the law of cosines if we have the lengths of sides a and b and the measure of angle γ and we want to find the length of c. Also, we can apply the law of cosines if we have the lengths of a, b, c and we want to find the measure of any angle.


Law of cosines – Examples with answers

The formulas for the law of cosines are used to solve the following application examples. Each example has its respective answer, but try to solve the problems yourself before looking at the answer.

EXAMPLE 1

In a triangle we have the lengths a=8 and b=9 and the angle C=50°. What is the length of c?

We have the following values:

  • a=8
  • b=9
  • C=50°

We find the length of side c using the law of cosines:

$latex {{c}^2}={{a}^2}+{{b}^2}-2ab~\cos(C)$

$latex {{c}^2}={{8}^2}+{{9}^2}-2(8)(9)~\cos(50)$

$latex {{c}^2}=64+81-92.56$

$latex {{c}^2}=52.44$

$latex c=7.24$

The length of c is 7.24.

EXAMPLE 2

In a triangle, we have the lengths b=12 and c=10 and the angle A=35°. What is the length of side a?

We have the following information:

  • b=12
  • c=10
  • A=35°

Using the law of cosines with these values, we have:

$latex {{a}^2}={{b}^2}+{{c}^2}-2bc~\cos(A)$

$latex {{a}^2}={{12}^2}+{{10}^2}-2(12)(10)~\cos(35)$

$latex {{a}^2}=144+100-196.6$

$latex {{a}^2}=47.4$

$latex a=6.88$

The length of a is 6.88.

EXAMPLE 3

What is the measure of angle A in a triangle that has sides of length a=7, b=8, and c=6?

We have the following lengths:

  • a=7
  • b=8
  • c=6

This is an example where we have to use the law of cosines to find an angle. Therefore, we have:

$latex {{a}^2}={{b}^2}+{{c}^2}-2bc~\cos(A)$

$latex {{7}^2}={{8}^2}+{{6}^2}-2(8)(6)~\cos(A)$

$latex 49=64+36-2(8)(6)~\cos(A)$

$latex 49=100-96~\cos(A)$

$latex 96~\cos(A)=51$

$latex A={{\cos}^{-1}}(\frac{51}{96})$

$latex A=57.9$°

Angle A measures 57.9°.

EXAMPLE 4

If we have sides a=9, b=11, and c=10 in a triangle, what is the measure of angle C?

We have the following data:

  • a=9
  • b=11
  • c=10

We use these values in the law of cosines and solve for angle C:

$latex {{c}^2}={{a}^2}+{{b}^2}-2ab~\cos(C)$

$latex {{10}^2}={{9}^2}+{{11}^2}-2(9)(11)~\cos(C)$

$latex 100=81+121-2(9)(11)~\cos(C)$

$latex 100=202-198~\cos(C)$

$latex 198~\cos(C)=102$

$latex C={{\cos}^{-1}}(\frac{102}{198})$

$latex C=59$°

Angle C measures 59°.


Law of cosines – Practice problems

Apply the different formulas of the law of cosines to solve the following problems. Select an answer and check it to see if you got the correct answer.

If we have a=3, b=4, and C=50° in a triangle, what is the value of c?

Choose an answer






We have the lengths b=12, c=10, and the angle A=75° in a triangle. What is the length of a?

Choose an answer






If we have a=6, b=7, c=10 in a triangle, what is the value of A?

Choose an answer







See also

Interested in learning more about the law of sines and cosines? Take a look at these pages:

Profile picture for author Jefferson Huera Guzman

Jefferson Huera Guzman

Jefferson is the lead author and administrator of Neurochispas.com. The interactive Mathematics and Physics content that I have created has helped many students.

Learn mathematics with our additional resources in different topics

LEARN MORE