[Math] General solutions for the Diophantine equation $ax+by+cxy=d$

diophantine equationsnumber theory

I'm trying to find a formula for the general solutions for the equation $ax+by+cxy=d$.

I know the general solutions for the Diophantine equation $ax+by=c$ are as follows:
Denote $d=gcd(a,b)$;

  1. A solution exists iff $d|c$
  2. $(x_0,y_0)$ is a solution iff the solutions are exactly $(x,y) = (x_0+nb/d,y_0-na/d)$ s.t $n$ is an integer

For the equation $ax+by+cxy=d$ i have only the first part: i know the equation is equivalent to the equation $(cx+a)(cy+b)=ab+cd$ hence there is a solution iff it is possible to factor $ab+cd$ to 2 factors congruent to $a$ and $b$ modulo $c$.

I know i can factor the right side of the equation to 2 factors in every possible way and check one by one and get all solutions. Is it possible that there is a better way to find the solutions?

Thanks for any help!

Best Answer

$$ax+by+cxy=d$$ $$cxy + ax+by=d$$ $$c^2xy + acx+bcy=cd$$ $$c^2xy + acx+bcy + ab= ab +cd$$ $$ (cx+b)(cy+a)= ab +cd$$ To finish, find all integer products $$ mn = ab+cd, $$ both positive and negative $m,n,$ then take all $$ cx+b = m; \; \; cy+a = n $$ for which both $x,y$ are integers, maybe positive, maybe negative.

Related Question