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$

This equation can be rewritten just in another form:   $\frac{m+1}{n}+\frac{n+1}{m}=a$
Can be solved using the equation Pell:
$p^2-(a^2-4)s^2=1$
Solutions have the form:
$n=2(p-(a+2)s)s$
$m=-2(p+(a+2)s)s$
And more:
$n=\frac{2p(p+(a-2)s)}{a-2}$
$m=\frac{2p(p-(a-2)s)}{a-2}$
If this equation has a solution:   $p^2-(a^2-4)s^2=4$  Formulas are: :
$n=\frac{p-(a-2)s+2}{2(a-2)}$
$m=\frac{p+(a-2)s+2}{2(a-2)}$
Anyway I'll write more general equation: $\frac{X^2+aX+Y^2+bY+c}{XY}=j$
If this square a:
$t=\sqrt{(b+a)^2+4c(j-2)}$
Then using the equation Pell:
$p^2-(j^2-4)s^2=1$
Solutions can be written:.
$X=\frac{(b+a\pm{t})}{2(j-2)}p^2+(t\mp{(b-a)})ps-\frac{(b(3j-2)+a(6-j)\mp{(j+2)t})}{2}s^2$
$Y=\frac{(b+a\pm{t})}{2(j-2)}p^2+(-t\mp{(b-a)})ps-\frac{(b(6-j)+a(3j-2)\mp{(j+2)t})}{2}s^2$
We must also take into account that the number $p,s$ may still be different signs.
