The law of cosines explains the relation between the sides and an angle of a triangle. The law states that for any triangle , if , , and , then . For is a right angle and , we have proved it as the pythagorean theorem earlier.
Proof
Statement
In any triangle, the square of one side's length is equal to the difference between the sum of the squares of the other two sides' lengths and twice the product of those two sides' lengths and the cosine of the included angle.
Assume, is a triangle where and It is needed to be proved that, .
Let us extend the line segment to (only for obtuse triangles), where . Assume and .
Proof with the help of the Pythagorean Theorem
For obtuse triangles:
Construction for proving the law of cosines for angle .
According to the Pythagorean theorem, we can say that, for
Similarly, for the triangle .
We will be using this value for further proof. But now, let's determine some trigonometric values for the triangles.
Here, .
Therefore,
Or,
Now, .
. [Proved]
For acute angles:
Construction for proving the law of cosines for angle .
Like as the proof we have proved before, according to the Pythagorean theorem, we can say that, for
Similarly, for the triangle .
Here, .
Therefore,
Now, .
. [Proved]
[Note: Whatever the triangle is, the formula, works.]