Shapes like triangles are everywhere.
Triangles have three sides and three corners.
Imagine you have a triangle. You know the length of two sides. You also know the angle between them. How long is the third side? The law of cosines helps you find out. 
Imagine you are looking at a triangle. You might know the lengths of two sides and the angle between them. You might also know all three side lengths but none of the angles. The law of cosines is a special math rule that helps you solve these puzzles. It connects the lengths of the sides to the cosine of an angle. This rule is very helpful because it works for every kind of triangle.
How does this rule actually work? It uses the sides and an angle to find a missing piece of information. If you have two sides and the angle between them, you can find the third side. You can also use it to find the angles if you already know all three sides.
People have been studying these triangle rules for a very long time. Around 300 BC, a mathematician named Euclid wrote about these ideas in his book called Elements. He did not use modern symbols, but he talked about the areas of rectangles. Later, mathematicians in India developed trigonometry with sines and cosines.
Many different thinkers added to this math over the centuries. Jamshīd al-Kāshī was a Persian mathematician who lived in the 15th century. He was very good at making accurate math tables. In France, some people call this rule the théorème d'Al-Kashi to honor his work. 
You can see how this rule links to things you already know. It builds directly on the Pythagorean theorem that you might have learned. If you use the law of cosines on a right triangle, it turns back into that simpler theorem. 
The law of cosines is a fundamental principle in trigonometry. It provides a mathematical relationship between the side lengths of a triangle and the cosine of one of its angles. This rule is essential for solving triangles, which means finding unknown side lengths or interior angles. While the famous Pythagorean theorem is limited to right triangles, the law of cosines is much more versatile. It applies to any triangle, whether it is acute, right, or obtuse.
To understand how the law works, consider its mechanism in solving for missing values. If you know the lengths of two sides and the angle between them, you can calculate the third side. This is often called the side-angle-side case. If you know all three side lengths, you can use the formula to find any of the three angles.
There are different ways to categorize the triangles used in this law. An acute triangle has all angles less than 90 degrees. An obtuse triangle has one angle greater than 90 degrees. A right triangle has exactly one 90-degree angle. The law of cosines handles these cases through the properties of the cosine function. For an acute angle, the cosine value is positive. For an obtuse angle, the cosine value is negative.
The history of this concept spans thousands of years and many cultures. Around 300 BC, the Greek mathematician Euclid described a geometric version of this rule in his work, *Elements*. He did not use modern algebraic notation, but instead expressed the idea through the areas of rectangles. Later, Hellenistic trigonometry and Indian mathematicians developed the concepts of sine and cosine. In the 11th century, al-Bīrūnī used these trigonometric principles to solve astronomical problems.
Significant contributions continued through the 15th century with Jamshīd al-Kāshī. He was a Persian mathematician known for computing highly accurate trigonometric tables. He described methods for solving triangles that were later consolidated into the modern formula. Because of his influence, the law of cosines is sometimes called the *théorème d'Al-Kashi* in France. 
Modern mathematicians use various methods to prove the law of cosines. One common approach uses the Pythagorean theorem by dropping an altitude to create two right triangles. Another method uses coordinate geometry. By placing a triangle on a Cartesian coordinate system, one can use the distance formula to derive the law. 
The law of cosines connects many different branches of mathematics. It serves as a bridge between geometry and algebra. It also links trigonometry to the study of vectors through the dot product. Furthermore, it relates to the study of circles via Ptolemy's theorem. Even in advanced fields like spherical trigonometry, versions of this law are used to understand shapes on a curved surface. This interconnectedness makes the law of cosines a vital tool in both theoretical math and practical science.
🖼️ Images & Media (18)
+ 6 more
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.