<s>[INST] How to prove that $\frac{r}{R}+1=\cos A+\cos B+\cos C$? How do we prove that for any triangle this holds: $$\frac{r}{R}+1=\cos A+\cos B+\cos C$$ I can use this beautiful identity to prove several geometric inequalities, but I have no idea how to prove the identity itself. Can anyone give me hints?
 [/INST] here is mechanical solution:
$\cos A+\cos B+\cos C-1=\dfrac{a^2b+b^2c+c^2a+b^2a+c^2b+a^2c-a^3-b^3-c^3-2abc}{2abc}=\dfrac{(a+b-c)(b+c-a)(c+a-b)}{2abc}=\dfrac{(a+b+c)(a+b-c)(b+c-a)(c+a-b)}{2abc(a+b+c)}=\dfrac{8S^2}{abc(a+b+c)}=\dfrac{\dfrac{S}{s}}{\dfrac{abc}{4S}}=\dfrac{r}{R}$
$S=\sqrt{s(s-a)(s-b)(s-c)},s=\dfrac{a+b+c}{2}$ 
</s>