How do I Transform a Quadratic expression into a Pell Equation? I have been told that a simple linear transformation (or a change of variables) can transform the quadratic  $$x^2+45xy-216y^2$$ into the Pell equation $$p^2−321q^2=1$$ However I have been unable to achieve this.  Can anyone help me find a simple linear transformation (or a change of variables) to arrive at the Pell equation above? I want to eliminate the xy  term in the quadratic.

Let $p=x+\dfrac{45}2y$ and $q=\dfrac32y$.  
Then $p^2-321q^2=x^2+45xy+\dfrac{2025}4y^2-321\dfrac94y^2=x^2+45xy-216y^2.$
