I am looking at the solution of this problem:
$$\cos \left(\alpha \right)+\cos \left(\beta \right)+\cos \left(\gamma \right)=4\sin \left(\frac{\alpha }{2}\right)\sin \left(\frac{\beta }{2}\right)\sin \left(\frac{\gamma }{2}\right)$$ and it says this in the solution as the first step: $$\cos \left(\alpha \right)+\cos \left(\beta \right)+\cos \:\left(\gamma \:\right)=2\cos \left(\frac{\alpha +\beta }{2}\right)\cos \left(\frac{\alpha -\beta }{2}\right)-2\cos \left(\frac{\alpha \:+\beta \:}{2}\right)^2+1$$
I understand that the $\cos \alpha +\cos \beta=2\cos \left({\frac {\alpha +\beta }{2}}\right)\cos \left({\frac {\alpha -\beta }{2}}\right)$ is used, however how is the $cos \:\left(\gamma \:\right)$ transformed? I assume I should use the $\alpha +\beta +\gamma =\pi $ to replace $\gamma$ but can't seem to figure it out? Any help is very much appreciated. x