2. Find all integers $a$ for which the quadratic trinomial $x^{2}+a x+2 a$ has two distinct integer roots.
Answer: $a=-1$ and $a=9$.

First solution. Let $u$ and $v$ be the roots of the quadratic polynomial, with $u|v|$. Moreover, $a>0$ and

$$
|u| \cdot|v|=2 a, \quad|u|+|v|=a \Rightarrow \frac{1}{|u|}+\frac{1}{|v|}=\frac{1}{2}
$$

The last equality is possible only if $|v| \geqslant 3$. However, if $|v| \geqslant 4$, then $|u|>4$ and $\frac{1}{|u|}+\frac{1}{|v|}<\frac{1}{2}$. Therefore, $v=-3$, from which $u=-6$ and $a=9$.

Second solution. Since the quadratic polynomial has two integer roots, its discriminant, equal to $a(a-8)$, must be a square of a natural number. If $a$ is odd, then the factors $a$ and $a-8$ are coprime. Then $a= \pm b^{2}$ and $a-8= \pm c^{2}$ for some natural numbers $b$ and $c$, from which $c^{2}-b^{2}= \pm 8$. But 8 can only be the difference of the squares of the numbers 1 and 3. Therefore, $a=9$ or $a=-1$. If $a$ is even, then $a=2 k$, and $k(k-4)$ is the square of some natural number $n$. Then

$$
n^{2}=k(k-4)=(k-2)^{2}-4 \Rightarrow(k-2)^{2}-n^{2}=4
$$

But the squares of two natural numbers cannot differ by 4.