2. Given numbers $x, y, z \in [0, \pi]$. Find the minimum value of the expression

$$
A=\cos (x-y)+\cos (y-z)+\cos (z-x)
$$
Answer: -1.

Solution. We can assume that $x \leqslant y \leqslant z$, since the expression $A$ does not change under pairwise permutations of the variables. Notice that

$$
\cos (x-y)+\cos (z-x)=2 \cos \left(\frac{z-y}{2}\right) \cos \left(\frac{z+y}{2}-x\right)
$$

The first cosine in the right-hand side is non-negative and does not depend on $x$, while the argument of the second cosine lies in the interval $[0, \pi]$, since $\pi \geqslant \frac{z+y}{2} \geqslant x$. Therefore, the right-hand side will be the smallest when $x=0$. In this case,

$$
A=\cos y+\cos z+\cos (y-z)=\cos z+2 \cos \frac{z}{2} \cdot \cos \left(y-\frac{z}{2}\right)
$$

Notice that $-\frac{\pi}{2} \leqslant-\frac{z}{2} \leqslant y-\frac{z}{2} \leqslant \frac{z}{2} \leqslant \frac{\pi}{2}$, hence

$$
A=\cos z+2 \cos \frac{z}{2} \cdot \cos \left(y-\frac{z}{2}\right) \geqslant \cos z \geqslant-1
$$

Equality is achieved when $x=0, y=z=\pi$.