<s>[INST] if $A+B+C+D=\pi$, what is $\min(\cos{A}+\cos{B}+\cos{C}+\cos{D})$ Let $A,B,C,D \in R ~|~ A+B+C+D=\pi$, what is the minimum of the following function
$$f(A,B,C,D)=\cos{A}+\cos{B}+\cos{C}+\cos{D}$$
I found a post about a similar problem, butI think an even number of variables is harder than an odd number of variables, because for three variables,
$A+B+C=\pi~|~A,B,C\in R$ then it follows that $\cos{A}+\cos{B}+\cos{C}=1+4\sin{\dfrac{A}{2}}\sin{\dfrac{B}{2}}\sin{\dfrac{C}{2}}\to 1$, but for four variables, we can't.
My try: $$\cos{A}+\cos{B}+\cos{C}+\cos{D}=2\cos{\dfrac{A+B}{2}}\cos{\dfrac{A-B}{2}}+2\cos{\dfrac{C+D}{2}}\cos{\dfrac{C-D}{2}}=2\sin{\dfrac{C+D}{2}}\cos{\dfrac{A-B}{2}}+2\cos{\dfrac{C+D}{2}}\cos{\dfrac{C-D}{2}}$$
 [/INST] An alternative approach:
It is known that
$$
 \cos A + \cos B + \cos C + \cos D = 2 \cos\frac{A+B}{2} \cos\frac{A-B}{2} +2 \cos\frac{C+D}{2} \cos\frac{C-D}{2}.
$$
By introducing the new variables
$$
A' = \frac{A+B}{2} \quad B' = \frac{A-B}{2} \quad C' = \frac{C+D}{2} \quad D' = \frac{C-D}{2},
$$
hence
$$
 A = A'+B' \quad B=A'-B' \quad C = C' + D' \quad D = C'-D',
$$
we see that $A +  B + C + D = \pi$ becomes $2 A' + 2 C' = \pi$. Hence we have to minimize the four functions
$$
 2 ( \pm \cos A' \pm \cos(\frac{\pi}{2} - A')) = 2( \pm \cos A' \mp \sin A')
$$
It can be shown analytically (I used the computer) that these all have a minimum of $- 2 \sqrt{2}$. For example for both $`+'$ we have $A' = 2 \tan^{-1}(1+\sqrt{2})$. Hence $C' = \frac{\pi}{2} - 2 \tan^{-1}(1+\sqrt{2})$. Furthermore have we chosen $B' = 0$ and $C' = 0$. Using this we find that:
$$
 A = \tan^{-1}(1+\sqrt{2}) \\
 B = \tan^{-1}(1+\sqrt{2}) \\
 C = \frac{\pi}{4} - \tan^{-1}(1+\sqrt{2}) \\
 D = \frac{\pi}{4} - \tan^{-1}(1+\sqrt{2}).
$$
</s>