4. The numbers $x$ and $y$ are such that the equalities $\cos y + \cos x = \sin 3x$ and $\sin 2y - \sin 2x = \cos 4x - \cos 2x$ hold. What is the smallest value that the sum $\sin y + \sin x$ can take?
Answer: $-1-\sin \frac{3 \pi}{8}=-1-\frac{\sqrt{2+\sqrt{2}}}{2}$.

Solution. Transform the second equality:

$$
\sin 2 y=2 \sin x \cos x-2 \sin 3 x \sin x \Leftrightarrow \sin 2 y=2 \sin x(\cos x-\sin 3 x)
$$

Substituting $-\cos y$ for $\cos x-\sin 3 x$, we get $\sin 2 y=-2 \sin x \cos y, 2 \sin y \cos y+2 \sin x \cos y=0, \cos y(\sin y+\sin x)=0$, from which there are two possibilities.

1) $\sin x+\sin y=0$, i.e., the desired expression is zero.
2) $\cos y=0$. Then $y=\frac{\pi}{2}+\pi n, n \in \mathbb{Z}$, and from the first equation, we get that

$\cos x-\sin 3 x=0 \Leftrightarrow \cos x=\cos \left(3 x-\frac{\pi}{2}\right) \Leftrightarrow\left[\begin{array}{l}x=3 x-\frac{\pi}{2}+2 \pi k, \\ x=\frac{\pi}{2}-3 x+2 \pi k, k \in \mathbb{Z}\end{array} \Leftrightarrow\left[\begin{array}{l}x=\frac{\pi}{4}-\pi k, \\ x=\frac{\pi}{8}+\frac{\pi k}{2}, k \in \mathbb{Z} .\end{array}\right.\right.$

Then the minimum value of the sum $\sin y+\sin x$ is achieved when $y=-\frac{\pi}{2}+2 \pi n, n \in \mathbb{Z}$ and $x=-\frac{3 \pi}{8}+2 \pi k, k \in \mathbb{Z}$, and it is equal to $-1-\sin \frac{3 \pi}{8}$.

To compute $\sin \frac{3 \pi}{8}$, we apply the cosine double-angle formula: $\cos \frac{3 \pi}{4}=1-2 \sin ^{2} \frac{3 \pi}{8}$, from which $\sin \frac{3 \pi}{8}=\sqrt{\frac{1-\cos \frac{3 \pi}{4}}{2}}=\frac{\sqrt{2+\sqrt{2}}}{2}$.

Thus, under the given conditions, $\min (\sin x+\sin y)=-1-\frac{\sqrt{2+\sqrt{2}}}{2}$.