Example 19. Solve the equation: $\cos ^{2} x+\cos ^{2} 3 x=2 \cos ^{2} 2 x$.
The original equation can be transformed into
$$
\begin{array}{l}
\cos ^{2} 3 x-\cos ^{2} 2 x=\cos ^{2} 2 x-\cos ^{2} x, \\
\sin 5 x \sin x=\sin 3 x \sin x, \\
\sin x(\sin 5 x-\sin 3 x)=0, \\
2 \sin ^{2} x \cos 4 x=0 .
\end{array}
$$

From $\sin x=0$ or $\cos 4 x=0$, we get $x=k \pi$ or $x=\frac{k \pi}{4}+\frac{\pi}{8}(k \in \mathbb{Z})$.