# Representations of integers by a binary quadratic form

Let $\mathfrak{F}$ be the set of binary quadratic forms over $\mathbb{Z}$. Let $f(x, y) = ax^2 + bxy + cy^2 \in \mathfrak{F}$. Let $\alpha = \left( \begin{array}{ccc} p & q \\ r & s \end{array} \right)$ be an element of $SL_2(\mathbb{Z})$. We write $f^\alpha(x, y) = f(px + qy, rx + sy)$. Since $(f^\alpha)^\beta$ = $f^{\alpha\beta}$, $SL_2(\mathbb{Z})$ acts on $\mathfrak{F}$ from right.

Let $f, g \in \mathfrak{F}$. If $f$ and $g$ belong to the same $SL_2(\mathbb{Z})$-orbit, we say $f$ and $g$ are equivalent.

Let $f = ax^2 + bxy + cy^2 \in \mathfrak{F}$. We say $D = b^2 - 4ac$ is the discriminant of $f$. Let $m$ be an integer. If $m = ax^2 + bxy + cy^2$ has a solution in $\mathbb{Z}^2$, we say $m$ is represented by $ax^2 + bxy + cy^2$. If $m = ax^2 + bxy + cy^2$ has a solution $(s, t)$ such that gcd$(s, t) = 1$, we say $m$ is properly represented by $ax^2 + bxy + cy^2$.

Is the following proposition true? If yes, how do we prove it?

Proposition Let $ax^2 + bxy + cy^2 \in \mathfrak{F}$. Suppose its discriminant is not a square. Let $m$ be an integer. Then $m$ is properly represented by $ax^2 + bxy + cy^2$ if and only if there exist integers $l, k$ such that $ax^2 + bxy + cy^2$ and $mx^2 + lxy + ky^2$ are equivalent.

-
Yes, of course. Take the representation of $m$ as one column of a 2 by 2 matrix and solve for the other column so as to have determinant $1.$ Call that $R$, and call the Hessian matrix of the first form $H.$ The Hessian of the new form is $R^T H R.$ – Will Jagy Sep 4 '12 at 22:59
Why is this question so full of notation that isn't used at all in the formulation of the actual problem? – t.b. Sep 8 '12 at 1:09
@t.b. Because we use the definitions in my other questions and I think it's convenient for the readers having the relevant definitions in the same place. – Makoto Kato Sep 8 '12 at 1:16
@Makoto: ... at the cost of obscuring this question. I also think it unlikely that readers of your other questions will find it convenient. I don't think such a style of presentation suits this type of medium -- it would be more appropriate for, say, a book, blog, or wiki. – Hurkyl Sep 8 '12 at 3:01
@Makoto: You have the advantages of already knowing the context and having recently written the post, so that you can easily ignore everything that isn't the actual question. t.b.'s comment lets me put words to a problem I've had with your questions previously: a large fraction of your questions I never finish reading, because they drag on and on and I lose interest before I actually get to the content of the question. – Hurkyl Sep 8 '12 at 3:43

I cannot understand the comment of William Jagy, but I think this question is in fact quite easy, and I shall employ the method using topographs as in Cnonway's Sensual Quadratic Form.
But, once one knows what a topograph is, and some basic properties if that concept, this becomes an easy exercise.
A topograph of a quadratic form is like .
Here the lettres mean the values represented by a form $f$. And we represent $m$ there. The condition that $m$ is properly represented implies that the representation must occur in the graph(see Conway's little book). Then, taking $h=m+x-y$, we shall find that the form $f$ is equivalent with $\langle m,h,x\rangle$, as required(see the book again). (For an example of the graph, see the answer of Will Jagy.)
Conversely, if there is such a form $\langle m,h,x\rangle$ equivalent with $f$, then $f$ should also properly represent $m$, as the other form does.
Feel free to tell me where the errors are, if any; thanks in advance.
P.S. The diagram above is hand-made, and is in fact modelled on the form $X^2+4XY+Y^2$.

-

Lemma 1 Let $f = ax^2 + bxy + cy^2 \in \mathfrak{F}$. Let $\alpha = \left( \begin{array}{ccc} p & q \\ r & s \end{array} \right)$ be an element of $SL_2(\mathbb{Z})$. Then $f^\alpha(x, y) = f(px + qy, rx + sy) = kx^2 + lxy + my^2$, where

$k = ap^2 + bpr + cr^2$

$l = 2apq + b(ps + qr) + 2crs$

$m = aq^2 + bqs + cs^2$.

Proof: Clear.

Proof of the proposition Let $f(x, y) = ax^2 + bxy + cy^2$.

Suppose $m$ is properly represented by $f(x, y)$. There exist integers $p, r$ such that gcd$(p, r) = 1$ and $m = f(p, r)$. Since gcd$(p, r) = 1$, there exist integers $s, r$ such that $ps - rq = 1$. By Lemma 1, $f(px + qy, rx + sy) = mx^2 + lxy + ky^2$, where

$m = ap^2 + bpr + cr^2$

$l = 2apq + b(ps + qr) + 2crs$

$k = aq^2 + bqs + cs^2$.

Hence, $ax^2 + bxy + cy^2$ and $mx^2 + lxy + ky^2$ are equivalent.

Conversely suppose $ax^2 + bxy + cy^2$ and $mx^2 + lxy + ky^2$ are equivalent. There exists integer $p, q, r, s$ such that $ps - rq = 1$ and $f(px + qy, rx + sy) = mx^2 + lxy + ky^2$. Letting $x = 1, y = 0$, we get $f(p, r) = m$. Since $ps - rq = 1$, gcd$(p, r) = 1$. Hence $m$ is properly represented by $ax^2 + bxy + cy^2$.

-