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$

Added: The approach below is ugly: It would be most comfortable to delete. 
We look at your second equation. Look first at the case $x\ge 0$, $y\ge 0$. We have $x^2+y^2-xy=(x-y)^2+xy$. Thus $x^2+y^2-xy\ge xy$. So if the equation is to hold, we need $xy\le x+y$. 
Note that $xy-x-y=(x-1)(y-1)-1$. The only way we can have $xy-x-y\le 0$ is if $(x-1)(y-1)=0$ or $(x-1)(y-1)=1$. 
In the first case, we have $x=1$ or $y=1$. Suppose that $x=1$. Then we are looking at the equation $1+y=1+y^2-y$, giving $y=0$ or $y=2$. By symmetry we also have the solution $y=1$, $x=0$ or $x=2$.
If $(x-1)(y-1)=1$, we have $x=0$, $y=0$ or $x=2$, $y=2$.
Now you can do an analysis of the remaining $3$ cases $x\lt 0$, $y\ge 0$; $y\lt 0$, $x\ge 0$; $x\lt 0$, $y\lt 0$. There is less to these than meets the eye. The first two cases are essentially the same. And since $x^2+y^2-xy=\frac{1}{2}((x-y)^2+x^2+y^2)$, we have $x^2+y^2-xy\ge 0$ for all $x,y$, so $x\lt 0$, $y\lt 0$ is impossible. 
