I have been discussing the fastest and most efficient ways of solving QDEs in a separate question record (Alternative method to solve quadratic Diophantine equations). However, as suggested by individ, I want to shunt the discussion onto new tracks. Note also, that I am aware of similar entries related to this topic (like Solving Pell's equation(or any other diophantine equation) through modular arithmetic.) but my questions are slightly different and the special case I am interested in (see below in bullets) does not match the previous QDEs discussed.

Again we have: $$Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0 $$

where $ A,B,C,D,E,F \in \mathbb Z$

Individ suggested that instead of following a general algorithm proposed by Dario Alpern (https://www.alpertron.com.ar/METHODS.HTM) a more elegant and computationally faster may be a method of transforming QDE into some form of Pell's equation.

The questions are:

  • Can any QDE be transformed into some form of Pell's equation? If yes, please provide guidelines.
  • If not, then at least is it feasible for $A=1, B=0, C=-1, D=D_0, E=0, F=F_0$ , where $ D_0 > F_0 $ and $ F_0 > 1 $? If yes, then please provide guidelines how to do this at least in outline.
  • Does such transformations into Pell's yield any substantial advantage in terms of solving QDE over Alpern's guidelines? This is perhaps the most crucial question -- Does solving QDE through Pell's transformation involve finding integer divisors of some linear combination of $D$ and $F$ during the solving process? If so, then the whole idea seems pointless from computational perspective.
  • $\begingroup$ The formula for this equation is very large and bulky. Might first consider simpler? Such? $Ax^2+Bxy+Cy^2=F$ $\endgroup$
    – individ
    Mar 31, 2016 at 17:32

1 Answer 1


Legendre has long established this.

I. Transformation

Given any QDE,


then it can be transformed to two Pell-type equations,

$$u_i^2-Dv_i^2 = k_i\tag2$$


$$(Dy-2ae+bd)^2-D(2ax+by+d)^2 = 4a(ae^2+cd^2-bde+Df)\tag3$$

$$(Dx-2cd+be)^2-D(2cy+bx+e)^2 = 4c(ae^2+cd^2-bde+Df)\tag4$$

with the same discriminant $D=b^2-4ac$.

But there is a problem. Once you've found integer $u,v$ then, by undoing the transformation, it does not guarantee that $x,y$ will be integers as well.

II. Example


By formulas $(3),(4)$, this can be transformed to either,

$$p^2-320q^2 = -4\times113920$$ $$r^2-320s^2 = -5\times113920$$

Let's use the Alpertron:

  1. It gives a small solution $p,q = 80,38$ which yields rational $x, y = \frac{37}{8}, \frac{5}{4}$.
  2. Fortunately, another family starts with $p,q = 640,54$ and gives integer $x,y = 2,3$.
  3. We also have $r,s = 280, 45$ which yields $x, y = \frac{11}{8}, \frac{15}{4}$.
  4. But $r,s = 480, 50$ gives$x,y = 2,3$.

Thus, if you're not fortunate, you'll only end up with rational $x,y$.

  • $\begingroup$ Dear Tito ,can you please try to solve this [problem][math.stackexchange.com/questions/1756575/… $\endgroup$
    – Nicco
    Apr 24, 2016 at 15:12
  • $\begingroup$ Is it always true that ONE of the two equations will lead to integral $x,y$, or can it be that both solutions might result in rational [non-integral] $x,y$ only? $\endgroup$ Aug 11, 2016 at 13:22
  • 1
    $\begingroup$ @KierenMacMillan If $(1)$ has integer solutions, then it is guaranteed that at least one of the two Pell-like eqns would lead to that solution. Thus, your question is essentially asking if $(1)$ can only have rational solutions and I'm not sure to the answer to that. $\endgroup$ Aug 11, 2016 at 16:51
  • $\begingroup$ I only meant the first part of your sentence: if (1) has integer solutions, will undoing the transformation still lead [back] to those integer solutions… $\endgroup$ Aug 11, 2016 at 17:33
  • 1
    $\begingroup$ @KierenMacMillan: Given an arbitrary integer solution $x,y$ to $(1)$, then it corresponds to an integer $u,v$ so undoing the transformation will necessarily lead back to that $x,y$. But not the other way round. Given an arbitrary integer solution $u,v$, then it does not necessarily lead to integer $x,y$. $\endgroup$ Aug 12, 2016 at 0:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .