Law of Cosines:
In Trigonometry, the law of Cosines, also known as Cosine Rule or Cosine Formula basically relates the length of the triangle to the cosines of one of its angles. It states that, if the length of two sides and the angle between them is known for a triangle, then we can determine the length of the third side. It is given by:
c2 = a2 + b2 – 2ab cosγ
In the right triangle BCD, by the definition of cosine function:
cos C = 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 = BD/a
or
BD = a sinC ……(2)
In the triangle ADB, if we apply the Pythagorean Theorem, then
c2 = BD2 + DA2
Substituting for BD and DA from equations (1) and (2)
c2 = (a sin C)2 + (b-acosC)2
By Cross Multiplication we get:
c2 = a2 sin2C + b2 – 2abcosC + a2 cos2C
Rearranging the above equation:
c2 = a2 sin2C + a2 cos2C + b2 – 2ab cosC
Taking out a2 as a common factor, we get;
c2 = a2(sin2C + cos2C) + b2 – 2ab cosC
Now from the above equation, you know that,
sin2θ + cos2θ = 1
∴ c2 = a2 + b2 – 2ab cosC
Hence, the cosine law is proved.