Definition: Let $f(x, y) = ax^2 + bxy + cy^2$ and $g(x, y) = Ax^2 + Bxy + Cy^2$ be binary quadratic forms. Then $f$ and $g$ are said to be Equivalent denoted $f \sim g$ if there exists $m_{11}, m_{12}, m_{21}, m_{22} \in \mathbb{Z}$ such that $f(x, y) = g(m_{11}x + m_{12}y, m_{21}x + m_{22}y)$ and such that $\det \begin{bmatrix} m_{11} & m_{12} \\ m_{21} & m_{22} \end{bmatrix} = m_{11}m_{22} - m_{12}m_{21} = 1$.

For example, let $f(x, y) = x^2 + y^2$ and let $g(x, y) = 13x^2 + 16xy + 5y^2$. Let:

(1)
\begin{align} \quad m_{11} &= 2 \\ m_{12} &= 1 \\ m_{21} &= 3 \\ m_{22} &= 2 \end{align}

Then:

(2)
\begin{align} \quad f(m_{11}x + m_{12}y, m_{21}x + m_{22}y) &= f(2x + y, 3x + 2y) \\ &= (2x + y)^2 + (3x + 2y)^2 \\ &= 4x^2 + 4xy + y^2 + 9x^2 + 12xy + 4y^2 \\ &= 13x^2 + 16xy + 5y^2 \\ &= g(x, y) \end{align}

Therefore $f$ and $g$ are equivalent binary quadratic forms.

Now let $f(x, y) = ax^2 + bxy + cy^2$ with discriminant $d$ and let $g(x, y) = Ax^2 + Bxy + Cy^2$ with discriminant $D$. Suppose that $f \equiv g$ so that there exists integers $m_{11}, m_{12}, m_{21}, m_{22} \in \mathbb{Z}$ such that $f(m_{11}x + m_{12}y, m_{21}x + m_{22}y) = g(x, y)$ where $m_{12}m_{22} - m_{12}m_{21} = 1$. Let:

(3)
\begin{align} \quad M = \begin{bmatrix} m_{11} & m_{12} \\ m_{21} & m_{22} \end{bmatrix} \quad , \quad \quad F = \begin{bmatrix} a & \frac{1}{2}b \\ \frac{1}{2}b & c \end{bmatrix} \quad , \quad G = \begin{bmatrix} A & \frac{1}{2}B \\ \frac{1}{2}B & C \end{bmatrix} \quad , \quad X = \begin{bmatrix} x\\ y \end{bmatrix} \end{align}

There are a few observations that can be made. First, observe that:

(4)
\begin{align} \quad X^TFX &= \begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} a & \frac{1}{2}b \\ \frac{1}{2}b & c \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} \\ &= \begin{bmatrix} ax + \frac{1}{2}by & \frac{1}{2}bx + cy \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} \\ &= \begin{bmatrix} ax^2 + \frac{1}{2}bxy + \frac{1}{2}bxy + cy^2 \end{bmatrix} \\ &= \begin{bmatrix} f(x, y) \end{bmatrix} \end{align}

Similarly:

(5)
\begin{align} \quad X^TGX = [g(x, y)] \end{align}

Since $f \sim g$ we have that:

(6)
\begin{align} \quad (MX)^TF(MX) &= X^TGX \\ X^TM^TFMX &= X^TGX \end{align}

Therefore, if $f \sim g$ and we have that:

(7)
\begin{align} \quad G = M^T F M \end{align}
 Proposition 1: Let $f$, $g$, and $h$ be binary quadratic forms. a) $f \sim f$ (Reflexivity Property). b) If $f \sim g$ then $g \sim f$ (Symmetry Property). c) If $f \sim g$ and $g \sim h$ then $f \sim h$ (Transitivity Property).

Properties (a), (b), and (c) tell us that equivalence of binary quadratic forms is an equivalence relation.

• Proof of a) Let $M = I_2$, the $2 \times 2$ identity matrix. Then clearly $F = I^T F I$. So $f \sim f$.
• Proof of b) Since $f \sim g$ we have that $G = M^T F M$ where $\det (M) = 1$. Since $\det (M) = 1$, we have that:
(8)
\begin{align} \quad F = (M^T)^{-1} G M^{-1} = (M^{-1})^T G (M^{-1}) \end{align}
• So $g \sim f$.
• Proof of c) Suppose that $f \sim g$ and $g \sim h$. Then $G = M^T F M$ and $H = N^T G N$ where $\det (M) = 1$ and $\det (N) = 1$. So:
(9)
\begin{align} \quad H = N^T G N = N^T (M^T F M) N = (MN)^T F (MN) \end{align}
• Observe that $\det (MN) = \det(M) \cdot \det(N) = 1$. So $f \sim h$. $\blacksquare$
 Proposition 2: Let $f$ and $g$ be binary quadratic forms with discriminants $d$ and $D$ respectively. a) If $f \sim g$ and $n \in \mathbb{Z}$ then $n$ can be represented by $f(x, y)$ if and only if $n$ can be represented by $g(x, y)$. b) If $f \sim g$ then $d = D$.

It is important to note that the converse of (b) is not true in general. That is, $d = D$ does NOT imply that $f \sim g$.