# Classification of these Binary Quadratic Forms

What are necessary and sufficient conditions on a binary quadratic form $ax^2+bxy+cy^2$, with integer coefficients and solution set in integers, to be equivalent to $x^2-y^2$, and separately to $x^2+y^2$?

The conditions would be in terms of $a,b,c$ but can we say anything about the transformation matrix? Since we are dealing with integers, the determinant is $\pm 1$, but can it be made $1$?

I'm new to binary quadratic forms, so if these questions are trivial, an accessible reference (which answers the questions) would be great. I think the answers are known from bits and pieces that I've read online.

-

For $x^2 + y^2$, the discriminant $b^2 - 4ac$ is $-4$, and the class number $h(-4)$ is $1$. So the condition is just that the discriminant matches up: $b^2 - 4ac = -4$, and the form is positive definite ($a, c > 0$). For $x^2 - y^2$, I think you just have to differentiate it from $2xy$, which also has discriminant $4$. So the condition is $b^2 - 4ac = 4$, and $a,c$ not both even. You can make the determinant of the transformation matrix $1$ in both cases, because the form is improperly equivalent to itself, for instance by $(x,y) \to (-x,y)$. For an elementary introduction see Chapter 3 of Niven, Zuckerman and Montgomery. For a more advanced treatment of quadratic forms, Cassels book "Rational quadratic forms" is a good reference. There's also Chapter 15 of Conway and Sloane's book "Sphere packings, lattices and groups".
A small addition to Abhinav's nice answer: the discriminant $\Delta=b^2-4ac$ is the fundamental invariant of $Q(x,y)=ax^2+bxy+cy^2$. Equivalent forms have the same discriminant, and represent the same integers.
If $\Delta <0$, then then $Q(x, y)$ has no real roots.. Hence $Q(x, y)$ takes on either only positive values or negative values (and zero if $x = y = 0$). Accordingly $Q$ is either a positive definite form (e.g., $x^2 + y^2$ for $\Delta=-4$), or a negative definite form (e.g., $−x^2 − y^2$). If you have a form with $\Delta=-4$, then you can construct an equivalent form, which is reduced. For example, $$Q(x,y)=458x^2+214xy+25y^2$$ has discriminant $-4$, and the reduced equivalent form is $x^2+y^2$.
If $\Delta > 0$, then $Q(x, y)$ has a real root and $Q(x, y)$ takes on positive and negative values. That is, $Q$ is an indefinite form (e.g., $x^2-y^2$).