An integral binary quadratic form is a polynomial

f(x,y)=ax2+bxy+cy2,a,b,c∈Z.f(x,y)=ax^2+bxy+cy^2,\qquad a,b,c\in\mathbb Z.

Its discriminant is D=b2−4acD=b^2-4ac. The form is primitive if gcd⁡(a,b,c)=1\gcd(a,b,c)=1, and positive definite if f(x,y)>0f(x,y)>0 for every nonzero (x,y)∈R2(x,y)\in\mathbb R^2, equivalently a>0a>0 and D<0D<0. It is a on Q2\mathbb Q^2 together with its integral coordinate lattice.

Normalization

The middle coefficient is bb, not 2b2b. The of the form is (ab/2b/2c)\begin{pmatrix}a&b/2\\b/2&c\end{pmatrix}, so its determinant is −D/4-D/4. Confusing these two middle-coefficient conventions changes the discriminant.

For instance, x2+xy+y2x^2+xy+y^2 is primitive positive definite of discriminant −3-3. Integer changes of variables with determinant 11 give .

References
  1. Andrew V. Sutherland, 18.785 Number Theory, Fall 2018, Problem Set 7, Problem 4, initial definitions.