Law of Cosines Notes
These Law of Cosines Notes explain how to find a missing side or a missing angle in a triangle that has no right angle, with the working shown line by line. Two sides with the angle between them give the third side, while three sides give the angle facing one of them, so what is given decides which form of the law is written down. The rest is substituting and simplifying what is left. Following the same pattern every time keeps the two cases apart.
In the diagram, each side is named after the angle opposite it: \(a\) faces \(A\), \(b\) faces \(B\) and \(c\) faces \(C\).
Step-by-step method
- Set up the problem.
- Write the Law of Cosines in the form that fits what is given.
- Rearrange the formula to make the missing value the subject.
- Substitute the given values into the formula.
- Solve for the missing value.
Formula: Law of Cosines for a Side
This form gives side c from sides a and b and the angle C between them.
Formula: Law of Cosines for an Angle
This form gives angle C from all three sides, where c is the side opposite C.
Useful Tips to Remember
Use the law of cosines when you know two sides and the angle between them, or all three sides. In \(c^2 = a^2 + b^2 - 2ab\cos C\), the angle \(C\) must be opposite the side \(c\). Work out \(2ab\cos C\) as one value before subtracting it. An obtuse angle has a negative cosine, which makes the third side longer.
Required knowledge
- How to square two sides, add them and take the square root, covered in the Pythagoras' Theorem Calculator.
- What sine, cosine and tangent mean and how to find them, covered in the Trigonometric Ratio Calculator.
Where Is the Law of Cosines Used?
The law of cosines, \(c^2 = a^2 + b^2 - 2ab\cos C\), extends Pythagoras' theorem to triangles without a right angle. It finds the third side when two sides and the angle between them are known, or any angle when all three sides are known. Surveyors use it to measure distances across lakes and fields, navigators use it to find the distance between two ships or planes, and engineers use it to design frames and trusses. It also gives the distance between two objects from their bearings and ranges.
- Measuring distances across rivers, lakes and fields
- Finding the distance between two ships or aircraft
- Designing trusses, frames and robot arms
- Working out the angles of a triangular plot from its sides
- Calculating distances between radar positions
Law of Cosines Practice Problems
Example 1 finds the third side from \(a = 6\), \(b = 9\) and \(C = 45^\circ\), and Example 2 finds an angle from the three sides 5, 6 and 7. Examples 3 and 4 give you two more of the same kind to try, \(a = 7,\; b = 10,\; C = 60^{\circ}\) and \(a = 8,\; b = 9,\; c = 12\). Try each one yourself before opening the examples.
The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. Try each problem on paper first, then open the example and check your working one step at a time, so you can see exactly which step went wrong if your answer does not match. Use them to check your answers and to understand why each step works.
See Example 1 Hide Example 1
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the Law of Cosines in the form that fits what is given.
- Rearrange the formula to make the missing value the subject.
- Substitute the given values into the formula.
- Solve for the missing value.
Formula
Formula: Law of Cosines for a Side
This form gives side c from sides a and b and the angle C between them.
Step 1
Step 1 - Set up the problem.
In this problem: Two sides and the angle between them are known: \(a = 6\), \(b = 9\) and \(C = 45^{\circ}\), and side \(c\) is missing.
Step 2
Step 2 - Write the Law of Cosines in the form that fits what is given.
In this problem: The angle sits between the two known sides, so the form that solves for the third side is \(c^{2} = a^{2} + b^{2} - 2ab\cos(C)\).
Step 3
Step 3 - Rearrange the formula to make the missing value the subject.
In this problem: Making \(c\) the subject gives \(c = \sqrt{a^{2} + b^{2} - 2ab\cos(C)}\), worked through below. \(c\) is a length, so only the positive square root is kept.
Problem
Approach
Step-by-step method
- Set up the problem. Read the equation and note which variable is to become the subject.
- Expand and simplify. Remove the brackets and combine the like terms on each side, covered in the Simplifying Algebraic Expressions Calculator.
- Clear the fractions. Multiply both sides by the least common multiple of the denominators, covered in the Least Common Multiple Calculator.
- Collect the subject terms. Bring every term that holds the subject onto one side.
- Collect the remaining terms. Move every term without the subject onto the other side.
- Factor the subject. When the subject appears in more than one term, write it once outside a bracket so the whole side carries a single subject.
- Isolate the subject. Undo whatever still multiplies the subject, so it stands on its own.
- Undo the square. When the subject is squared, take the square root of both sides, which gives a positive and a negative answer.
Depending on the equation, some of these steps are not needed, so they are skipped.
Step 1
Step 1 - Set up the problem. Read the equation and note which variable is to become the subject.
In this problem: The equation is \(c^{2} = a^{2} + b^{2} - 2ab{\cos\left(C\right)}\) and \(c^{2}\) is to become the subject.
Step 2
Step 2 - Undo the square. When the subject is squared, take the square root of both sides, which gives a positive and a negative answer.
In this problem: \(c^{2}\) is on its own, so taking the square root of both sides gives \(c = \pm\sqrt{a^{2} + b^{2} - 2ab{\cos\left(C\right)}}\).
Final Answer
Step 4
Step 4 - Substitute the given values into the formula.
In this problem: Replacing \(a\), \(b\) and \(C\) with \(6\), \(9\) and \(45^{\circ}\) gives \(c = \sqrt{6^{2} + 9^{2} - 2 \times 6 \times 9 \times \cos(45^{\circ})}\).
Step 5
Step 5 - Solve for the missing value.
In this problem: Working out the square root gives \(c \approx 6.37\).
Final Answer
See Example 2 Hide Example 2
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the Law of Cosines in the form that fits what is given.
- Rearrange the formula to make the missing value the subject.
- Substitute the given values into the formula.
- Solve for the missing value.
Formula
Formula: Law of Cosines for an Angle
This form gives angle C from all three sides, where c is the side opposite C.
Step 1
Step 1 - Set up the problem.
In this problem: All three sides are known: \(a = 5\), \(b = 6\) and \(c = 7\), and angle \(C\) is missing.
Step 2
Step 2 - Write the Law of Cosines in the form that fits what is given.
In this problem: The missing value is the angle opposite side \(c\), so the form that solves for the angle is \(\cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab}\).
Step 3
Step 3 - Rearrange the formula to make the missing value the subject.
In this problem: Taking the inverse cosine of both sides makes \(C\) the subject: \(C = \cos^{-1}\left(\frac{a^{2} + b^{2} - c^{2}}{2ab}\right)\).
Step 4
Step 4 - Substitute the given values into the formula.
In this problem: Replacing \(a\), \(b\) and \(c\) with \(5\), \(6\) and \(7\) gives \(C = \cos^{-1}\left(\frac{5^{2} + 6^{2} - 7^{2}}{2 \times 5 \times 6}\right)\).
Step 5
Step 5 - Solve for the missing value.
In this problem: Working this out gives \(C \approx 78.46^{\circ}\).
Final Answer
See Example 3 Hide Example 3
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the Law of Cosines in the form that fits what is given.
- Rearrange the formula to make the missing value the subject.
- Substitute the given values into the formula.
- Solve for the missing value.
Formula
Formula: Law of Cosines for a Side
This form gives side c from sides a and b and the angle C between them.
Step 1
Step 1 - Set up the problem.
In this problem: Two sides and the angle between them are known: \(a = 7\), \(b = 10\) and \(C = 60^{\circ}\), and side \(c\) is missing.
Step 2
Step 2 - Write the Law of Cosines in the form that fits what is given.
In this problem: The angle sits between the two known sides, so the form that solves for the third side is \(c^{2} = a^{2} + b^{2} - 2ab\cos(C)\).
Step 3
Step 3 - Rearrange the formula to make the missing value the subject.
In this problem: Making \(c\) the subject gives \(c = \sqrt{a^{2} + b^{2} - 2ab\cos(C)}\), worked through below. \(c\) is a length, so only the positive square root is kept.
Problem
Approach
Step-by-step method
- Set up the problem. Read the equation and note which variable is to become the subject.
- Expand and simplify. Remove the brackets and combine the like terms on each side, covered in the Simplifying Algebraic Expressions Calculator.
- Clear the fractions. Multiply both sides by the least common multiple of the denominators, covered in the Least Common Multiple Calculator.
- Collect the subject terms. Bring every term that holds the subject onto one side.
- Collect the remaining terms. Move every term without the subject onto the other side.
- Factor the subject. When the subject appears in more than one term, write it once outside a bracket so the whole side carries a single subject.
- Isolate the subject. Undo whatever still multiplies the subject, so it stands on its own.
- Undo the square. When the subject is squared, take the square root of both sides, which gives a positive and a negative answer.
Depending on the equation, some of these steps are not needed, so they are skipped.
Step 1
Step 1 - Set up the problem. Read the equation and note which variable is to become the subject.
In this problem: The equation is \(c^{2} = a^{2} + b^{2} - 2ab{\cos\left(C\right)}\) and \(c^{2}\) is to become the subject.
Step 2
Step 2 - Undo the square. When the subject is squared, take the square root of both sides, which gives a positive and a negative answer.
In this problem: \(c^{2}\) is on its own, so taking the square root of both sides gives \(c = \pm\sqrt{a^{2} + b^{2} - 2ab{\cos\left(C\right)}}\).
Final Answer
Step 4
Step 4 - Substitute the given values into the formula.
In this problem: Replacing \(a\), \(b\) and \(C\) with \(7\), \(10\) and \(60^{\circ}\) gives \(c = \sqrt{7^{2} + 10^{2} - 2 \times 7 \times 10 \times \cos(60^{\circ})}\).
Step 5
Step 5 - Solve for the missing value.
In this problem: Working out the square root gives \(c \approx 8.89\).
Final Answer
See Example 4 Hide Example 4
Problem
Approach
Step-by-step method
- Set up the problem.
- Write the Law of Cosines in the form that fits what is given.
- Rearrange the formula to make the missing value the subject.
- Substitute the given values into the formula.
- Solve for the missing value.
Formula
Formula: Law of Cosines for an Angle
This form gives angle C from all three sides, where c is the side opposite C.
Step 1
Step 1 - Set up the problem.
In this problem: All three sides are known: \(a = 8\), \(b = 9\) and \(c = 12\), and angle \(C\) is missing.
Step 2
Step 2 - Write the Law of Cosines in the form that fits what is given.
In this problem: The missing value is the angle opposite side \(c\), so the form that solves for the angle is \(\cos(C) = \frac{a^{2} + b^{2} - c^{2}}{2ab}\).
Step 3
Step 3 - Rearrange the formula to make the missing value the subject.
In this problem: Taking the inverse cosine of both sides makes \(C\) the subject: \(C = \cos^{-1}\left(\frac{a^{2} + b^{2} - c^{2}}{2ab}\right)\).
Step 4
Step 4 - Substitute the given values into the formula.
In this problem: Replacing \(a\), \(b\) and \(c\) with \(8\), \(9\) and \(12\) gives \(C = \cos^{-1}\left(\frac{8^{2} + 9^{2} - 12^{2}}{2 \times 8 \times 9}\right)\).
Step 5
Step 5 - Solve for the missing value.
In this problem: Working this out gives \(C \approx 89.6^{\circ}\).
Final Answer
Calculator and Practice Mode
Want to check your own working? The Law of Cosines Calculator solves any problem you type in and shows every step, so you can compare it line by line with your answer and find exactly where a mistake crept in. When you are ready to test yourself, Law of Cosines Practice gives you a new problem at Easy, Medium or Hard level, checks your answer and shows the full working whenever you get one wrong. Practice Mode is available on the Plus and Pro plans.