8.386. Given $(1+\operatorname{tg} x)(1+\operatorname{tg} y)=2$. Find $x+y$.
## Solution.

Domain of definition: $\left\{\begin{array}{l}\cos x \neq 0, \\ \cos y \neq 0 .\end{array}\right.$

Rewrite the equation as

$$
\begin{aligned}
& 1+\operatorname{tg} x+\operatorname{tg} y+\operatorname{tg} x \operatorname{tg} y=2, \operatorname{tg} x+\operatorname{tg} y=1-\operatorname{tg} x \operatorname{tg} y \Rightarrow \frac{\operatorname{tg} x+\operatorname{tg} y}{1-\operatorname{tg} x \operatorname{tg} y}=1 \Rightarrow \\
& \Rightarrow \operatorname{tg}(x+y)=1, x+y=\frac{\pi}{4}+\pi k=\frac{\pi}{4}(4 k+1), k \in Z
\end{aligned}
$$

Answer: $x+y=\frac{\pi}{4}(4 k+1), k \in Z$.