In my research in a different field (representation theory), the following system of equations popped up:


$$
ax=by
$$
$$
xy+a+b-ax=p
$$


where $p\in\{0,1,2,3,4\}$ and $a,b,x,y$ are integers (I am also interested in the case where x and y are rationals). I have found some solutions in some special cases e.g. when a=0 or x=2. I also wrote a simple python script to find solutions and it seems to indicate that there should be a few infinite families of solutions and a few sporadic ones. However, this is not my field at all, and I am quite unsure about the difficulty of solving such a system. Does it seem likely that one can determine all (positive) integer solutions? All solutions with x, y rational?



Solutions to a system of Diophantine equations
Here is solution in positive integers.


The equation $ax=by$ implies that there are four integers $u,v,w,t$ such that $a=uv$, $x=wt$, $b=uw$, $y=vt$.
Then the second equation takes form
$$vwt^2 + uv + uw - uvwt = p.$$
There are two cases:


**Case $u\leq t$.** We have
$$uv + uw \leq p,$$
which has a finite number of solutions in $u,v,w$, which further give quadratic equation with respect to $t$, and so a finite number of solutions in $u,v,w,t$.


**Case $u>t$.** Let $d:=u-t>0$. Substituting $u=t+d$ we obtain
$$tv + dv + tw + dw - dvwt = p$$
that is
$$(tv - 2)(dw - 2) + (dv - 2)(tw - 2) = 8 - 2p.$$
Here we first consider the subcase when all $tv,dw,dv,tw\geq 3$ with a finite number of solutions. Then we consider 8 subcases with each of these products equal 1 or 2. For example:


* if $tv=1$, then $t=v=1$ further implying $d+w=2p-2$, again with a finite number of solutions.
* if $tv=2$, then $(t,v)=(1,2)$ or $(t,v)=(2,1)$, implying $(2d - 2)(w - 2) = 8 - 2p$ or $(d - 2)(2w - 2) = 8 - 2p$, respectively. Here we have a finite number of solutions unless $p=4$, in which case there are infinite series of solutions such as $(v,t,d)=(2,1,1)$ and arbitrary $w$.


