The Law of Cosines relates the three sides of a triangle and one of its angles: \(c^2 = a^2 + b^2 - 2ab\cos C\). It works in any triangle, which is why in 9th grade it replaces the Pythagorean theorem where there is no right angle. It is used to find the third side if two others and the angle between them are known, and its corollary \(\cos C = \frac{a^2 + b^2 - c^2}{2ab}\) is used to find any angle given three sides and the type of triangle. The page includes the statement and all three forms of the formula, its proof, a table of cosines, a "sines or cosines" cheat sheet, solutions to OGE problems, and a trainer for self-checking.
The Law of Cosines: Statement and Formula
The Law of Cosines works in any triangle — it doesn't require a right angle. It relates three sides and one angle, so it's used to find a side if two other sides and the angle between them are known.
Statement. The square of one side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of those sides and the cosine of the angle between them.
Here, \(a\), \(b\), and \(c\) are the sides of the triangle, and \(C\) is the angle between sides \(a\) and \(b\); side \(c\) is opposite this angle. Any letters can be used — the formula is symmetric, so it has three equivalent forms:
The main rule for substitution is: use the angle that is enclosed between the two sides in the product, and find the side opposite it. If you use an adjacent angle, all numbers will be from the condition, and the answer will be incorrect.
Why the Pythagorean Theorem is a Special Case of the Law of Cosines
Let's substitute a right angle into the formula, i.e., \(C = 90°\). The cosine of a right angle is zero, so the third term becomes zero:
This is exactly the Pythagorean theorem, familiar from 8th grade. That's why the Law of Cosines is called its generalization: Pythagoras is a "special case for 90°", while the Law of Cosines works for all angles.
The term \(-2ab\cos C\) can be understood as a correction for the angle not being right:
- if the angle is acute, \(\cos C > 0\) — the correction is subtracted, and side \(c\) turns out to be shorter than Pythagoras would give;
- if the angle is right, \(\cos C = 0\) — there is no correction, \(c^2 = a^2 + b^2\) remains;
- if the angle is obtuse, \(\cos C < 0\) — the correction is added, and side \(c\) turns out to be longer.
Proof of the Law of Cosines
The shortest school proof is using coordinates. Place vertex \(C\) at the origin and side \(b = CA\) along the x-axis. Then the coordinates of the vertices are:
- \(C(0;\ 0)\) — the origin;
- \(A(b;\ 0)\) — a point on the x-axis at distance \(b\) from the origin;
- \(B(a\cos C;\ a\sin C)\) — a vertex at distance \(a\) from the origin at an angle \(C\) to the x-axis.
Side \(c\) is the length of the segment \(AB\). We calculate it using the distance formula between two points:
Expand the parentheses:
Group the terms with \(a^2\) and apply the fundamental trigonometric identity \(\sin^2 C + \cos^2 C = 1\):
Which was to be proven. Note that it was never required for angle \(C\) to be acute. If it is obtuse, the cosine is negative, the coordinate \(a\cos C\) moves to the left of the y-axis, but all calculations remain the same — therefore, the theorem is valid for any triangle.
Corollary: How to Find an Angle Given Three Sides
The Law of Cosines can be rearranged to solve for the cosine of an angle — this is its main corollary. It's used to find an angle when all three sides are known:
The numerator is the sum of the squares of the two sides adjacent to the angle, minus the square of the side opposite it. The denominator is twice the product of the adjacent sides. The formulas for other angles are similar:
Steps for solving:
- Choose the angle you want to find and identify the side opposite it — its square goes in the numerator with a minus sign.
- Calculate the fraction (the denominator is always positive; the sign is determined solely by the numerator).
- Find the angle itself using a table of values or the arccosine function.
A useful tip: start with the longest side. The largest angle is opposite it, and only this angle can be right or obtuse — the other two angles in a triangle are always acute.
Cosines of Obtuse Angles: Table of Values
In school problems, angles are almost always "standard": 30°, 45°, 60°, 90°, 120°, 135°, 150°. Acute angles have positive cosines, right angles have a cosine of zero, and obtuse angles have a negative cosine. Values for obtuse angles are derived from those for acute angles using the reduction formula \(\cos(180° - \alpha) = -\cos\alpha\): for example, \(\cos 120° = -\cos 60° = -0.5\).
What this means in practice: for an obtuse angle, the term \(-2ab\cos C\) becomes a plus — a negative times a negative. For a \(120°\) angle, the formula looks like this:
This is where mistakes are most often made: substituting \(0.5\) instead of \(-0.5\) leads to a side shorter than both given sides, which is impossible. The side opposite an obtuse angle is always the longest side of the triangle.
| Angle | Cosine |
|---|---|
| 30° | √3/2 ≈ 0.87 |
| 45° | √2/2 ≈ 0.71 |
| 60° | 1/2 = 0.5 |
| 90° | 0 |
| 120° | −1/2 = −0.5 |
| 135° | −√2/2 ≈ −0.71 |
| 150° | −√3/2 ≈ −0.87 |
How to Determine the Type of Triangle from Three Sides
The Law of Cosines allows us to determine the type of a triangle without measuring angles with a protractor. The sign of the fraction \(\cos C = \frac{a^2 + b^2 - c^2}{2ab}\) depends only on the numerator: the denominator \(2ab\) is always positive. Therefore, it's sufficient to compare the square of the longest side with the sum of the squares of the other two.
Let \(c\) be the longest side, then the largest angle \(C\) is opposite it:
- \(a^2 + b^2 > c^2\) → \(\cos C > 0\) → angle \(C\) is acute. The other angles are smaller than \(C\), so all three angles are acute — the triangle is acute;
- \(a^2 + b^2 = c^2\) → \(\cos C = 0\) → \(C = 90°\) — the triangle is right (this is the converse of the Pythagorean theorem);
- \(a^2 + b^2 < c^2\) → \(\cos C < 0\) → angle \(C\) is obtuse — the triangle is obtuse.
There's no need to check the other angles: a triangle can have at most one right or obtuse angle. And don't forget the triangle inequality — if the longest side is not less than the sum of the other two, a triangle with such sides cannot exist.
Law of Sines or Cosines: How to Choose
Both theorems solve the same problem — finding unknown sides and angles of a triangle — but are applied with different sets of given information. The Law of Sines relates a side and the angle opposite it:
This leads to the choice rule: if the condition already includes a pair of "side and its opposite angle", use the Law of Sines; if there is no such pair, start with the Law of Cosines. A cheat sheet for the four common sets of given data is in the table.
Often, a problem is solved in two steps: first, the Law of Cosines gives the third side, and then the Law of Sines quickly finds the remaining angles.
| What is known | What to use |
|---|---|
| SASTwo sides and the angle between them | Law of Cosinesto find the third side |
| SSSAll three sides | Law of Cosinesto find any angle and the type of triangle |
| ASAA side and two angles | Law of Sinesto find the other two sides |
| SSATwo sides and an angle opposite one of them | Law of Sinesto find the opposite angle |
Law of Cosines in OGE Problems
The OGE (Basic State Exam) in mathematics includes problems involving the Law of Cosines in plane geometry — both in the first part and in problems requiring a detailed answer. Typical scenarios include:
- Finding a side given two sides and the included angle — direct application of the formula, often with angles of 60° or 120°.
- Finding an angle or its cosine given three sides — using the corollary \(\cos C = \frac{a^2 + b^2 - c^2}{2ab}\). If the problem asks to "find \(\cos\angle A\)", you don't need to calculate the arccosine: the answer is the fraction itself.
- Diagonals of a parallelogram. A diagonal divides the parallelogram into two triangles. The sum of adjacent angles in a parallelogram is 180°, so their cosines are opposite: the shorter diagonal is opposite the acute angle, and the longer one is opposite the obtuse angle.
- Determining the type of triangle from three side lengths — comparing \(a^2 + b^2\) with \(c^2\).
- Median of a triangle. The formula \(m_c = \frac{1}{2}\sqrt{2a^2 + 2b^2 - c^2}\) is derived by applying the Law of Cosines twice to two adjacent angles along the base.
Exam tip: before calculating, mark the angle on the diagram that is "sandwiched" between the known sides. If there is no such angle, the Law of Cosines cannot be applied directly; you need to find another approach.
Examples of Solving Problems with the Law of Cosines
Example 1. Finding a side given two sides and a 60° angle
Problem. In triangle \(ABC\), sides \(a = 7\) and \(b = 15\), and the angle between them is \(C = 60°\). Find side \(c\).
Step 1. Angle \(C\) is between sides \(a\) and \(b\) — this is exactly the case the theorem was designed for:
Step 2. Substitute the numbers, \(\cos 60° = 0.5\):
Step 3. Take the square root: \(c = \sqrt{169} = 13\).
Answer: \(13\). Sanity check: the angle \(60°\) is acute, so the side opposite it shouldn't be the longest — indeed, \(13 < 15\).
Example 2. Obtuse Angle: Negative Times Negative
Problem. In triangle \(ABC\), we know: \(AB = 6\), \(BC = 10\), and angle \(B = 120°\). Find side \(AC\).
Step 1. Angle \(B\) is between sides \(AB\) and \(BC\), and side \(AC\) is opposite it:
Step 2. The angle is obtuse, so \(\cos 120° = -0.5\). The minus sign before the product and the minus sign of the cosine result in a plus:
Step 3. \(AC = \sqrt{196} = 14\).
Answer: \(14\). Sanity check: the longest side is opposite the obtuse angle — \(14\) is greater than both \(6\) and \(10\).
Example 3. Finding an Angle from Three Sides
Problem. The sides of a triangle are \(3\), \(5\), and \(7\). Find its largest angle.
Step 1. The largest angle is opposite the longest side, which is \(7\). Let's call it \(C\), so \(c = 7\), and the adjacent sides are \(a = 3\) and \(b = 5\).
Step 2. Apply the corollary:
Step 3. The cosine is negative — the angle is obtuse. From the table of values, \(\cos 120° = -0.5\), so \(C = 120°\).
Answer: \(120°\). We also found out that the triangle is obtuse.
Example 4. Determining the Type of Triangle
Problem. Determine the type of triangle with sides \(6\), \(7\), and \(10\).
Step 1. Check the triangle inequality: \(6 + 7 = 13 > 10\) — the triangle exists. The longest side is \(10\).
Step 2. Compare the sum of the squares of the two shorter sides with the square of the longest side:
Step 3. \(85 < 100\), so the numerator of the fraction is negative, and \(\cos C < 0\) — the angle opposite side \(10\) is obtuse. If needed, you can find the angle itself:
Answer: The triangle is obtuse. Note: it's not visually obvious — the sides are almost equal, but the angle has already exceeded \(90°\).
Example 5. OGE-Level Problem: Diagonal of a Parallelogram
Problem. The sides of a parallelogram are \(5\) and \(8\), and the acute angle is \(60°\). Find the shorter diagonal.
Step 1. The diagonal divides the parallelogram into a triangle where two sides (\(5\) and \(8\)) and the included angle are known. The shorter diagonal is opposite the acute angle of \(60°\).
Step 2. Calculate:
Step 3. Check. The other diagonal is opposite the \(120°\) angle (adjacent angles in a parallelogram sum to \(180°\)): \(D^2 = 89 + 40 = 129\), so \(D = \sqrt{129} \approx 11.4\). The sum of the squares of the diagonals is \(49 + 129 = 178\), and twice the sum of the squares of the sides is \(2(25 + 64) = 178\). They match, so the calculation is correct.
Answer: \(7\).
Common Mistakes in Law of Cosines Problems
-
Using the cosine of an obtuse angle as positive. For sides $4$ and $9$ with a $120°$ angle between them, writing $c^2 = 16 + 81 - 2 \cdot 4 \cdot 9 \cdot 0.5 = 61$ and getting $c \approx 7.8$.
\(\cos 120° = -0.5\), and a negative times a negative is a positive: \(c^2 = 97 + 36 = 133\), so \(c = \sqrt{133} \approx 11.5\). Quick check: the longest side is opposite the obtuse angle, so the answer must be greater than \(9\).
-
Substituting an angle that is not between the given sides: the problem provides an angle, and it's used without looking at the diagram.
In the formula \(c^2 = a^2 + b^2 - 2ab\cos C\), sides \(a\) and \(b\) form angle \(C\), and side \(c\) is opposite it. If the given angle is adjacent to the side to be found, this form is not suitable — you need one of the other two forms or the Law of Sines.
-
Forgetting to take the square root and writing the square of the side as the answer: getting $c^2 = 225$ and writing "the side is 225".
The formula always gives the square of the side. The last step is mandatory: \(c = \sqrt{225} = 15\). Reread the problem statement before writing the final answer.
-
Confusing the order of terms in the corollary and writing $\cos C = \dfrac{c^2 - a^2 - b^2}{2ab}$.
The correct numerator is \(a^2 + b^2 - c^2\): the sum of the squares of the adjacent sides minus the square of the opposite side. Swapping terms changes the sign of the fraction, leading to an acute angle of \(60°\) instead of an obtuse angle of \(120°\).
-
Finding the angle based on the absolute value of the cosine: getting -0.25 and writing an acute angle as the answer, as if the cosine were +0.25.
A negative cosine always corresponds to an obtuse angle. The sign must not be ignored: cos 60° = 0.5, while cos 120° = −0.5; the arccosine of a negative number is greater than 90°.
-
Trying to solve a "two sides and the included angle" problem using the Law of Sines and getting stuck at the first step.
The Law of Sines requires a pre-existing pair of "side and its opposite angle". With two sides and the included angle, such a pair doesn't exist — first use the Law of Cosines to find the third side, and only then apply the Law of Sines.
Questions and Answers
How is the Law of Cosines stated?
The square of one side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of those sides and the cosine of the angle between them: c² = a² + b² − 2ab·cos C. The theorem is valid for any triangle, not just right-angled ones.
How to find a side of a triangle given two sides and the included angle?
Substitute the data into the formula c² = a² + b² − 2ab·cos C and take the square root. For example, with sides 4 and 6 and an angle of 60° between them: c² = 16 + 36 − 2·4·6·0.5 = 28, so c = √28 ≈ 5.3.
How to find an angle of a triangle if all three sides are known?
Use the corollary of the Law of Cosines: cos C = (a² + b² − c²) / (2ab), where c is the side opposite the angle to be found. For example, with sides 2, 3, and 4, the cosine of the largest angle is (4 + 9 − 16) / (2·2·3) = −0.25, meaning the angle is obtuse, approximately 104°.
Why is the Pythagorean Theorem a special case of the Law of Cosines?
Because when the angle is right, cos 90° = 0, and the term −2ab·cos C vanishes. The formula becomes c² = a² + b², which is the Pythagorean theorem for a right-angled triangle.
Does the Law of Cosines work in an obtuse triangle?
Yes, and it works without modification. The cosine of an obtuse angle is negative, so the term −2ab·cos C becomes positive and is added to the sum of the squares. This is precisely why the side opposite the obtuse angle is the longest.
When to use the Law of Sines and when to use the Law of Cosines?
The Law of Sines is needed when the condition already includes a pair of "side and its opposite angle" — for example, a side and two angles are given. The Law of Cosines is used when such a pair is missing: two sides and the included angle are given, or all three sides are given. Often, a problem is solved in two steps: first use the Law of Cosines, then the Law of Sines.
How to determine the type of triangle from three sides?
Compare the square of the longest side, c², with the sum of the squares of the other two. If a² + b² > c², the triangle is acute; if a² + b² = c², it's right-angled; if a² + b² < c², it's obtuse. The sign of this difference matches the sign of the cosine of the largest angle.
In what grade is the Law of Cosines taught?
In 9th grade geometry classes, in the topic "Relationships Between Sides and Angles of a Triangle" — along with the Law of Sines. It is subsequently used extensively in OGE and ЕГЭ (Unified State Exam) problems in plane and solid geometry.