Law of sines and cosines

The laws of sine and cosine are relations that allow us to find the length of one side of a triangle or the measure of one of its angles. Depending on the information we have available, we can use the law of sines or the law of cosines. The law of sines relates the length of one side to the sine of its angle and the law of cosines relates the length of two sides of the triangle to their intermediate angle. Here, we will learn about the formulas of the law of sines and the law of cosines. We will learn to differentiate the situations in which we can use the law of sines from the situations in which we can use the law of cosines. In addition, we will see some practice exercises.

TRIGONOMETRY
triangle to derive the law of cosines

Relevant for...

Learning about the the law of sines and cosines with examples.

See examples

TRIGONOMETRY
triangle to derive the law of cosines

Relevant for...

Learning about the the law of sines and cosines with examples.

See examples

What is the formula for the law of sines?

The law of sines formula is an equation that relates the sides of a triangle to the sines of their respective angles. The following is the formula for the law of sines:

\frac{a}{\sin(A)}=\frac{b}{\sin(B)}=\frac{c}{\sin(C)}

 

where, a, b, c represent the lengths of the sides of the triangle and A, B, C represent the angles of the triangle. The angles denote their opposite sides. This means that a is the side opposite angle A, b is the side opposite angle B and c is the side opposite angle C as we can see in the following triangle.

triangle with angles and sides

What is the formula for the law of cosines?

The formula for the law of cosines is an equation that relates the lengths of two sides of a triangle to the angle between the two sides. The formula for the law of cosines is:

{{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)

 

where, a, b, c represent the lengths of the sides of the triangle and α, β, γ represent the angles of the triangle as shown in the following image.

triangle with sides and different angles

When to use the law of sines and when to use the law of cosines?

The law of sines can be used when we have the following situations:

We want to find the length of one side and we know the measure of two angles and the length of one side.

We want to calculate an angle and we know the measure of two sides and an angle.

To use the law of sines, we have to relate the angles to their opposite sides. For example, we can apply the law of sines in the following triangle if we want to find the length of side b and we know the measure of angles A, B and the length of side a. Alternatively, we can also apply the law of sines if we want to find the measure of angle A and know the lengths of the sides a, b, and the measure of angle B.

triangle with angles and sides

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

We want to find the length of one side and we know the lengths of two sides and their intermediate angle.

We want to find the measure of any angle and we know the lengths of the three sides of the triangle.

To use the law of cosines, we always use the angle between the two known sides. For example, we can apply the law of cosines if we want to find the length of side c in the triangle below and we know the lengths of a and b and the measure of angle γ.

triangle with sides and different angles

Examples with answers of the law of sines and cosines

The following exercises are solved using the laws of sine and cosine. Each exercise has its respective answer, but it is recommended that you try to solve the exercises yourself before looking at the solution.

EXAMPLE 1

We have a triangle with the angles A=40° and B=50° and we have the side a=12. What is the length of side b?

Solution
We have the following information:

  • A=40°
  • B=50°
  • a=12

In this case, we can use the law of sines. Therefore, we have:

\frac{a}{\sin(A)}=\frac{b}{\sin(B)}

\frac{12}{\sin(40)}=\frac{b}{\sin(50)}

\frac{10}{0.643}=\frac{b}{0.766}

15.55=\frac{b}{0.766}

b=15.55(0.766)

b=11.9

The length of b is 11.9.

EXAMPLE 2

What is the measure of angle A in a triangle if we have a=10, B=30°, and b=8?

Solution
We have the following values:

  • a=10
  • B=30°
  • b=8

We use the law of sines again. Therefore, we have:

\frac{a}{\sin(A)}=\frac{b}{\sin(B)}

\frac{10}{\sin(A)}=\frac{8}{\sin(30)}

\frac{10}{\sin(A)}=\frac{8}{0.5}

\frac{10}{\sin(A)}=16

\sin(A)=\frac{10}{16}

Now, we find the measure of the angle using the inverse sine function:

A={{\sin}^{-1}}(\frac{10}{16})

A=38.7°

Angle A measures 38.7°.

EXAMPLE 3

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

Solution
We extract the following values:

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

In this case, we can use the law of cosines to find the length of a:

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

{{a}^2}={{12}^2}+{{10}^2}-2(12)(10)~\cos(45)

{{a}^2}=144+100-169.7

{{c}^2}=74.3

c=8.62

The length of a is 8.62.

EXAMPLE 4

In a triangle, we have the sides a=7, b=8, and c=9. What is the measure of angle C?

Solution
We have the following information:

  • a=7
  • b=8
  • c=9

Again, we use the law of cosines. Therefore, when solving for angle C, we have:

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

{{9}^2}={{7}^2}+{{8}^2}-2(7)(8)~\cos(C)

81=49+64-2(7)(8)~\cos(C)

81=113-112~\cos(C)

112~\cos(C)=32

C={{\cos}^{-1}}(\frac{32}{112})

C=73.4°

Angle C measures 73.4°.

Law of sines and cosines – Exercises to solve

Use the law of sines and the law of cosines to solve the following practice exercises. Select an answer and click “Check” to check that you got the correct answer.

In a triangle, we have a=15, b=20, and A=40°. What is the value of B?

Choose an answer






What is the value of c if we have a=7, A=28°, and C=55°?

Choose an answer






We have the lengths a=6, b=7 and c=8, what is the value of angle C?

Choose an answer






What is the length of c if we have sides a=8 and b=7 and angle C=40°?

Choose an answer






See also

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

 

Learn mathematics with our additional resources in different topics