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.