To use the law of sines we need a known side opposite a known angle. Sometimes we do not have that information, as when, for example, we know three sides and no angle. We can still solve such a triangle using the law of cosines.
Consider an oblique triangle ABC as shown in Fig. 8-27. As we did for the law of sines, we start by dividing the triangle into two right triangles by drawing an altitude h to side AC.
In right triangle ABD,
But AD = b − CD. Substituting, we get
Now, in right triangle BCD, by the definition of the cosine,
Substituting a cos C for CD in Equation (1) yields
Squaring, we have
Let us leave this expression for the moment and write the Pythagorean theorem for the same triangle BCD.
Again substituting a cos C for CD, we obtain
Substituting this expression for h2 back into (2), we get