Section 15.4 Points on Quadratic Curves
ΒΆ
Subsection 15.4.1 Transforming conic sections
ΒΆAlthough it's being removed from the curriculum nowadays, students in high school mathematics or first-year college calculus often learn how to use matrices to transform one conic section to another of the same type.Example 15.4.2.
We can get from the circle x2+y2=9 to the ellipse x2+2y2=9 by multiplying the vector (x,y) by the matrix (1001/β2); that would not stretch the x-axis, but shrinks the y axis by the appropriate amount.
(xy)(1001)(xy)=x2+y2
(xy)(1002)(xy)=x2+2y2.
Fermat's question essentially asked what integers n can be represented as the first one; Gauss was interested in extending this to ask numbers are representable in by a more general expression of the form ax2+2bxy+cy2. This generalizes the sum of squares where a=1=c,b=0, and is achieved by using the matrix (abbd) instead. It turns out that many such expressions represent precisely the same sets of integers (recall Section 14.3).
The Sage reference manual uses our example to demonstrate. Consider two seemingly unrelated expressions:
(xy)(1002)(xy)=x2+2y2 and (xy)(1113)(xy)=x2+2xy+3y2
By the theory of quadratic forms, Fermat's result (recall the discussion around Fact 14.3.1) that a prime number congruent to 1 or 3 modulo 8 can be written as a sum of a square and twice a square should apply to the second expression as well.
As an example, both should represent the number 11. Clearly 11=32+2β
12 works for the first one, but what about x2+2xy+3y2? One can try this out in the interact below.
xxxxxxxxxx
var('x,y')
layout=[['a','b'],['c','d'],['output']]) (
def _(a=1,b=1,c=1,d=3,output=11):
viewsize=ceil(math.sqrt(output)+1)
g(x,y)=a*x^2+(b+c)*x*y+d*y^2
plot1 = implicit_plot(g-output, (x,-viewsize,viewsize), (y,-viewsize,viewsize), plot_points = 200)
grid_pts = [[i,j] for i in [-viewsize..viewsize] for j in [-viewsize..viewsize]]
plot_grid_pts = points(grid_pts,rgbcolor=(0,0,0),pointsize=2)
lattice_pts = [coords for coords in grid_pts if (a*coords[0]^2 + (b+c)*coords[0]*coords[1] + d*coords[1]^2 == output)]
plot_lattice_pts = points(lattice_pts, rgbcolor = (0,0,1),pointsize=20)
show(plot1+plot_grid_pts+plot_lattice_pts, figsize = [5,5], xmin = -viewsize, xmax = viewsize, ymin = -viewsize, ymax = viewsize, aspect_ratio=1)
pretty_print(html("Integer lattice points on $%sx^2+%sxy+%sy^2=%s$"%(a,b+c,d,output)))
x2+2xy+3y2=(x+y)2+2y2.
In general there is some very deep theory involved in deciding which integers can be represented by various forms, which is another place where lie the beginnings of algebraic number theory, just like with the Gaussian integers. But we'll let it rest there.Subsection 15.4.2 More conic sections
ΒΆLet's trace back to looking for integer points on a given curve. Assuming that ellipses are doable by simply counting, what is next? The parabola comes to mind. A straightforward parabola could look like ny=mx2; this can be thought of more directly as y=ax2, with a=m/n in lowest terms. Then I can just check all xβZ such that nβ£mx2. Since gcd (again, lowest terms), we would just need to check that n\mid x^2 (so if n is prime, n\mid x suffices).Example 15.4.3.
If y=mx^2 for integer m\text{,} any x will do. That makes sense; integer input had better give integer output, which would be a lattice point!
Example 15.4.4.
If 2y=x^2\text{,} we just look at it as requiring 2\mid x\text{.} Then any even x will yield a lattice point, and odd x will not.

xxxxxxxxxx
def _(m=1,n=2):
viewsize=3*n
f(x)=(m/n)*x^2
plot1 = plot(f,-viewsize,viewsize)
grid_pts = [[i,j] for i in [-viewsize..viewsize] for j in [0..viewsize^2*(m/n)]]
plot_grid_pts = points(grid_pts,rgbcolor=(0,0,0),pointsize=2)
lattice_pts = [coords for coords in grid_pts if (m*coords[0]^2==n*coords[1])]
plot_lattice_pts = points(lattice_pts, rgbcolor = (0,0,1),pointsize=20)
show(plot1+plot_grid_pts+plot_lattice_pts, figsize = [5,5], xmin = -viewsize, xmax = viewsize, ymin = -1, ymax = (m/n)*viewsize^2)
