Bash and Effectiveness
The Law of Cosines is like the bigger, better brother to the Law of Sines. It is used quite often in computational contests (well, at least more than Law of Sines) and is key to bashing an unknown side in terms of a variable, finding a length directly, or finding the cosine of an angle. You can then use this derived length in whatever tools you need (e.g. similar triangles, pythagorean theorem, etc.).
Formula & Derivation
Let's lay out some notation first. In any triangle , we label each side with the lowercase letter of the angle it sits across from, so side is opposite angle , side is opposite , and side is opposite .
Each side is named after the angle it faces.
The Law of Cosines states:
There's nothing special about ; by symmetry, you get one version at each angle:
And if it's the angle you want rather than a side, just solve for the cosine:
Why "generalized Pythagorean theorem"? Set . Then , the last term cancels to 0, and you're left with . The term is indeed the correction for the angle not being right. And note: if is obtuse then , so the term adds to , which is basically what you'd expect from opening the angle wider.
Derivation
The trick is the one that we have stressed many times: drop an altitude and split one annoying triangle into two right triangles, where trigonometry and Pythagoras actually apply.
Drop a perpendicular from onto side , call the foot .
The altitude splits into two right triangles, and .
Look at the right triangle . Its hypotenuse is , and the angle at is our angle , so from trigonometry:
Since the full base has length , the leftover segment is:
Now apply the Pythagorean theorem to the other right triangle, — its legs are and , and its hypotenuse is :
Expand:
Group the two terms and cancel them with :
(If is obtuse, lands outside segment and comes out negative, so the formula still holds.)
Techniques
The Law of Cosines is useful in a variety of ways, one obvious case being finding a missing side length given two side lengths and a known angle between them. However, there is quite some nuance in how it's used at more advanced levels of competition. For instance:
- You may get a side length in terms of a variable and use that new side length as new information to solve further. If this is unclear, consider the examples we present, and as always, practice!
- Solve for the cosine of the angle. You may have similar triangles, and knowing the cosine of that angle can be used in other triangles where that angle is also present.
- Noticing congruent, complementary, or supplementary angles and using how their cosines relate to the cosine of the original angle (e.g. ).
Always match with , with , and with . The side opposite to the angle is the one being solved for in .
Elementary Examples
Example 1: Solving for a side
Find the missing side. In , two sides of length and meet at a angle at vertex . Find the length of the third side .
The angle is enclosed by the two known sides, sitting opposite the unknown side — exactly the configuration the Law of Cosines handles:
Hence .
Example 2: Cosine of an angle in terms of a variable
Express the angle. In , the side has unknown length , while and . Write as a function of .
We want the angle at . It is enclosed by the sides and , and it sits opposite the side . Solving the Law of Cosines for the cosine gives what we want:
Worked Example
2026 AIME I · Problem 5. Points and lie in a plane with . Rotate counterclockwise about through an acute angle to land at ; then rotate clockwise about through the same angle to land at . Given that , write in lowest terms and find .
Solid: the parallelogram . Dashed: its diagonals, meeting at the midpoint .
Rotation preserves distance to its center, so , and then . Hence three of the four connecting segments equal , with given.
Because the two rotations turn into , the points form a parallelogram whose diagonals are and . Diagonals bisect each other at , so
The rotation angle is exactly , which is the angle at in (since lies on ). That triangle has sides and enclosing , opposite the side . Apply the Law of Cosines:
Therefore , giving .
Practice Problems
| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
| AMC 12A | Hard | Show TagsCircles, Geometry, Tangency | ||||
| AMC 12A | Hard | Show TagsCyclic Quadrilateral, Geometry, Law of Cosines | ||||
| Berkeley Math Circle Monthly Contest 3 | Hard | Show TagsDistance chasing, Triangle trigonometry | ||||
| MathNet | Hard | Show TagsTangents, Triangle trigonometry | ||||
| MathNet | Hard | Show TagsOptimization in geometry, Triangle trigonometry, Trigonometry | ||||
| Berkeley Math Circle: Monthly Contest 7 | Hard | Show TagsConstructions and loci, Triangle trigonometry | ||||
| Berkeley Math Circle Monthly Contest 1 | Hard | Show TagsAngle chasing, Tangents, Triangle trigonometry | ||||
| Berkeley Math Circle Monthly Contest 2 | Hard | Show TagsAngle chasing, Cyclic quadrilaterals, Triangle trigonometry | ||||
| Berkeley Math Circle Monthly Contest 3 | Hard | Show TagsAngle chasing, Triangle trigonometry | ||||
| Berkeley Math Circle | Hard | Show TagsAngle chasing, Triangle trigonometry | ||||
| MathNet | Hard | Show Tags3D Shapes, Triangle trigonometry, Trigonometry, Volume | ||||
| Berkeley Math Circle | Hard | Show TagsAngle chasing, Spiral similarity, Triangle trigonometry | ||||
| MathNet | Hard | Show TagsOptimization in geometry, Triangle centers: centroid, incenter, circumcenter, orthocenter, Euler line, nine-point circle, Triangle trigonometry | ||||
| Berkeley Math Circle: Monthly Contest 7 | Hard | Show TagsAngle chasing, Constructions and loci, Triangle centers: centroid, incenter, circumcenter, orthocenter, Euler line, nine-point circle, Triangle trigonometry | ||||
| Berkeley Math Circle Monthly Contest 7 | Hard | Show TagsAngle chasing, Triangle trigonometry | ||||
| Berkeley Math Circle: Monthly Contest 7 | Hard | Show TagsDistance chasing, Triangle centers: centroid, incenter, circumcenter, Euler line, nine-point circle, Triangle trigonometry | ||||
| Berkeley Math Circle Monthly Contest 2 | Hard | Show TagsDistance chasing, Tangents, Triangle trigonometry | ||||
| Berkeley Math Circle Monthly Contest 2 | Hard | Show TagsAngle chasing, Cyclic quadrilaterals, Triangle trigonometry | ||||
| Harvard-MIT Math Tournament | Hard | Show TagsAngle chasing, Triangle trigonometry | ||||
| Harvard-MIT Math Tournament | Hard | Show TagsTriangle trigonometry, Trigonometry | ||||
| USA IMO | Hard | Show TagsAngle chasing, Triangle centers: centroid, incenter, circumcenter, orthocenter, Euler line, nine-point circle, Triangle inequalities, Triangle trigonometry | ||||
| Harvard-MIT Math Tournament | Hard | Show TagsTriangle trigonometry, Trigonometry | ||||
| Harvard-MIT Math Tournament | Hard | Show TagsAngle chasing, Circles, Rotation, Triangle trigonometry | ||||
Module Progress:
Join the Discord Community!
Stuck on a problem, or don't understand a module? Join the Discord and get help with your doubts while making more math friends.
