# Reduction of quadratic diophantine equation to Pell's equation?

I have seen many statements to the effect that the general quadratic diophantine equation $$ax^2+bxy+cy^2+dx+ey+f=0$$ can be reduced to a "Pell-type" equation of the form $x^2-ny^2=m$, but I haven't been able to find a good reference for this.

Can someone point me to a nice textbook-style treatment? Thanks.

P.S. I see many specific examples of this problem on StackExchange but I don't see any pointers to the general theory.

P.P.S. I am not looking for the solution of the Pell equation; I am looking for the reduction of the general quadratic to the Pell equation.

• Complete the squares. – Qiaochu Yuan Mar 14 '17 at 19:43
• – individ Mar 15 '17 at 5:53

Actually, there are many articles explaining this in detail. For example, the recent text by K. Matthews, Solving the Diophantine equation $ax^2+bxy+cy^2+dx+ey+f=0$, using completing the square, the discriminant, some translations and modulo considerations. It also has several examples.

(If you want the specific transformation.) Given any QDE,

$$ax^2+bxy+cy^2+dx+ey+f=0$$

then Legendre established that it can be transformed (in fact) to two Pell-type equations,

$$u^2-Dv^2 = k$$

as,

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

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

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

Note: One can easily recover $x,y$ from $u,v$. But if $u,v$ is integral, it is no guarantee that the $x,y$ will be integral as well.