 This lecture is part of Berkeley Math 115, an introductory undergraduate course on number theory, and we'll be about the question of which primes can be represented by various quadratic forms of the form ax squared plus bxy plus cy squared. For example, we might ask which forms are sums of two squares, or which forms can be written as a square plus two times another square, or maybe a square plus three times another square. So before doing this, let's recall some previous results we had. First of all, number n is primitively represented by sum form ax squared plus bxy plus cy squared with discriminant d, with discriminant d. It's equivalent to saying that d is a square mod four n. So primitive means x and y are co-prime, of course. And we also saw that any form is equivalent to a reduced form which satisfies b as absolute value less than or equal to a is less than or equal to c. And here we're going to take all forms, be positive definite. So the negative definite case is much the same as the positive definite case because you just change sign. The indefinite case is somewhat more complicated and we'll be discussing it a little bit more in a later lecture. And now the idea is as follows, suppose that there's a unique reduced form for some discriminant d, then a number n is represented by that reduced form if and only if this condition is satisfied because if this condition is satisfied, n is represented by some form, but any form is equivalent to a reduced one which represents the same numbers. So now what we're going to do is to go through the various possible discriminants. Well, the discriminant has to be zero or one mod four and since the form is positive definite, it must be negative. So let's look at the negative numbers that are three, one or zero, mod four. So we get these numbers here, that should be 12, that's minus 15. And this lecture we're going to look at the first six of these and see what the corresponding reduced forms are. So after minus 12 things start getting a bit more complicated as we will see later. So let's do the easy cases first. First let's try discriminant minus three. Let's find all reduced forms of the form ax squared plus bxy plus cy squared with d equals b squared minus four ac is minus three. You remember reduced means that b is less than equal to a, it's less than equal to c and it has the consequence that three a squared is less than equal to d as we saw earlier. Well, this is now minus three and if three a squared is less than equal to d we can't have a equals zero. So we get a equals plus one. It can't be minus one because we're just working with positive definite forms. And now if we look at this, we see b squared must be odd. So b must be odd and b is absolute value at most one. So we find b equals plus or minus one. So this gives us two possibilities, x squared plus xy plus y squared or x squared minus xy plus y squared. But we can really change one to the other just by swapping x with say minus y. So these forms are equivalent. People sometimes add a little extra condition to the condition of being reduced where you sometimes say that if b equals a or a equals c then b is greater than or equal to zero. And if you add this condition to the form being reduced then this already eliminates that form so you don't have to waste time showing their equivalent. But the problem is this condition is a little bit fussy and difficult to remember. So anyway, so what we, so we've seen that any positive definite form with d equals minus three is equivalent to x squared plus xy plus y squared. So n is represented by x squared plus xy plus y squared primitively if and only if d equals minus three is a square mod n because if this condition holds then n is represented by some form of discriminant minus three and they're all equivalent so they all represent the same numbers. So let's look at this in a bit more detail. Let's take n to be a prime because this makes it a little bit easier to figure out which primes that work. Then we see that p is of the form x squared plus xy plus y squared if and only if minus three is a square modulo r prime p. And we worked out earlier when minus three is a square modulo r prime using the quadratic reciprocity law and we saw this as equivalent to saying p is congruent to zero or one odd three. So this tells us which primes can be written in this form. For instance, let's take a look at a few examples if p is three or seven or 13 we get this is equal to one squared plus one times one plus one squared. This is equal to two squared plus two times one plus one squared. This is three squared plus three times one plus one squared. I suppose I ought to do one where y isn't one. If we have 19, this is equal to three squared plus three times two plus two squared and so on. In fact, we can do a bit better than this because if p is equal to x squared plus xy plus y squared, well, suppose x is even. Then we can write p is equal to four x over two squared plus two x over two y plus y squared which is equal to three x over two squared plus x over two plus y all squared. So p can be written in the form three x squared plus y squared. Well, what if x isn't even? So y even, we can do the same obviously except we change x and y. If x and y are both odd, then we notice that this form x squared plus xy plus y squared can be written as x plus y squared plus x plus y times minus y plus minus y all squared. And now we've again written it in this form but now x plus y is even. So no matter what x and y are, if p can be written in this form, then it can be written in the form x squared plus three y squared. So we have the following theorem. So p prime is of the form x squared plus three y squared if and only if p is common to zero or one odd three. And again, we can just check a few cases. Three is equal to three times one squared. Seven is equal to three times one squared plus two squared. 13 is equal to three times two squared plus one squared. 19 is equal to what's 19 equal to? It's basically four squared plus three times one squared and so on. So that's done the case D equals three. It's told us exactly which primes can be written as a square plus three times another square. So now let's look at discriminant minus four. So we want to find reduced forms of discriminant minus four so we have ax squared plus bxy plus cy squared and we have d equals b squared minus four ac equals minus four. It's reduced so b is less than a is less than c and we remember this implies that three a squared is less than d which is equal to four. And as before, this implies that a is equal to plus what because the form is positive definite. And now this condition here implies b is even and if b is even and has absolute value less than a this implies that b must be zero and this determines c. So the only form is x squared plus y squared. So this is the only reduced form of discriminant minus four that's positive definite. Notice there's another, there's actually another reduced form of discriminant minus four which is minus x squared minus y squared but that's not positive definite. So n is represented by, I shouldn't say n greater than or equal to naught is represented by x squared plus y squared with xy co-prime if and only if minus four is a square mod four n. So we had this condition that says n is represented by some form of discriminant d if and only if this condition is satisfied. If n is negative, we obviously have to use the form minus x squared minus y squared. But if n is positive, then the only one that can represent it is this one. Anyway, now let's take n to be prime just to make because then we can work out what this condition is. Well, this says minus four is a square mod p or four p but it's obviously a square modulo four and we worked out when minus one is a square modulo p this is just equivalent to p being congruent to one or two mod four. So we've now managed to get this theorem due to Fermat which says that p prime is of the form of x squared plus y squared if and only if p is congruent to one or two mod four. And again, we can check two is equal to one squared plus one squared, five is equal to two squared plus one squared, 17 is equal to four squared plus one squared, 29 is equal to five squared plus two squared and so on. So notice by the way that if n is one mod four this does not imply that n is a sum of two squares. So we can have 21 cannot be written as x squared plus y squared. So this really does require p to be a prime. Now let's look at d is congruent minus seven. So as before we've got the form a x squared plus b x y plus c y squared and we want b squared minus four a c equals minus seven. We have b less than or equal to a less than or equal to c and we have three a squared less than or equal to the absolute value of d which is minus seven. And as before this condition here implies a equals one and now this condition implies b is odd and b is absolute value at most a. So b is equal to plus or minus one. So we get two forms x squared plus x y plus two y squared. We get x squared minus x y plus two y squared. And as before we can get from one to the other just by changing x to minus x or by saying b must be positive. So we can cross this one out. It doesn't give us anything new. So any form with d equals minus seven that's positive definite is equivalent to this. And of course there's another one of discriminant minus seven where we just change all the signs. So if n is greater than or equal to zero then n is equal to x squared plus x y plus two y squared with x y co prime if and only if minus seven is a square mod four n. So just as with minus three let's try and figure out when this happens. So when is minus seven a square mod four n? Well let's take n to be a prime. So we want minus seven is a square mod p. So it'd be a square mod alone odd prime. So this is equivalent to saying minus seven p is equal to plus one or zero I guess for the case p for seven which is kind of trivial. And by quadratic reciprocity this is the same as saying p seven is equal to plus one which is equivalent to p being one, two or four mod seven. So the primes of the form x squared plus x y plus two y squared are exactly those of the form p congruent to zero, one, two or four mod seven. And we can check a few cases. For example, seven is equal to one squared plus one times minus two plus minus two squared. It's a bit hard to spot this because they need to take that number to be negative. And similarly 11 is equal to one squared so 11 is equal to, let me see if we take y equals four eight. Yeah, we can take one squared plus one times two plus two times two squared. So there should be a factor of two in there. And the next ones are 23 and 29. And I'll leave this as an exercise because it's very confusing doing this in your head. Well, the form x squared plus x y plus two y squared looks a little bit messy but we can actually make it a little bit better. You notice that if p is equal to x squared plus x y plus two y squared with p odd, then this implies y must be even because if y is odd, this bit is even and this bit is even so p would have to be two. So we can now write this as x plus y over two squared plus seven y over two squared. So if p is not equal to two, then actually p can be written as a sum of a square plus seven times another square. So the primes that are seven plus seven times another square are the ones with p congruent to zero, one, two, four, seven, except for p being two, which doesn't quite work. So for instance, we can write seven is equal to zero squared plus seven times one squared. The next one was 11 is equal to two squared plus seven times one squared. 23 is equal to four squared plus seven times one squared and so on. So we've dealt with the forms x squared plus y squared x squared plus three y squared x squared plus seven y squared. The next one is x squared plus two y squared where we take D equals minus eight. So let's try and find the reduced forms. We have a x squared plus b x y plus c y squared and D is equal to b squared minus four a c is now minus eight. And as before, we see that three a squared is less than or equal to minus d and plus d. And this is eight. So again, this implies a is equal to plus one if the form is positive definite. Obviously, things are gonna get a bit more complicated when the discriminant d gets larger because we will no longer be able to assume that a is equal to one. And as before, this gives b to be even and b must be less than or equal to a in absolute value. So b is equal to zero and the only positive definite form with D equals minus eight is x squared plus two y squared. So we've now got the form x squared plus two y squared. And n is of the form x squared plus two y squared if and only if minus eight is a square mod four n. That's for x, y equals one, of course. And if n is equal to p a prime, what we want is that minus eight is a square mod p. And we saw when this works earlier, this is just saying that minus two p is equal to plus one. And we found this is equivalent to p congruent to one or three mod eight. So the primes of the form x squared plus two y squared are exactly those of the form one or three mod eight. And we can write out a few examples. Three is equal to one squared plus two times one squared. The next one is 11, which is equal to, let me see, I think you'd have to take x equals three. So three squared plus two times one squared. The next one is going to be 17, which should be some square plus two times another square. And we can see that's actually equal to three squared plus two times two squared and so on. So now let's go on to D equals minus 11. And again, if we look at the reduced forms, we have, as before, we have three a squared is less than or equal to the absolute value of D. And this still involves a being less than or equal to one. So we can take a equals plus one. And as before, b squared minus four ac is equal to minus 11. So b is odd. So b is equal to plus or minus one. And we get two forms, x squared plus xy plus three y squared, x squared minus xy plus three y squared. And as before, we can eliminate this one just by changing x to minus x or something like that. So any positive definite form, with D equals minus 11 is equivalent to this one. So as before, we find p prime being is of the form x squared plus xy plus three y squared is equivalent to minus 11 being a square modulo four p. And by using quadratic reciprocity, this says minus 11 p is equal to plus one, which by quadratic reciprocity turns out to be the same as p being a quadratic residue of 11 or zero, which means that p has to be congruent to zero, one, four, nine, 16, which is five or 25, which is three modulo 11. So these are the primes that can be represented as x squared plus xy plus three y squared. And you can write out a few examples as you want. Now, in the case p equals seven, we could convert the form x squared plus xy plus two y squared to x squared plus seven y squared by assuming that y must be even. That doesn't quite work here because y doesn't have to be even. I mean, the problem is this coefficient here is now odd rather than even. So it's not so easy to discuss forms of the form x squared plus 11 y squared. Now let's finish off by doing D equals 12 when we get an extra complication. So D equals minus 12. So we're looking at A x squared plus B xy plus C y squared with B squared minus four AC equals minus 12 and it's reduced. So B is at most A, which is at most C. And as usual, we get three A squared is less than or equal to the absolute value of D. And now we have a bit of a problem because this now implies A is equal to one or two because this is now 12. So we're finally getting something a little bit more interesting than A always being one. So let's first of all look at A equals one. Well, here we notice that B is even. So if A is one, B must be equal to zero and C must be equal to three. So we get the form x squared plus three y squared. But we've got another one. We can have A is equal to two. And we can now take B has to be even and so we get B is equal to minus two zero or two. And if we look at these three cases, we get two x squared minus two xy plus two y squared from B equals minus two. Here we get two x squared and then we want four AC is equal to minus 12. So this case doesn't work. And then we get two x squared plus two xy plus two y squared. And as before, we can change x to minus x. So we can forget about this one. So we see we actually get two non-equivalent forms. So any positive definite form with D equals minus 12 is equivalent to one of these. And we notice that these two forms are not equivalent. In fact, we mentioned this in an earlier lecture because this one is always even for no matter what x and y are. And this one is sometimes odd. So if we've got a number, all we can do is to say it's represented by, so n is represented by at least one of x squared plus three y squared, two x squared plus two xy plus two y squared, if and only if, so it's represented primitively. So x, y must be co-prime. If and only if minus 12, which is equal to D, is a square modulo four n. Well, so how do we separate out these two cases? Well, we notice that this one is always even. So if n is odd and minus 12 is a square mod four n, this implies that n is of the form x squared plus three y squared. So in particular, the primes of the form x squared plus three y squared are exactly the ones such that minus 12 is a square modulo four n. And we actually did this earlier for discriminant minus three. So if n is prime, this is equivalent to p being congruent to zero or one modulo three. Well, so almost all the forms we've done so far, except for the form 12, had the property that there was only one equivalence class of forms and for 12 there are two equivalence class of forms that one of them is irrelevant for odd numbers because it always takes even numbers. When we go beyond discriminant minus 12, things get even more complicated because we start getting several different equivalence classes of forms and it begins to get more and more complicated to tell which numbers they represent. So we'll be doing some examples of this in the next lecture.