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)$;
- A solution exists iff $d|c$
- $(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!