http://mathworld.wolfram.com/DiophantineEquation2ndPowers.html says the equation $$ax^2+bxy+cy^2=k$$ can be reduced to Pell equation.
Can someone explain how?
http://mathworld.wolfram.com/DiophantineEquation2ndPowers.html says the equation $$ax^2+bxy+cy^2=k$$ can be reduced to Pell equation.
Can someone explain how?
To sketch the how, starting with $ax^2+bxy+cy^2=k$, look at it as a quadratic in $x$. We then need
$$x = \frac{-b\pm\sqrt{b^2-4a(cy^2-k)}}{2a}$$
to be an integer. Clearly this needs $\sqrt{b^2-4a(cy^2-k)} = z$ to be an integer.
So we solve $z^2 + (4ac)y^2 = b^2 + 4ak$, which is a generalised Pell equation and I suppose you are familiar with solving.
Of course we need to (in the end) pick solutions only where $2a \mid (-b \pm z)$.
Another approach is to use a general translation $X = px + qy, Y = ry$ and then pick the values such that the cross term disappears, then complete the square etc... If I recall the specific translation, will post it. An old reference I have is http://www.math.niu.edu/~rusin/known-math/95/quadratics (check part 2)
Edit: This is a shorter and clearer answer to the older version.
Actually, Mathworld is correct when it says solving,
$$a x^2 + b x y + c y^2 = k\tag{1}$$
involves the usual Pell equation,
$$x^2-Dy^2 = \pm 1$$
Given an initial solution {$m,n$} to,
$$a m^2 + b mn + c n^2 = k\tag{2}$$
then we have the identity,
$$a x^2 + b x y + c y^2 - k = k(u^2-Dv^2-1)(u^2-Dv^2+1)\tag{3}$$
where,
$$x = m u^2 - 2 (b m + 2 c n) u v + D m v^2$$
$$y = n u^2 + 2 (2 a m + b n) u v + D n v^2$$
$$D = b^2-4ac$$
for arbitrary variables $u,v$. However, if one wishes to set $(3)$ equal to zero, then $u,v$ should be chosen to satisfy the Pell equation,
$$u^2-Dv^2=\pm 1$$
which, for non-square discriminant $D>0$, should provide an infinite number of integer solutions for the $x,y$ of $(3)$.