1. Solve the equation

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

where $a$ is a real parameter.
Solution. We introduce the substitution $\sin x + \cos x = t, |t| \leq \sqrt{2}$. Then $2 \sin x \cos x = t^2 - 1$ and the given equation reduces to the equation

$$
(a-1)(t+1) = t^2 - 1, \quad t^2 \neq 1
$$

The latter is possible only for $t = a$. The equation $\sin x + \cos x = a$ has solutions if $|a| \leq \sqrt{2}$ and they satisfy the original equation if $|a| \neq 1$. Under the given conditions, the given equation has solutions

$$
x = -\frac{\pi}{4} + (-1)^n \arcsin \frac{a}{\sqrt{2}} + n \pi
$$

where $n \in \mathbb{Z}$ if $|a| < \sqrt{2}$ and $|a| \neq 1$, and $\frac{n}{2} \in \mathbb{Z}$ if $|a| = \sqrt{2}$.