Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (2024)

Sign up with Facebook or Sign up manually

Already have an account? Log in here.

Patrick Engelmann, Alex G, Mei Li, and

  • Paola Ramírez
  • Mahindra Jain
  • Sandeep Bhardwaj
  • Guillermo Templado
  • Landin Landis
  • Lew Sterling Jr
  • Andrew Ellinor
  • Aashish Cheruvu
  • Worranat Pakornrat
  • A Former Brilliant Member
  • Ayush G Rai
  • A Former Brilliant Member
  • Calvin Lin
  • Eli Ross
  • Jimin Khim

contributed

The cosine rule, also known as the law of cosines, relates all 3 sides of a triangle with an angle of a triangle.

It is most useful for solving for missing information in a triangle. For example, if all three sides of the triangle are known, the cosine rule allows one to find any of the angle measures. Similarly, if two sides and the angle between them is known, the cosine rule allows one to find the third side length.

Contents

  • Statement and Proof of the Theorem
  • Finding Missing Side Lengths and Angles
  • Applications to Bearing and Heading Problems
  • Vector Form of Cosine Rule
  • Deriving other Laws Using the Cosine Rule
  • Problem Solving
  • See Also

Statement and Proof of the Theorem

Given the following triangle \(ABC\) with corresponding sides length \(a\), \(b\), and \(c:\)

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (1)

the law of cosines states that

\[\begin{align}a^2&=b^2+c^2-2bc \cdot \cos A\\b^2&=a^2+c^2-2ac \cdot \cos B\\c^2&=a^2+b^2-2ab \cdot \cos C.\end{align}\]

It can be seen as a generalization of the Pythagorean theorem. Take one arbitrary side of the triangle, for instance, \(a\). Then its square equals the sum of the squares of the other two sides, i.e. \(a^2 = b^2 + c^2\). If you were to plug in 90 degrees, you would be left with the Pythagorean theorem. Since the angle \(\alpha\) that faces our arbitrary side \(a\) is not necessarily \(90°\), we will have to subtract something, as the identity \(a^2 = b^2 + c^2\) does not hold yet. The right side of this equation is still "too big." That something we have to subtract becomes \(2bc \cdot \cos A\).

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (2)

We'll prove for side \(a\). Let's denote its facing angle as \(\alpha\). The other two equations can be done in a similar way.

By definition we have \[\begin{align}\sin \alpha &= \frac{h}{c} \implies h = c \cdot \sin \alpha \\\cos \alpha &= \frac{r}{c} \implies r = c \cdot \cos \alpha.\end{align}\]Using the Pythagorean theorem, we get \[a^2 = h^2 + (b-r)^2.\]Substituting for \(h\) and \(r\), we get\[\begin{align}a^2 &= (c \cdot \sin \alpha)^2 + (b - c \cdot \cos \alpha)^2 \\&= c^2 \cdot \sin^2 \alpha + b^2 - 2bc \cdot \cos \alpha + c^2 \cdot \cos^2 \alpha \\&= c^2 \cdot \big( \sin^2 \alpha + \cos^2 \alpha \big) + b^2 - 2bc \cdot \cos \alpha\\&= c^2 + b^2 - 2bc \cdot \cos \alpha.\ _\square\end{align}\]

Notes:

  • The identity \(\sin^2 \alpha + \cos^2 \alpha = 1\) is also known as the Pythagorean identity.
  • This proof isn't perfect. We should have been worried about angles. This can be avoided by using directed angles.

Let \( \vec{a} \cdot \vec{b} \) denote the dot product between \(\vec{a}\) and \(\vec{b}\).
Also, let \( \vec{a} = \vec {BC}\), \( \vec{b} = \vec {AC}\), and \( \vec{c} = \vec {AB}\).
Then \[c^2 = \vec{c} \cdot \vec{c} = \big(\vec{b} - \vec{a}\big) \cdot \big(\vec{b} - \vec{a}\big) = b^2 + a^2 - 2\vec{a} \cdot \vec{b} = b^2 + a^2 - 2ab\cos C.\ _\square\]

Finding Missing Side Lengths and Angles

Given side-angle-side:

In triangle \( ABC\), we have \( \angle BAC = \frac {\pi}{4}, \lvert \overline{BC} \rvert = \sqrt{5}\) and \( \lvert \overline{AB} \rvert = 3\). Determine \( \lvert \overline{AC} \rvert\).

Applying the cosine rule on \( \angle BAC\), we get

\[\begin{align}\lvert \overline{AB} \rvert^2 + \lvert \overline{AC} \rvert^2 - 2 \lvert \overline{AB} \rvert \cdot \lvert \overline{AC} \rvert \cdot \cos \frac {\pi}{4} &= \lvert \overline{BC} \rvert^2\\\lvert \overline{AC} \rvert^2 - 3 \sqrt{2} \lvert \overline{AC} \rvert + 4 &=0 \\\left(\lvert \overline{AC} \rvert-\sqrt{2}\right)\left(\lvert \overline{AC} \rvert-2\sqrt{2}\right)&=0.\end{align}\]

Hence, \( \lvert \overline{AC} \rvert=\sqrt{2} \text{ or } 2\sqrt{2}\). \( _\square \)

Note: This is similar to the 'ambiguous case' of sine rule, since we have \( 3 \sin \frac {\pi}{4} < \sqrt{5} < 3\), which is the condition \( c \sin \alpha < a < c\).

\[\sqrt{7}\] \[5\] \[2\sqrt{7}\] \[5\sqrt{5}\]

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (3)

Points \(D\) and \(E\) are the midpoints of sides \(BC\) and \(CA,\) respectively, of \(\triangle ABC.\)

If \(AD=5\) and \(BC=BE=4,\) then find the length of \(CA.\)

In triangle \( ABC\), \(\angle ACB = 90^\circ \). Points \(A, D, E,\) and \(B\) are consecutive points on side \(AB\) such that \(\overline{AD}=\overline{DE}=\overline{EB}\). If there exists \( \theta\) such that \( \overline{CD} = 5 \cos \theta\) and \(\overline{CE} = 5 \sin \theta \), what is \(\overline{AB}^2?\)

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (4)

Given side-side-side:

In triangle \(ABC\), \(\overline{AB} = \sqrt{6} - \sqrt{2}, \overline{AC} = 2\sqrt{2},\) and \(\overline{BC} = 2\sqrt3.\) Find the measure of \(\angle ABC.\)

Applying the law of cosines on side \(AC,\) we get

\[\begin{align}{\overline{AC}}^2 &= {\overline{AB}}^2 + {\overline{BC}}^2 - 2 \cdot \overline{AB} \cdot \overline{BC} \cdot \cos {\angle ABC} \\\\{\big(2\sqrt{2}\big)}^2 &= {\big(\sqrt{6} - \sqrt{2}\big)}^2+ {\big(2\sqrt3\big)}^2 - 2\cdot 2\sqrt3 \cdot \big(\sqrt{6} - \sqrt{2}\big) \cdot \cos {\angle ABC}\\\\8 &= 6 - 4\sqrt{3} + 2 + 12 - \big(12\sqrt{2} - 4\sqrt{6}\big)\cos{\angle ABC}\\\\-12 +4\sqrt{3} &= (-12\sqrt{2}+4\sqrt{6})\cos{\angle ABC}\\\\\cos{\angle ABC} &=\dfrac{-12 +4\sqrt{3}}{-12\sqrt{2}+4\sqrt{6}} \\\\&=\dfrac{1}{\sqrt2} \cdot \dfrac {-12 +4\sqrt{3}}{-12+4\sqrt{3}}=\dfrac{\sqrt2}{2}\\\\\Rightarrow \angle ABC &= \dfrac{\pi}{4}.\ _\square\end{align}\]

Try the following problem:

An ant is lost in a square, and his distances to the vertices of the square are 7, 35, 49, and \(x.\) Find \(x.\)

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (5)

Note: The image is not drawn to scale.

Applications to Bearing and Heading Problems

When it comes to the applications with regards to the law of cosines, it has its own applications towards vector quantities (and not qualities).

See: Bearing

Vector Form of Cosine Rule

We have

\[\begin{align}\vec{c}^{2} &= \vec{a}^{2} + \vec{b}^{2} - 2 \cdot \vec{a} \cdot \vec{b}\\&= \vec{a}^{2} - 2 \cdot \vec{a} \cdot \vec{b} + \vec{b}^{2} \\&= \big(\vec{a} - \vec{b}\big)^2.\end{align} \]

Deriving other Laws Using the Cosine Rule

  • Triangle Inequality
  • Pythagorean Theorem

From the cosine rule, we have

\[c^2 \leq a^2 + b^2 + 2ab = (a+b)^2,\]

and by taking the square root of both sides, we have \(c \leq a + b\), which is also known as the triangle inequality. One useful application of the triangle inequality is to test if three given lengths can define a triangle.

The Pythagorean theorem applies to right triangles, so let \(\gamma \) be a right angle, i.e., \(\gamma = \frac{\pi}{2}\). Then by the cosine rule,

\[ c^2 = a^2 + b^2 - 2ab \cos \gamma = a^2 + b^2 - 2ab \cos \frac{\pi}{2} = a^2 + b^2 - 0 = a^2 + b^2.\]

Suppose \( a, b,\) and \( c\) are positive reals such that \( a^2 = b^2+c^2 - bc, b^2 = c^2 + a^2 - ac,\) and \( c^2 = a^2 + b^2 - ab\). Show that \( a = b = c\).

Since \( c^2 = a^2 + b^2 - ab < a^2 + b^2 + 2ab = (a+b)^2\), it follows that \( c < a+b\) and we have similar inequalities for other variables. Hence, the numbers \( a, b\) and \( c\) satisfy the triangle inequality, and there exists a triangle \( ABC\) such that \( \lvert \overline{AB} \rvert=c, \lvert \overline{BC} \rvert=a, \lvert \overline{CA} \rvert=b\). As such

\[ \cos \angle ABC = \frac {a^2 + c^2 - b^2}{2ac} = \frac {a^2 + c^2 - (a^2+c^2-ac)}{2ac} = \frac {1}{2},\]

which gives us that \( \angle ABC = 60^\circ\). Similarily, we have \( \angle BCA = 60^\circ\) and \(\angle CAB = 60^\circ\), which show that triangle \( ABC\) is equilaterial, implying that \( a=b=c\). \( _\square \)

Note: This may also be done directly by summing up the 3 equations to get \( (a-b)^2 + (b-c)^2 + (c-a)^2 =0\).

\[\begin{cases} a^2+ab+b^2&=&9 \\ b^2+bc+c^2&=&52 \\ c^2+ca+a^2&=&49 \end{cases} \]

Let \(a\), \(b\) and \(c\) be real numbers satisfying the system of equations above.

Compute the integral value of \(\dfrac{49b^2+39bc+9c^2}{a^2}\).

Hint: See the topic of this question.

Source: HMMT

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (6)

The figure above shows an isosceles triangle \(ABC\) with \(BA = AC \) and \(\angle BAC = 120^\circ\).

Let \(D\) be a point on \(AC\) such that \(AD > DC\). Given that the lengths of \(BA\), \(AD\), \(DC\), and \(BD\) are all distinct prime numbers, what is the length of \(BD?\)

Problem Solving

In \(\triangle{ABC}\), \(BC=a \text{ cm}, AC=b \text{ cm},\) and \(AB=c \text{ cm}.\) Given that \(\frac{a^2+b^2}{c^2}=2011\), find the value of

\[\frac{\cot C}{\cot A+\cot B}.\]

This problem is not original.

An ant, located in a square field, is \(13\text{ m}\) from one of the corner posts of the field, \(17\text{ m}\) from the corner post diagonally opposite to the first one, and \(20 \text{ m}\) from a third corner post. Assuming the land is flat, find the area of the field \(\big(\)in \(\text{m}^2\big).\)

One big and one small circle share the same center \(O\).

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (7)

Then \(\triangle ABC\) is constructed such that points \(A\) and \(B\) are on the big circle while point \(C\) is on the smaller circle. \(AB\) intersects the smaller circle at \(D\) and \(E\) and \(AC\) passes through \(F\) and \(O\), as shown above.

If \(AF = 3\) (red segment), \(DE = 6\) (blue segment), and \(BC = 11\) (green side), what is the radius of the smaller, orange circle?

See Also

  • Bearing - Word Problems

  • Proving Trigonometric Identites

Cite as: Cosine Rule (Law of Cosines). Brilliant.org. Retrieved from https://brilliant.org/wiki/cosine-rule/

Cosine Rule (Law of Cosines) | Brilliant Math & Science Wiki (2024)
Top Articles
Latest Posts
Article information

Author: Cheryll Lueilwitz

Last Updated:

Views: 5613

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Cheryll Lueilwitz

Birthday: 1997-12-23

Address: 4653 O'Kon Hill, Lake Juanstad, AR 65469

Phone: +494124489301

Job: Marketing Representative

Hobby: Reading, Ice skating, Foraging, BASE jumping, Hiking, Skateboarding, Kayaking

Introduction: My name is Cheryll Lueilwitz, I am a sparkling, clean, super, lucky, joyous, outstanding, lucky person who loves writing and wants to share my knowledge and understanding with you.