# Prove the binary quadratic forms $5x^2+xy+y^2$ and $x^2-xy+5y^2$ are equivalent

I need to show the binary quadratic forms $$5x^2+xy+y^2$$ and $$x^2-xy+5y^2$$ are equivalent. We've only touched on quadric forms, and the only definition I have for "equivalence" is that one can be transformed into the other via a substitution:

$$x = px' +qy', \hspace{15mm}y=rx'+sy'$$

with $ps-qr=1$. How can I find such a substitution? Or is there a way to do this without actually having to find the substitution itself?

Thank you guys for any insight into this. This is getting beyond what I can keep in my head

-
Please do me a favor, given any $f(x,y) = a x^2 + b x y + c y^2,$ abbreviated as $\langle a,b,c \rangle,$ perform the same process as in my answer and find that equivalent form, then do the same starting over with $\langle a,b,c \rangle$ but use the matrix on the right side given by $$P = \left( \begin{array}{cc} 1 & t \\ 0 & 1 \end{array} \right)$$ for integer $t.$ These suffice for positive forms. – Will Jagy Nov 13 '12 at 5:08
Also see math.stackexchange.com/questions/236146/… for a short discussion of equivalence for indefinite forms. – Will Jagy Nov 13 '12 at 5:40
Great link, thank you! – Margret Button Nov 14 '12 at 16:08

Sure. Take the "Hessian" matrix of the first form as $$H = \left( \begin{array}{cc} 10 & 1 \\ 1 & 2 \end{array} \right)$$ Now take the matrix $P \in SL_2 \mathbb Z$ given by $$P = \left( \begin{array}{cc} 0 & -1 \\ 1 & 0 \end{array} \right)$$ and calculate $$P^T H P$$
Thanks for the reply! I've been looking into this, but can't seem to get it to turn out. I must be missing something. I'm naively trying $\dbinom{x'}{y'} = P^THP \dbinom{x}{y}$ and not getting desired results. Clearly I'm missing something.. – Margret Button Nov 13 '12 at 4:09
@MargretButton, the matrix $P^T H P$ is the Hessian matrix of another, equivalent, quadratic form. That is equivalence, multiplication of the Hessian matrix on the right by a matrix of determinant 1 and on the left by its transpose. – Will Jagy Nov 13 '12 at 4:19