Solve the following equation:

$\operatorname{tg}(\pi \operatorname{tg} x)=\operatorname{ctg}(\pi \operatorname{ctg} x)$.
The equation is meaningful if $\operatorname{tg}(\pi \operatorname{tg} x)$ and $\operatorname{ctg}(\pi \operatorname{ctg} x)$ are meaningful, that is, if $\operatorname{tg} x$ is meaningful and not equal to $\left(l+\frac{1}{2}\right)$, where $l$ is an integer, and $\operatorname{ctg} x$ is meaningful and not an integer.

Using the relationship $\operatorname{ctg} \varphi=\operatorname{tg}\left(\frac{\pi}{2}-\varphi\right)$, from (1) we get the equation

$$
\operatorname{tg}(\pi \operatorname{tg} x)=\operatorname{tg}\left(\frac{\pi}{2}-\pi \operatorname{ctg} x\right) \quad \text { equation. }
$$

The tangents of two numbers are exactly equal if the difference between the numbers is an integer multiple of $\pi$, so (2) is true exactly when

$$
\begin{gathered}
\pi \operatorname{tg} x-\left(\frac{\pi}{2}-\pi \operatorname{ctg} x\right)=k \pi, \quad \text { that is, } \\
\operatorname{tg} x+\operatorname{ctg} x=k+\frac{1}{2}
\end{gathered}
$$

where $k$ is any integer.

Thus, the solutions to equation (1) are exactly those real numbers $x$ for which there exists an integer $k$ such that (3) holds, and such that there are no integers $l, m$ for which the value of $\operatorname{tg} x$ is $l+\frac{1}{2}$ or $\frac{1}{m}$.

Equation (3) can be rewritten as a quadratic equation in $\operatorname{tg} x$, whose solution is

$$
\operatorname{tg} x=\frac{k+\frac{1}{2} \pm \sqrt{\left(k+\frac{1}{2}\right)^{2}-4}}{2}=\frac{2 k+1 \pm \sqrt{4 k^{2}+4 k-15}}{4}
$$

The equation has a solution only if $D=4 k^{2}+4 k-15 \geq 0$, so in (4) $k \geq 2$ or $k \leq-3$.

We also need to check if there are values of $k$ for which the right-hand side of (4) is excluded for $\operatorname{tg} x$, that is, of the form $l+\frac{1}{2}$ or $\frac{1}{m}$. Let's see for which values of $k$ the (3) equation can have a rational solution. This is true exactly when the square root in (4) is a perfect square, since the square root of an integer is either an integer or irrational.

If $D=4 k^{2}+4 k-15=(2 k+1)^{2}-16$ is a perfect square of an integer, then - since for numbers with an absolute value greater than 8, the difference between the squares of adjacent numbers is already at least 17 - $|2 k+1| \leq 8$ or $k \leq 2$ or $k<-3$ for any integer.

Finally, equation (5) is solvable for every real number $y$, the solutions are:

$x=\operatorname{arctg} y+n \cdot \pi$, where $n$ is any integer.