I have to write a function which solves the diophantine equation $p(s)x^2 = q(s)$ (in $x$) where $p,q$ are integers polynomials in $s.$ This is doable since $p(s) \mid q(s)$ has only finite solutions (in my context at least). I also know $\deg q=4, \deg p = 2.$

For example $(45s^2 + 264s + 376)^2=x^2(21s^2 + 120s + 160)$ has the only solutions $(s,x)=(-4,10),(-2,14).$

Is there a ways I can do this on Macaulay2 (since my code there produces equations like these)? I can manually solve each equation on Mathematica, but copy pasting each equation is prone to errors and I want to automate the whole process on Macaulay2.



You must log in to answer this question.