4. Variant 1.

It is known that

$$
\frac{1}{\cos (2022 x)}+\operatorname{tg}(2022 x)=\frac{1}{2022}
$$

Find $\frac{1}{\cos (2022 x)}-\operatorname{tg}(2022 x)$.
Answer: 2022.

Solution 1.

\[
\begin{aligned}
& \frac{1}{\cos 2A} + \tan 2A = \frac{1 + \sin 2A}{\cos 2A} = \frac{\cos^2 A + \sin^2 A + 2 \sin A \cdot \cos A}{\cos^2 A - \sin^2 A} = \frac{(\cos A + \sin A)^2}{(\cos A - \sin A)(\cos A + \sin A)} = \frac{\cos A + \sin A}{\cos A - \sin A} \\
& \frac{1}{\cos 2A} - \tan 2A = \frac{1 - \sin 2A}{\cos 2A} = \frac{\cos^2 A + \sin^2 A - 2 \sin A \cdot \cos A}{\cos^2 A - \sin^2 A} = \frac{(\cos A - \sin A)^2}{(\cos A - \sin A)(\cos A + \sin A)} = \frac{\cos A - \sin A}{\cos A + \sin A}
\end{aligned}
\]

Therefore, if \(\frac{1}{\cos (2022x)} + \tan (2022x) = \frac{1}{2022}\), then \(\frac{1}{\cos (2022x)} - \tan (2022x) = 2022\).

Solution 2.

Consider the product \(\left(\frac{1}{\cos \alpha} + \tan \alpha\right)\left(\frac{1}{\cos \alpha} - \tan \alpha\right) = \frac{1}{\cos^2 \alpha} - \tan^2 \alpha = 1\). Therefore, the desired expression is 2022.