I am looking to minimize the function: $$f(\theta_1,\theta_2)=\cos(\theta_1)+\cos(\theta_2)+\cos(\theta_2-\theta_1)$$ which I can do the long way of finding $\frac{\partial f}{\partial \theta_1}$ and $\frac{\partial f}{\partial \theta_2}$ which at first seems easy but in fact you get lots of different cases. Thus is their any short way/trick to minimize a function like this? (note I know tha answer to be $\theta_1=120^\circ$ and $\theta_2=240^\circ$ or vice versa).
Context:
A physical situation were such an equation may come up is for a frustrated magnet when treated classically.