I need to maximize $$f(x,y,z)=\cos x+\cos y+\cos z$$ where x,y and z are all positive, subject to the constraint $$x+y+x=\pi$$. I'm not really sure how to do this...