Download Careers360 App
Law of Cosines: Proof and Examples

Law of Cosines: Proof and Examples

Edited By Komal Miglani | Updated on Jul 02, 2025 07:42 PM IST

The solution of triangles involves the application of properties, rules, and theorems to analyze them more deeply. Some of these rules are the Sine rule, Cosine rule, Tangent rule, Projection rule, etc. These rules can be applied to analyze triangles involved in different cases. The law of cosines (also known as the cosine formula or cosine rule) relates the lengths of the sides of a triangle to the cosine of one of its angles. In real life, we use the Law of cosine in radio waves, tides, musical tones, and electrical currents.

This Story also Contains
  1. Triangle
  2. Law of Cosines: definition
  3. Cosine Rule
  4. Solved Examples Based on Cosine Rule
Law of Cosines: Proof and Examples
Law of Cosines: Proof and Examples

In this article, we will cover the concept of the cosine rule. This category falls under the broader category of Trigonometry, which is a crucial Chapter in class 11 Mathematics. It is not only essential for board exams but also for competitive exams like the Joint Entrance Examination(JEE Main) and other entrance exams such as SRMJEE, BITSAT, WBJEE, BCECE, and more. Over the last ten years of the JEE Main exam (from 2013 to 2023), a total of eleven questions have been asked on this concept, including three in 2014, two in 2015, two in 2016, two in 2017, one in 2019 and one in 2023.

Triangle

A triangle is a polygon with 3 sides. A triangle is more special as compared to other polygons as it is the polygon having the least number of sides. A triangle has six main elements, three sides, and three angles. There are different rules and theorems for triangles that relate their sides and angles.

A few standard symbols to represent elements of the triangle:

In $\triangle A B C$, the angles are denoted by capital letters $A, B$, and $C$ and the length of the sides opposite to these angles are denoted by small letters $a, b$, and $c$ respectively.

The following symbols in relation to $\triangle \mathrm{ABC}$ are universally adopted.
Angles: $\angle B A C=A, \angle A B C=B, \angle B C A=C$
Sides: $A B=c, A C=b$, and $B C=a$
Semi-perimeter of the $\triangle A B C$, is

$
s=\frac{a+b+c}{2}
$

and it is denoted by $s$. So, the perimeter of $\triangle A B C$ is $2 s=a+b+c$.

The area of a triangle is denoted by S or Δ.

For any $\triangle A B C$,

  • $\mathrm{A}+\mathrm{B}+\mathrm{C}=180^{\circ}$
  • $a+b>c, b+c>a$ and $c+a>b$
  • $a>0, b>0, c>0$
NEET Highest Scoring Chapters & Topics
This ebook serves as a valuable study guide for NEET exams, specifically designed to assist students in light of recent changes and the removal of certain topics from the NEET exam.
Download E-book

Law of Cosines: definition

The Law of Cosines states that the square of any side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of the other two sides and the cosine of the included angle.

Cosine Rule

The law of cosine also called the cosine rule is used to connect the side of a triangle with the angle. If we know the three sides of the triangle then by using the cosine rule we can find the cosine of the three angles of a triangle.

For a triangle ABC with angles A, B, and C, and opposite corresponding sides a, b, and c, respectively, the Law of Cosines is given as three equations.

$\cos A=\frac{b^2+c^2-a^2}{2 b c} \quad \cos B=\frac{a^2+c^2-b^2}{2 a c} \quad \cos C=\frac{a^2+b^2-c^2}{2 a b}$

Proof:

Drop a perpendicular from C to the x -axis (this is the altitude or height). Recalling the basic trigonometric identities, we know that

$
\cos \theta=\frac{x(\text { adjacent })}{b(\text { hypotenuse })} \text { and } \sin \theta=\frac{y(\text { opposite })}{b(\text { hypotenuse })}
$
In terms of $\theta, x=b \cos \theta$ and $y=b \sin \theta$. The $(x, y)$ point located at $C$ has coordinates $(b \cos \theta, b \sin \theta)$.
Using the side $(\mathrm{x}-\mathrm{c})$ as one leg of a right triangle and y as the second leg, we can find the length of hypotenuse a using the Pythagoras Theorem. Thus,

$
\begin{aligned}
a^2= & (x-c)^2+y^2 \\
= & (b \cos \theta-c)^2+(b \sin \theta)^2 \\
& \quad[\text { Substitute }(b \cos \theta) \text { for } x \text { and }(b \sin \theta) \text { for } y] \\
= & \left(b^2 \cos ^2 \theta-2 b c \cos \theta+c^2\right)+b^2 \sin ^2 \theta
\end{aligned}
$

[Expand the perfect square.]

$
=b^2 \cos ^2 \theta+b^2 \sin ^2 \theta+c^2-2 b c \cos \theta
$

[Group terms noting that $\cos ^2 \theta+\sin ^2 \theta=1$ ]

$
=b^2\left(\cos ^2 \theta+\sin ^2 \theta\right)+c^2-2 b c \cos \theta
$

$\left[\right.$ Factor out $\left.b^2\right]$

$
a^2=b^2+c^2-2 b c \cos \theta
$
Now as $\theta$ equals angle $A$
In triangle ABC,

$
\begin{aligned}
& a^2=b^2+c^2-2 b c \cdot \cos A \\
& \cos A=\frac{b^2+c^2-a^2}{2 b c}
\end{aligned}
$

The above proof does not change if angle A is a right angle or an obtuse angle.

Similarly, we can derive formulae for cos B and cos C.

Note:

1) If the lengths of the three sides of a triangle are known, we can find all the angles by using the cosine rule.

$
\text { 2) If two sides (say } \mathrm{b} \text { and } \mathrm{c} \text { ) and the included angle } \mathrm{A} \text { are given, the cosine rule } \cos \mathrm{A}=\frac{\left(b^2+c^2-a^2\right)}{(2 b c)} \text { will give us a, and then knowing a, } \mathrm{b}, \mathrm{c} \text { we can find } \mathrm{B} \text { and } \mathrm{C} \text { by the cosine rule. }
$

Applications of Cosine Law

1) With the help of cosine law, we can find the angle of a triangle if its three sides are given.

2) We can use cosine law to find the side length of the triangle if it's all three angles are known or one angle and two side lengths are known.

Recommended Video Based on Law of Cosine Rule:

Solved Examples Based on Cosine Rule

Example 1: In a triangle ABC, if cos A + 2 cos B + cos C = 2 and the lengths of the sides are opposite to the angles A and C are 3 and 7 respectively, then cos A – cos C is equal to: [JEE MAINS 2023]

Solution:

$
\begin{aligned}
& \cos \mathrm{A}+\cos \mathrm{C}=2(1-\cos \mathrm{B}) \\
& 2 \cos \frac{\mathrm{A}+\mathrm{C}}{2} \cos \frac{\mathrm{A}-\mathrm{C}}{2}=4 \sin ^2 \mathrm{~B} / 2 \\
& \text { as } \cos \left(\frac{\mathrm{A}+\mathrm{C}}{2}\right)=\sin \frac{B}{2} \\
& \text { so } \cos \frac{\mathrm{A}-\mathrm{C}}{2}=2 \sin \frac{B}{2} \\
& 2 \cos \mathrm{B} / 2 \cos \frac{\mathrm{A}-\mathrm{C}}{2}=4 \sin \mathrm{B} / 2 \cos \mathrm{B} / 2 \\
& 2 \sin \left(\frac{\mathrm{A}+\mathrm{C}}{2}\right) \cos \left(\frac{\mathrm{A}-\mathrm{C}}{2}\right)=4 \sin \mathrm{B} / 2 \cos \mathrm{B} / 2 \\
& \sin \mathrm{A}+\sin \mathrm{C}=2 \sin \mathrm{B} \\
& \mathrm{a}+\mathrm{c}=2 \mathrm{~b} \Rightarrow \mathrm{a}=3, \mathrm{c}=7, \mathrm{~b}=5
\end{aligned}
$
$
\begin{aligned}
& \cos \mathrm{A}-\cos \mathrm{C}=\frac{\mathrm{b}^2+\mathrm{c}^2-\mathrm{a}^2}{2 \mathrm{bc}}-\frac{\mathrm{a}^2+\mathrm{b}^2-\mathrm{c}^2}{2 \mathrm{ab}} \\
& =\frac{25+49-9}{70}-\frac{9+25-49}{30} \\
& \frac{65}{70}+\frac{1}{2}=\frac{20}{14}=\frac{10}{7}
\end{aligned}
$

Hence, the answer is $\frac{10}{7}$

Example 2:

Given $\frac{b+c}{11}=\frac{c+a}{12}=\frac{a+b}{13}$ for a $\triangle A B C$ with usual notation.
If $\frac{\cos A}{\alpha}=\frac{\cos B}{\beta}=\frac{\cos C}{\gamma}$, then the ordered triad $(\alpha, \beta, \gamma)$ has a value :
[JEE MAINS 2019]
Solution
Cosine Rule - Cosine Rule - null

$
\begin{aligned}
& b+c=11 \lambda \\
& a+c=12 \lambda \\
& a+b=13 \lambda \\
& =>a=7 \lambda, b=6 \lambda, c=5 \lambda
\end{aligned}
$
Using Cosine Formula,

$
\begin{aligned}
& \cos A=\frac{1}{5}, \cos B=\frac{19}{35}, \cos C=\frac{5}{7} \\
& \alpha: \beta: \gamma=7: 19: 25
\end{aligned}
$
Hence, the answer is $7: 19: 25$.

Example 3: The angle of elevation of the top of a vertical tower from a point P on the horizontal ground was observed to be $\alpha$ After moving a distance 2 meters from P towards the foot of the tower, the angle of elevation changes to $\beta$ Then the height of the tower (in meters) is [JEE MAINS 2014]

Solution


$
\begin{aligned}
& \text { In } \triangle A P B, \tan \alpha=\frac{A B}{B P} \\
& \Rightarrow B P=\frac{h}{\tan \alpha}=\frac{h \cos \alpha}{\sin \alpha} \\
& \text { In } \triangle A Q B, \tan \beta=\frac{A B}{B Q} \\
& \Rightarrow B Q=\frac{h \cos \beta}{\sin \beta}
\end{aligned}
$
Now, $P Q=2$

$
\begin{aligned}
& \Rightarrow P B-Q B=2 \\
& \Rightarrow h\left[\frac{\cos \alpha}{\sin \alpha}-\frac{\cos \beta}{\sin \beta}\right]=2 \\
& \Rightarrow h \frac{[\sin (\beta-\alpha)]}{\sin \alpha \sin \beta}=2 \\
& \Rightarrow h=\frac{2 \sin \alpha \sin \beta}{\sin (\beta-\alpha)}
\end{aligned}
$
Hence, the answer is $\frac{2 \sin \alpha \sin \beta}{\sin (\beta-\alpha)}$

Example 4: Let 10 vertical poles standing at equal distances on a straight line, subtend the same angle of elevation $\alpha$ at a point O on this line and all the poles are on the same side of O. If the height of the longest pole is ‘h’ and the distance of the foot of the smallest pole from O is ‘a’, then the distance between two consecutive poles is [JEE MAINS 2015]

Solution

For all poles to subtend the same angle, the longest pole must be farthest, the smallest pole must be nearest, while all other poles are arranged in ascending order of height. Let the distance between 2 consecutive poles be x. Then, $B_1 B_{10}=9 x$


$
\begin{aligned}
& \text { In, } \Delta A_1 B_1 O, \tan \alpha=\frac{A_1 B_1}{B_1 O}=\frac{h}{B_1 B_{10}+B_{10} O} \\
& \tan \alpha=\frac{h}{9 x+a} \\
& \frac{\sin \alpha}{\cos \alpha}=\frac{h}{9 x+a} \\
& \Rightarrow 9 x \sin \alpha+a \sin \alpha=h \cos \alpha \\
& \Rightarrow x=\frac{h \cos \alpha-a \sin \alpha}{9 \sin \alpha} \\
& \text { Hence, the answer is } \frac{h \cos \alpha-a \sin \alpha}{9 \sin \alpha}
\end{aligned}
$


Example 5: Let a vertical tower AB have its end A on the level ground. Let C be the mid-point of AB and P be a point on the ground such that $\mathrm{AP}=2 \mathrm{AB}$. If $\angle B P C=\beta$, then tan $\beta$ is equal to :
[JEE MAINS 2017]
Solution

Solution

Height and Distances -The height or length of an object or the distance between two distant objects can be determined with the help of trigonometric ratios.

Let, AC=CB=h, AB=2h and AP=4h

Now, $\tan \angle B P A=\frac{2 h}{4 h}=\frac{1}{2}$
$\tan \angle C P A=\frac{h}{4 h}=\frac{1}{4}$
$\tan \beta=\tan (\angle B P A-\angle C P A)=\frac{\tan (\angle B P A)-\tan (\angle C P A)}{1+\tan (\angle B P A) \tan (\angle C P A)}$
$=\frac{\frac{1}{2}-\frac{1}{4}}{1+\frac{1}{8}}=\frac{\frac{1}{4}}{\frac{9}{8}}=\frac{2}{9}$
$\tan \beta=\frac{2}{9}$
Hence, the answer is $\frac{2}{9}$


Frequently Asked Questions (FAQs)

1. What is the Law of Cosines and how does it differ from the Pythagorean theorem?
The Law of Cosines is a generalization of the Pythagorean theorem that applies to all triangles, not just right triangles. It states that in a triangle with sides a, b, and c, and angle C opposite side c, the relationship c² = a² + b² - 2ab cos(C) holds. Unlike the Pythagorean theorem, which only works for right triangles, the Law of Cosines includes an additional term involving the cosine of an angle, allowing it to be used for any triangle.
2. Why is the Law of Cosines useful in trigonometry?
The Law of Cosines is useful because it allows us to solve problems involving triangles that are not right triangles. It can be used to find unknown sides or angles in any triangle when we know three pieces of information about the triangle (such as two sides and the included angle, or three sides). This makes it a powerful tool in various applications, including surveying, navigation, and physics.
3. How can you derive the Law of Cosines using geometry?
The Law of Cosines can be derived geometrically by drawing an altitude from one vertex of a triangle to the opposite side, creating two right triangles. By applying the Pythagorean theorem to these right triangles and using trigonometric relationships, we can arrive at the Law of Cosines formula. This derivation helps visualize the relationship between the sides and angles of a triangle.
4. What are the three forms of the Law of Cosines?
The Law of Cosines has three equivalent forms, one for each angle of the triangle:
5. How does the Law of Cosines reduce to the Pythagorean theorem for right triangles?
In a right triangle, one of the angles (let's say C) is 90°. The cosine of 90° is 0, so the term 2ab cos(C) in the Law of Cosines becomes zero. This reduces the equation to c² = a² + b², which is the Pythagorean theorem. This shows that the Law of Cosines is a more general form that includes the Pythagorean theorem as a special case.
6. Can the Law of Cosines be used to determine if a triangle is acute, right, or obtuse?
Yes, the Law of Cosines can be used to determine the nature of a triangle. If we know the lengths of all three sides (a, b, and c), we can compare c² to a² + b²:
7. How is the Law of Cosines related to the distance formula in coordinate geometry?
The Law of Cosines is closely related to the distance formula in coordinate geometry. If we consider two points (x₁, y₁) and (x₂, y₂) in a coordinate plane, the distance d between them is given by d² = (x₂ - x₁)² + (y₂ - y₁)². This is essentially the Law of Cosines for a right triangle, where the angle between the coordinate axes is 90°. The Law of Cosines generalizes this concept to any angle between axes, making it applicable in non-rectangular coordinate systems.
8. What is the relationship between the Law of Cosines and the Law of Sines?
The Law of Cosines and the Law of Sines are both fundamental trigonometric laws for solving triangles. While the Law of Cosines relates the lengths of sides to the cosine of an angle, the Law of Sines relates the sines of angles to the lengths of opposite sides. They are often used in conjunction: the Law of Cosines is typically used when we know three sides or two sides and the included angle, while the Law of Sines is used when we know two angles and a side. Together, they provide a complete toolkit for solving any triangle.
9. How does the Law of Cosines relate to the concept of vector dot product?
The Law of Cosines is closely related to the vector dot product. In vector algebra, the dot product of two vectors a and b is defined as a · b = |a||b| cos(θ), where θ is the angle between the vectors. If we consider the sides of a triangle as vectors, the Law of Cosines can be derived from the dot product formula. This connection highlights the Law of Cosines as a fundamental relationship in both trigonometry and vector algebra.
10. What is the significance of the negative sign in the Law of Cosines formula?
The negative sign in the Law of Cosines formula (c² = a² + b² - 2ab cos(C)) is crucial because it accounts for the fact that in any triangle, the cosine of an angle is positive for acute angles and negative for obtuse angles. This sign ensures that the formula works correctly for all types of triangles. Without the negative sign, the formula would only be valid for triangles with acute angles, limiting its applicability.
11. How can the Law of Cosines be used to find the angle of a triangle when all sides are known?
To find an angle of a triangle when all sides are known, we can rearrange the Law of Cosines to solve for cos(C):
12. What are some real-world applications of the Law of Cosines?
The Law of Cosines has numerous real-world applications, including:
13. How does the Law of Cosines help in solving SSS (Side-Side-Side) triangle problems?
In SSS (Side-Side-Side) triangle problems, where all three sides of a triangle are known, the Law of Cosines is particularly useful. It allows us to find any angle of the triangle without needing to know any angles beforehand. By applying the formula c² = a² + b² - 2ab cos(C) and solving for cos(C), we can determine the angles of the triangle. This makes the Law of Cosines essential for solving triangles when only side lengths are given.
14. Can the Law of Cosines be used to find the area of a triangle?
Yes, the Law of Cosines can be used to find the area of a triangle. Once we know two sides and the included angle, we can use the formula:
15. How can the Law of Cosines be used to solve SAS (Side-Angle-Side) triangle problems?
In SAS (Side-Angle-Side) triangle problems, where two sides and the included angle are known, the Law of Cosines is directly applicable. We can use the formula c² = a² + b² - 2ab cos(C) to find the unknown side. Once we have all three sides, we can use the Law of Cosines again to find the remaining angles. This makes it a powerful tool for solving triangles when we have this specific combination of known information.
16. What is the importance of the Law of Cosines in optimization problems?
The Law of Cosines plays a crucial role in many optimization problems, particularly those involving distances or angles. For example, in finding the optimal placement of a facility to minimize distances to multiple locations, or in determining the best angle for a solar panel to maximize energy collection, the Law of Cosines provides the necessary relationships between distances and angles. Its ability to relate sides and angles in non-right triangles makes it invaluable in real-world optimization scenarios where right angles are not always present.
17. What role does the Law of Cosines play in the field of computer graphics?
In computer graphics, the Law of Cosines is essential for various calculations involving 3D objects and lighting. It's used to compute angles between surfaces, determine shadow boundaries, and calculate light intensity based on the angle between a light source and a surface normal. The Law of Cosines helps in creating realistic 3D renderings by accurately representing how light interacts with objects in a virtual environment.
18. What is the relationship between the Law of Cosines and the Cosine Rule in spherical trigonometry?
The Law of Cosines in plane trigonometry has an analogous form in spherical trigonometry called the Cosine Rule for spherical triangles. The spherical Law of Cosines states:
19. How does the Law of Cosines help in understanding the concept of triangulation?
The Law of Cosines is fundamental to the concept of triangulation, a technique used to determine the location of a point by measuring angles to it from known points. In triangulation, we often know two sides of a triangle and the included angle, which is precisely the scenario where the Law of Cosines is applicable. By using the Law of Cosines, we can calculate the unknown distances and angles, allowing us to pinpoint locations. This principle is used in various fields, including GPS technology, surveying, and navigation.
20. Can the Law of Cosines be used to solve problems involving regular polygons?
Yes, the Law of Cosines can be applied to problems involving regular polygons. In a regular polygon, we can divide the shape into congruent triangles. By knowing the side length and the central angle of these triangles, we can use the Law of Cosines to find relationships between the side length, apothem (distance from center to side), and radius of the circumscribed circle. This application extends the usefulness of the Law of Cosines beyond simple triangles to more complex geometric shapes.
21. How does the Law of Cosines relate to the concept of vector magnitude?
The Law of Cosines is closely related to the concept of vector magnitude. When we add two vectors a and b to get a resultant vector c, the magnitude of c is given by |c|² = |a|² + |b|² - 2|a||b|cos(θ), where θ is the angle between a and b. This is exactly the Law of Cosines formula. This relationship demonstrates how the Law of Cosines bridges the gap between trigonometry and vector algebra, providing a powerful tool for analyzing vector relationships.
22. How can the Law of Cosines be used to verify the triangle inequality theorem?
The Law of Cosines can be used to prove the triangle inequality theorem, which states that the sum of the lengths of any two sides of a triangle must be greater than the length of the remaining side. Using the Law of Cosines, c² = a² + b² - 2ab cos(C), we can show that for any triangle, c < a + b. This is because cos(C) ≥ -1 for any angle C, so 2ab cos(C) ≥ -2ab. This leads to c² ≤ (a + b)², or c ≤ a + b, verifying the triangle inequality.
23. What is the connection between the Law of Cosines and the concept of vector projection?
The Law of Cosines is closely related to vector projection. When we project one vector onto another, the length of the projection is given by |a| cos(θ), where |a| is the magnitude of the vector being projected and θ is the angle between the vectors. This projection concept appears in the Law of Cosines as the term 2ab cos(C). Understanding this connection helps in visualizing how the Law of Cosines relates the sides and angles of a triangle in terms of vector operations.
24. How does the Law of Cosines help in understanding the concept of work in physics?
In physics, work is defined as the dot product of force and displacement vectors: W = F · d = |F||d| cos(θ), where θ is the angle between the force and displacement. This formula is structurally similar to the Law of Cosines. Understanding the Law of Cosines can help students grasp how the angle between force and displacement affects the work done, providing a geometric interpretation of this important physics concept.
25. Can the Law of Cosines be extended to higher dimensions?
Yes, the Law of Cosines can be generalized to higher dimensions. In three-dimensional space, for example, we have the tetrahedral Law of Cosines, which relates the squares of the areas of the faces of a tetrahedron to the cosines of the dihedral angles between them. This extension demonstrates how fundamental trigonometric relationships like the Law of Cosines can be adapted to more complex geometric structures in higher dimensions.
26. How does the Law of Cosines relate to the concept of orthogonality in linear algebra?
The Law of Cosines provides insight into the concept of orthogonality in linear algebra. Two vectors are orthogonal (perpendicular) if their dot product is zero. In the Law of Cosines, c² = a² + b² - 2ab cos(C), if C = 90°, then cos(C) = 0, and we get c² = a² + b², which is the Pythagorean theorem for right triangles. This shows that orthogonality in vector spaces is a generalization of perpendicularity in geometry, linking trigonometric concepts to linear algebra.
27. How can the Law of Cosines be used to solve problems involving irregular quadrilaterals?
The Law of Cosines can be applied to irregular quadrilaterals by dividing them into two triangles. By knowing the lengths of all sides and one diagonal of the quadrilateral, we can use the Law of Cosines twice (once for each triangle) to find the angles or the length of the other diagonal. This approach allows us to analyze and solve problems involving complex quadrilateral shapes that don't have the symmetry or regular properties of rectangles or squares.
28. What is the relationship between the Law of Cosines and the concept of triangular coordinates?
Triangular coordinates, also known as barycentric coordinates, express the location of a point in a triangle as a weighted sum of the triangle's vertices. The Law of Cosines can be used to convert between Cartesian coordinates and triangular coordinates. By applying the Law of Cosines to calculate distances within the triangle, we can determine the weights for each vertex, providing a link between trigonometric relationships and this alternative coordinate system.
29. How does the Law of Cosines help in understanding the concept of angular momentum in physics?
The Law of Cosines is useful in understanding angular momentum in physics, particularly in problems involving rotational motion. Angular momentum L is given by L = r × p, where r is the position vector and p is the linear momentum. The magnitude of angular momentum involves the sine of the angle between r and p, which can be related to the cosine through the Law of Cosines. This helps in visualizing how the angle between position and momentum affects the angular momentum of a system.
30. Can the Law of Cosines be used to derive other trigonometric identities?
Yes, the Law of Cosines can be used to derive several other trigonometric identities. For example, by rearranging the Law of Cosines and using the Pythagorean identity (sin²θ + cos²θ = 1), we can derive the cosine double angle formula: cos(2θ) = cos²θ - sin²θ. This demonstrates how the Law of Cosines serves as a fundamental relationship from which other trigonometric identities can be developed.

Articles

Back to top