2. Determine the maximum value of the function $f(x)=3-2 x-x^{2}$ on the set of solutions of the equation $2 \cos ^{2} x+\cos 4 x=0$.
Solution. Let's first determine the set of solutions of the equation. Using the trigonometric transformation $1+\cos 2 x=2 \cos ^{2} x$, the equation is reduced to the form $1+\cos 2 x+2 \cos ^{2} 2 x-1=0$, or $\cos 2 x+2 \cos ^{2} 2 x=0$. The latter is equivalent to $\cos 2 x(1+2 \cos 2 x)=0$, and the solutions are then obtained from

1) $\cos 2 x=0 \Leftrightarrow 2 x=(2 k+1) \frac{\pi}{2} \Leftrightarrow x=(2 k+1) \frac{\pi}{4}$, for $k \in \mathbb{Z}$ or
2) $\cos 2 x=-\frac{1}{2} \Leftrightarrow 2 x=(2 k+1) \pi \pm \frac{\pi}{3} \Leftrightarrow x=k \pi+\frac{\pi}{2} \pm \frac{\pi}{6}$. The latter can, due to the arbitrariness of $k \in \mathbb{Z}$, be written in the form $x=k \pi \pm \frac{\pi}{3}$.

Thus, the set of solutions of the equation is given by

$$
M=\left\{\left.(2 k+1) \frac{\pi}{4} \right\rvert\, k \in \mathbb{Z}\right\} \cup\left\{\left.k \pi \pm \frac{\pi}{3} \right\rvert\, k \in \mathbb{Z}\right\}
$$

Let's consider the function $f(x)=3-2 x-x^{2}$. For it, it is true that the vertex is at point $T(-1,4)$, it increases on the interval ( $-\infty,-1$ ), and decreases on $(-1, \infty)$. Then, for the maximum value of the set $\mathrm{M}$, we will consider the function as an increasing function on $M \cap(-\infty,-1)$, and then as a decreasing function on $M \cap(-1, \infty)$. On $M \cap(-\infty,-1)$, the point where the function reaches its maximum value is $-\frac{\pi}{3}$, and on $M \cap(-1, \infty)$, the point where the function reaches its maximum value is $-\frac{\pi}{4}$. It remains to compare $f\left(-\frac{\pi}{3}\right)=3+\frac{2 \pi}{3}-\frac{\pi^{2}}{4}$ and $f\left(-\frac{\pi}{4}\right)=3+\frac{\pi}{2}-\frac{\pi^{2}}{4}$. Since $f\left(-\frac{\pi}{3}\right)>f\left(-\frac{\pi}{4}\right)$, the maximum value of the function on the set of solutions of the equation is reached at $-\frac{\pi}{3}$ and is $f\left(-\frac{\pi}{3}\right)=3+\frac{2 \pi}{3}-\frac{\pi^{2}}{4}$.