Def/Discriminant of a binary quadratic form

 =Topograph= Suppose that $Q(x,y) = ax^2 + bxy + cy^2$ is a binary quadratic form. At home base, the range topograph of $Q$ has outputs $a$, $c$, $a+b+c$, and $a-b+c$.





Observe that: $$b^2 - 4ac = (a-c)^2 - (a+b+c)(a-b+c).$$ Hence, one may compute the discriminant simply by looking at a cell in the topograph. The discriminant is given by: $$\Delta(Q) = (u-v)^2 - ef.$$ Indeed, we have checked this at "home base". Moreover, the discriminant can be computed using the above formula, at any "cell" in the topograph. For example, consider the diagram of adjacent cells. By the arithmetic progression rule, $g = -v + 2(u+e)$. Computing the discriminant using the cell labelled by $u,v,e,f$ yields: $$\Delta = (u-v)^2 - ef.$$ Computing the discriminant using the adjacent cell labelled by $v,e,u,g$ yields: $$\Delta' = (u-e)^2 - vg.$$ We claim that these are equal. A computation yields: $$(u-e)^2 - vg = (u-e)^2 - v(-v + 2(u+e)) = u^2 - 2ue + e^2 + v^2 - 2uv - 2ev.$$ $$(u-e)^2 - vg = u^2 - 2uv + v^2 - e(-e + 2(u+v)).$$ Observe that $-e + 2(u+v) = f$, by the arithmetic progression rule. Hence, we find that: $$(u-e)^2 - vg = (u-v)^2 - ef.$$ Hence, the discriminant, as computed by one cell, equals the discriminant, as computed by an adjacent cell. Since the topograph is connected, the discriminant can be computed at any cell via the formula: $$\Delta = (u-v)^2 - ef.$$

=Classification=

The discriminant of a quadratic form determines, to a large extent, the features of the range topograph. If $Q$ is a binary quadratic form of discriminant $\Delta$, then:
 * If $\Delta < 0$, then $Q$ is "definite". There are no lakes or rivers in the range topograph of $Q$.  Every value of $Q$ is positive, or every value of $Q$ is negative (excluding, of course, $Q(0,0)$ which equals zero).
 * If $\Delta = 0$, then $Q$ is "degenerate". There is one lake.  There exists an integer $z$, such that every face adjacent to the lake is labelled by $z$.  The values of $Q$ are precisely the integers of the form $z \cdot n^2$, for $n \in \ZZ$.  In other words, the values of $Q$ are the perfect square multiples of $z$:  $\{ 0, z, 4z, 9z, 16z, 25z, \ldots \}$.
 * If $\Delta > 0$, and $\Delta$ is not a perfect square, then there are no lakes. There is one endless river, and $Q$ takes both positive and negative values.  $Q$ is called indefinite.
 * If $\Delta > 0$, and $\Delta$ is a perfect square, then there are two lakes. Either these lakes are adjacent, or they are joined by a river.  $Q$ takes positive and negative values, as well as zero.