Published in



Binary Quadratic Forms and Primes of the Form x² + ny²

Equivalent Forms and the Discriminant

By some algebraic manipulations(completing the square), a bqf can be rewritten as follows:
4a(ax² + bxy + cy²) = (2ax +by)² - (b² - 4ac)y².

f(x, y) 🠆 g(x, y):
ax² + bxy + cy² 🠆 a(Ax +By)² + b(Ax +By)(Cx +Dy) + c(Cx +Dy)².
Expand and simplify the expression on the right of the arrow to get:g(x, y)=(aA² + bAC + cC²)x² + (2aAB + bAD + 2cCD + bBC)xy + (aB² + bBD + CD²).Let the discriminants of f(x, y) and g(x, y) be D(f) and D(g) respectively, then D(f) = b² - 4ac. Likewise, D(g) can be calculated from the expression for g(x, y) above, but it's a bit complicated.If you are able to work out the expression for D(g), you will find there is a relationship between D(f) and D(g) as follows:D(g) = (AD - BC)²D(f).For f(x, y) and g(x, y) to be equivalent, their discriminants have to be equal, i.e., D(g) = D(f). That means we have to set
(AD - BC)² = 1. This implies (AD - BC) = 1 or (AD - BC) = -1.

Reduced Forms

Having the same discriminant is a neccessary but not sufficient condition for two forms to be equivalent, for example x² + 5y² and 2x² + 2xy + 3y² have the same discriminant but they are not equivalent because x² + 5y² represents 1 when x = 1, y = 0, but 2x² + 2xy + 3y² can never be equal to 1 for whatever values of x and y.

Representing Numbers

Through a series of propositions we will see how the theory of binary quadratic forms we’ve developed so far helps with the question of representing numbers, especially prime numbers. First, we will revise some relevant basic concepts.


  1. Can you write the general expression for:
    i) a ternary(3 variables) quadratic form.
    ii) a binary cubic(degree 3) form?
  2. Can you tell if the equation 2x² - 6xy + 5y² = 43 has a solution in integers or not. Give reason for your answer.
  3. Can you write an algorithm that takes as an input a number(should be a multiple of 4 or a multiple of 4 plus 1) and outputs random bqf’s with the input as determinant.

Further Study

Cox, David A. Primes of the Form x² + ny²: Fermat, Class Field Theory, and Complex Multiplication. John Wiley and Sons, Inc., Hoboken, NJ, Second edition, 2013.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akintunde Ayodele

Programmer. Mathematician. Thinker. Entrepreneur, among other things. Give me a place to sit and I will move the world.