TITLE: Where does the $-2ab$ term come from in the cosine law?
QUESTION [17 upvotes]: I understand that in the cosine rule i.e. $c^2 = a^2 + b^2 - 2ab \cos C$, the cosine function acts to bring down the value of $c^2$ for acute angles ($\cos C>0$, $-2ab\cos C<0$ ) and increase the value of $c^2$ for obtuse angles ($\cos C <0$, $-2ab\cos C > 0$). I still wonder where the $2ab$ term comes from? Any ideas about the intuition behind that?
Regards,

REPLY [11 votes]: Based on Pythagorean theorem and Pythagorean trigonometric identity in this triangle

we have
$$c^2 = (a-b\cos C)^2 + (b \sin C)^2 \\ 
= a^2 - 2ab \cos C + b^2\cos^2 C + b^2 \sin^2 C \\
= a^2 - 2ab \cos C + b^2$$