0

I have an hyperbola in this form $$y = \frac{ax+b}{cx+d}$$ (actually in my problem $c = -1$)

and i have to find (at least)one of its integer solutions, I've seen that wolframalpha do it very quickly but i have't found any optimized solutions on the internet. How can it do it? it just bruteforce all the integers solutions?

I've read about pell's equations but i have no idea how they could help.

Thanks

1 Answers1

1

No Pell equation, the set of solutions is finite. $$ (cx+d)(cy-a) = bc-ad $$ Find all divisors $t$ of $bc-ad,$ both positive and negative, for each such $t$ find out if it is possible to have $$ cx+d = t, $$ if so then $$ cy - a = \frac{bc-ad}{t}$$ and make sure both $x,y$ come out integers.

Will Jagy
  • 139,541
  • Works fine! but for the number that i have to use $bc - ad$ is a huge number, i can easily find the factors of a, b, c and d can it help? – Crash Overflow Apr 30 '17 at 12:08
  • Among the divisors of $bc-ad$ you can find all the couples $t,s$ ($\pm$) such that : $t s=bc-ad$ and $c{(t-d)}$ and $c{(s+a)}$. – G Cab Apr 30 '17 at 14:06