3. (2 points) It is known that $\operatorname{tg} a$ and $\operatorname{tg} b$ are natural numbers, and $\operatorname{tg}(a+b)$ is an integer. Find $\operatorname{tg} a$ and $\operatorname{tg} b$.
Answer:

$$
\left[\begin{array}{l}
\operatorname{tg} a=1, \operatorname{tg} b=2 \\
\operatorname{tg} a=1, \operatorname{tg} b=3 \\
\operatorname{tg} a=2, \operatorname{tg} b=1 \\
\operatorname{tg} a=3, \operatorname{tg} b=1 \\
\operatorname{tg} a=2, \operatorname{tg} b=3 \\
\operatorname{tg} a=3, \operatorname{tg} b=2
\end{array}\right.
$$

Solution: Let $x=\operatorname{tg} a$ and $y=\operatorname{tg} b$. From the formula for the tangent of a sum, we get:

$$
\operatorname{tg}(a+b)=\frac{\operatorname{tg} b+\operatorname{tg} a}{1-\operatorname{tg} a \operatorname{tg} b}=\frac{x+y}{1-x y}
$$

Thus, for $\operatorname{tg}(a+b)$ to be an integer, $x+y$ must be divisible by $x y-1$. Since $x$ and $y$ are natural numbers, $x+y$ and $x y-1$ are also natural numbers (provided $x y-1 \neq 0$). Therefore, $x+y \geqslant x y-1$, i.e., $x y-x-y+1 \leqslant 2$. Factoring the left side, we get $(x-1)(y-1) \leqslant 2$.

Suppose $x=1$. Then $y+1$ must be divisible by $y-1$, but the difference between these numbers is 2 and also divisible by $y-1$. Thus, $y-1$ is either 1 or 2, i.e., $y=2$ or $y=3$. It is easy to see that both cases work. Similarly, we consider the case $y=1$.

If the left side of the inequality $(x-1)(y-1) \leqslant 2$ is not 0, then the numbers $x-1$ and $y-1$ do not exceed 2, and only one of them can be equal to 2. Considering the cases $x=2, y=3 ; x=3, y=3$ and $x=2, y=2$, we find that the first two cases are suitable, but the third one is not.

From this, we obtain the answers.