8.099. $\operatorname{ctg} x-\operatorname{tg} x+2 \cdot\left(\frac{1}{\operatorname{tg} x+1}+\frac{1}{\operatorname{tg} x-1}\right)=4$.
Solution.

Domain of definition: $\left\{\begin{array}{l}\operatorname{tg} x \neq \pm 1, \\ \cos x \neq 0, \\ \sin x \neq 0\end{array}\right.$

From the condition

$\frac{\cos x}{\sin x}-\frac{\sin x}{\cos x}+\frac{\frac{4 \sin x}{\cos x}}{\frac{\sin ^{2} x}{\cos ^{2} x}-1}=4 \Leftrightarrow \frac{\cos ^{2} x-\sin ^{2} x}{\sin x \cos x}+\frac{4 \sin x \cos ^{2} x}{\cos x\left(\sin ^{2} x-\cos ^{2} x\right)}=4 \Leftrightarrow$

$\frac{2 \cos 2 x}{\sin 2 x}-\frac{2 \sin 2 x}{\cos 2 x}=4, \frac{\cos ^{2} 2 x-\sin ^{2} 2 x}{2 \sin 2 x \cos 2 x}=1, \frac{\cos 4 x}{\sin 4 x}=1, \operatorname{ctg} 4 x=1$.

From this, $4 x=\frac{\pi}{4}+\pi n, \quad x=\frac{\pi}{16}+\frac{\pi n}{4}=\frac{\pi}{16}(4 n+1), \quad n \in Z$.

Answer: $\quad x=\frac{\pi}{16}(4 n+1), n \in Z$.