# Law of Cosines

## Law of Cosines Definition

Law of Cosines, also known as Cosine Rule or Cosine Formula, basically relates the length of the triangle to the cosines of one its angles, in Trigonometry.

### Law of Cosine Formula

As per the law of cosines formula, to find the length of sides of triangle say $\Delta$ABC, we can write as;

$a^{2}$=$b^{2}$+$c^{2}$-2bc cos(x)

$b^{2}$=$a^{2}$+$c^{2}$-2ac cos(y)

$c^{2}$=$a^{2}$+$b^{2}$-2bc cos(z)

And if we want to find the angles of $\Delta$ABC, then the cosine rule is applied as;

cos x=$b^{2}$+$c^{2}$-$a^{2}$/2bc

cos y=$a^{2}$+$c^{2}$-$b^{2}$/2ac

cos z=$a^{2}$+$b^{2}$-$c^{2}$/2ab

### Proof of Law of Cosines

Now let us learn the law of cosines proof here;

In the right triangle BCD, by the definition of cosine:

cos C=$\frac{CD}{a}$

or,

CD=a cos C

Subtracting above equation from side b, we get

DA=b−acosC ……(1)

In the triangle BCD, according to Sine definition

sin C=$\frac{BD}{a}$

or

BD=asinC ……(2)

In the triangle ADB, if we apply the Pythagorean Theorem, then

$c^{2}$=$BD^{2}$+$DA^{2}$

Substituting for BD and DA from equations (1) and (2)

$c^{2}$=$(a sin C)^{2}$ + $(b-acosC)^{2}$

By Cross Multiplication we get:

$c^{2}$= $a^{2}$ $sin^{2}C$ + $b^{2}$-2abcosC+ $a^{2}$ $cos^{2}C$

Rearranging the above equation:

$c^{2}$= $a^{2}$ $sin^{2}C$+$a^{2}$ $cos^{2}C$+$b^{2}$-2ab cosC

Taking out $a^{2}$ as a common factor, we get;

$c^{2}$= $a^{2}$($sin^{2}C$+$cos^{2}C$)+$b^{2}$-2ab cosC

Now from the above equation, you know that,

$sin^{2}\Theta$ + $cos^{2}\Theta$=1

Therefore,

$c^{2}$=$a^{2}$+$b^{2}$-2ab cosC

Hence, the Cosine rule proved.

#### Cosine Law Problems and Solutions:

Let us understand the concept by solving one of the law of cosines problems;

Problem: A triangle ABC has sides a=10cm, b=7cm and c=5cm. Now, find its angle ‘x’.

Solution: Consider the below triangle as triangle ABC, where,

a=10cm

b=7cm

&c=5cm

By using cosines law or the law of cosines,

$a^{2}$=$b^{2}$+$c^{2}$-2bc cos(x)

Or

cos(x)=[$b^{2}$+$c^{2}$-$a^{2}$]/2bc

Substituting the value of the sides of the triangle, a,b and c, we get

cos(x)=[$7^{2}$+$5^{2}$-$10^{2}$]/(2*7*5)

cos(x)=[49+25-100]/70