5. Find all pairs of integers $(x ; y)$ that satisfy the equation

$$
x^{2}+x y+y^{2}=x+20
$$
Solution. Consider this equation as a quadratic in terms of the variable $x$: $x^{2}+(y-1) x+\left(y^{2}-20\right)=0$. Its discriminant $D=(y-1)^{2}-4\left(y^{2}-20\right)=81-2 y-3 y^{2}$ must be non-negative, that is, $3 y^{2}+2 y-81 \leqslant 0$. This inequality holds for $y \in\left[\frac{-1-2 \sqrt{61}}{3} ; \frac{-1+2 \sqrt{61}}{3}\right]$. In this interval, there are ten integer values of $y$ from -5 to 4. Since we need to find pairs of integers, the discriminant $D$ must be a perfect square. By direct verification, we find that this is the case for $y=-5 ; 0 ; 4$.

- 1) If $y=-5$, then $D=16$ and we get the equation $x^{2}-6 x+5=0$, which has integer roots 1 and 5, and thus we find two pairs of integers $(1 ;-5)$ and ( $5 ;-5)$.
- 2) If $y=0$, then $D=81$ and we get the equation $x^{2}-x-20=0$, which has integer roots -4 and 5, and thus we find two pairs of integers $(-4 ; 0)$ and $(5 ; 0)$.
- 3) If $y=4$, then $D=25$ and we get the equation $x^{2}+3 x-4=0$, which has integer roots -4 and 1, and thus we find two pairs of integers $(-4 ; 4)$ and ( $1 ; 4$ ).

Thus, the equation is satisfied by six pairs of integers: $(1 ;-5)$, $(5 ;-5),(-4 ; 0),(5 ; 0),(-4 ; 4)$, and $(1 ; 4)$. Answer: $(1 ;-5),(5 ;-5),(-4 ; 0),(5 ; 0),(-4 ; 4)$, $(1 ; 4)$.

Comment. The graph of the equation $x^{2}+x y+y^{2}=x+20$ is an ellipse, as shown below. The ellipse passes through six points with the above-mentioned integer coordinates.

![](https://cdn.mathpix.com/cropped/2024_05_06_80f507cb712a24a58c0cg-2.jpg?height=765&width=823&top_left_y=1916&top_left_x=662)