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.

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$.
