Solve the following equation in integers:

$$
x+y=x^{2}-x y+y^{2} .
$$
I. solution: Our equation is symmetric in $x$ and $y$, a quadratic, indeterminate equation, with the Diophantine requirement for the solution. Consider $x$ alone as the unknown, and $y$ as a parameter that can only take integer values. Reducing to 0, and using the quadratic formula:

$$
\begin{aligned}
& x^{2}-(y+1) x+\left(y^{2}-y\right)=0 \\
& x=\frac{y+1 \pm \sqrt{(y+1)^{2}-4\left(y^{2}-y\right)}}{2}
\end{aligned}
$$

$x$ is real if and only if the discriminant $D$ is non-negative, rational if and only if $D$ is a perfect square, and finally, an integer if and only if the numerator in (2) is even. $D=0$ holds if

$$
(y+1)^{2}-4\left(y^{2}-y\right)=-3 y^{2}+6 y+1=0
$$

that is,

$$
y'=\frac{-6+\sqrt{48}}{-6} \approx-0.15 \ldots \quad \text { and } \quad y''=\frac{-6-\sqrt{48}}{-6} \approx 2.15 \ldots
$$

Based on the factorized form of the quadratic equation, $D$ can be written as:

$$
D=-3\left(y-y'\right)\left(y-y''\right)
$$

Accordingly, $D \geq 0$ only for

$$
y' \leq y \leq y''
$$

Since $y$ is an integer, this means $y=0$ or $y=1$, because with these values, from (1),

$$
3 x-3 t+x t=x^{2}+t^{2}+2
$$

and here the left side would be negative, while the right side would be positive.

This completes the solution.

Compiled from the work of:

Szepesvári István (Budapest, Apáczai Csere J. Gyak. G. II. o. t.) Vesztergombi György (Budapest, Piarista G. II. o. t.)

Note. Instead of the last transformation, we can also show that assuming a solution of the form $x>2$ leads to a contradiction. By rearranging (1),

$$
\left(x^{2}-x\right)+\left(y^{2}-y\right)=x y, \quad \text { or } \quad \frac{x-1}{y}+\frac{y-1}{x}=1
$$

and here both terms on the left side would be negative or 0.

Kiss Tünde (Tamási, Béri Balogh Á. G. II. o. t.)

III. solution: Multiplying the difference between the right and left sides of the equation by 2, we can express the result as a sum of squares:

$$
\begin{aligned}
2 x^{2}-2 x y+2 y^{2} & -2 x-2 y=x^{2}-2 x y+y^{2}+x^{2}-2 x+y^{2}-2 y= \\
& =(x-y)^{2}+(x-1)^{2}+(y-1)^{2}-2
\end{aligned}
$$

Thus, our equation can be written as:

$$
(x-y)^{2}+(x-1)^{2}+(y-1)^{2}=2
$$

This can only be satisfied for integer values of $x, y$ if two of the squares are 1 and the third is 0. The possible solutions are:
a) $x=y, x-1= \pm 1(=y-1)$, that is, $x=y=0$ or $x=y=2$;
b) $x=1, x-y= \pm 1$, that is, $y=0$, 2; and in this case, $y-1= \pm 1$ also holds;
c) $y=1, x-y= \pm 1$, that is, $x=2,0$, (in this case, $x-1= \pm 1$).