The product to sum identity has been applied twice and the middle two terms cancel out on account of being cosines of supplementary angles.
Being equivalent to the "square" of a sine, the spread of both an angle and its supplementary angle are equal.
The exterior angle is the supplementary angle to the interior angle.
Once again the product to sum identity has been applied and the second term has been rewritten in terms of its supplementary angle.
Because each side of an angle has a supplementary angle, there are two exterior angles per vertex.