Problem 2. (2 points)

The sum of the sines of five angles from the interval $\left[0 ; \frac{\pi}{2}\right]$ is 3. What are the greatest and least integer values that the sum of their cosines can take?
Answer: $2 ; 4$

## Solution:

Note that $\sin x+\cos x=\sqrt{2} \sin \left(x+\frac{\pi}{4}\right)$. The argument of the sine function ranges from $\frac{\pi}{4}$ to $\frac{3 \pi}{4}$, so $\frac{\sqrt{2}}{2} \leqslant \sin \left(x+\frac{\pi}{4}\right) \leqslant 1$. Therefore, $1 \leqslant \sin x+\cos x \leqslant \sqrt{2}$, and the sum of five sines and five cosines
ranges from 5 to $5 \sqrt{2}$, which is slightly more than 7. Subtracting 3, we get the smallest and largest possible integer values of the sum: 2 and 4, respectively.

It remains to provide examples: the value 2 is achieved when three angles take the value 0, and the other two take the value $\frac{\pi}{2}$. The value 4 is achieved when all angles have sines equal to $\frac{3}{5}$ and cosines equal to $\frac{4}{5}$.