<s>[INST] The number of integral solutions for the equation $x-y = x^2 + y^2 - xy$ Find the number of integral solutions for the equation $x-y = x^2 + y^2 - xy$ and the equation of type $x+y = x^2 + y^2 - xy$
 [/INST] $$x-y = x^2 + y^2 - xy \Leftrightarrow \\
2x-2y = 2x^2 + 2y^2 - 2xy \Leftrightarrow \\
0= 2x^2 + 2y^2 - 2xy-2x+ 2y \Leftrightarrow \\
(x-y)^2+(x-1)^2+(y+1)^2=2$$
As $x,y$ are integers, there are only 2 possibilities for each bracket: $0$ or $1$. So two of the squares have to be $1$ and the third one must be $0$.
Second one leads to 
$$(x-y)^2+(x-1)^2+(y-1)^2=2$$
</s>