$$2R(\cos^2 A+\cos^2B +\cos^2C)$$ $$=2R(\frac{3+\cos 2A +\cos 2B +\cos 2C}{2})$$ $$=R(3+(2\cos C \cos (A-B))+2\cos^2C-1)$$
$$=R(2+2\cos C (\cos (A-B)+\cos C))$$
I tried solving it further, but I kept getting confused with signs. How should I finish it?