Quadratic residues and representations of integers by a binary quadratic form

Let $F = ax^2 + bxy + cy^2$ be a binary quadratic form over $\mathbb{Z}$. 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 $F$. 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 $F$.

My question Is there any other proof of the following theorem other than the Gauss's original proof? Since this theorem is important, I think having different proofs is meaningful.

It would be also nice if some one would post a modern form of the Gauss's proof, since not everybody can have an easy access to the book.

Theorem(Gauss: Disquisitiones Arithmeticae, art.154) Let $ax^2 + bxy + cy^2$ be a binary quadratic form over $\mathbb{Z}$. Let $D$ be its discriminant. Let $m$ be an integer. Suppose $m$ is properly represented by $ax^2 + bxy + cy^2$. Then $D$ is a quadratic residue modulo $4m$.

EDIT The Gauss's DA is notorious for its difficult read. This was even so for his contemporaries. Dirichlet devoted a lot of time to simplify DA. There is a legend that Dirichlet always carried DA in his travels. Gauss's proof often uses a "magic" equation which seems to come out of nowhere. One of the reasons is that, as he wrote, he could not afford elaborate proofs due to lack of enough available pages for an economical reason. So I think it would be nice if there is a more natural proof.


Solution 1:

"In this section, we'll deal primarily with bivariate functions of $x$ and $y$ of the form:

$$\tag 1 f(x,y)=ax^2 + 2bxy + cy^2$$(...) When we're not interested in the indeterminates $x,y$ we'll refer to $(1)$ as $(a,b,c)$

We'll say a number $M$ is represented in the form $(a,b,c)$ if $x,y$ can be given values such that $M=f(x,y)$.

Theorem. If the number $M$ can be represented in the form $(a,b,c)$ such that $(x,y)=1$, then $b^2-ac$ will be a quadratic residue modulus $M$.

Proof Let $m,n$ be the values of the indeterminates, that is $$ am^2 + 2bmn + cn^2 = M$$ and take $\mu$ and $\nu$ such that $m\mu+n\nu=1$. Then by multipying out we can easily show that

$$\left( {a{m^2} + 2bmn + c{n^2}} \right)\left( {a{\nu ^2} - 2b\nu \mu + c{\mu ^2}} \right) = $$

$${\left( {\mu \left( {mb + nc} \right) - \nu \left( {ma + nb} \right)} \right)^2} - \left( {{b^2} - ac} \right){\left( {m\mu + n\nu } \right)^2}$$

or $$M\left( {a{\nu ^2} - 2b\nu \mu + c{\mu ^2}} \right) = {\left( {\mu \left( {mb + nc} \right) - \nu \left( {ma + nb} \right)} \right)^2} - \left( {{b^2} - ac} \right)$$

Thus it will be the case$${b^2} - ac \equiv {\left( {\mu \left( {mb + nc} \right) - \nu \left( {ma + nb} \right)} \right)^2}\bmod M$$ as we claimed.

Solution 2:

By the proposition of this question, there exist integers $l, k$ such that $ax^2 + bxy + cy^2$ and $mx^2 + lxy + ky^2$ are equivalent. Hence $D = l^2 - 4mk$. Hence $D \equiv l^2$ (mod $4m$).