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$

For second equation:
$$x + y = x^2 + y^2 − xy$$
By dividing $xy$ on both sides
$$\frac{1}{x} + \frac{1}{y} = \frac{x}{y} + \frac{y}{x} -1 = y \text{ (say)}$$
Here for any real no. $a$
$$a + \frac{1}{a}\ge 2$$
So RHS will be $\ge1$.
But because only integer solutions are required:
LHS will be $\le 2$. (Assuming neither $x$ nor $y$ is zero).
So for this equality to be true $1\le y\le2$. Hence we need to consider cases only for $x =0,1$ and $y=0,1$
By substituting values 3 possible solutions are:
$x=0,y=0$;
$x=1,y=0$;
$x=0,y=1$;
