# Connections/motivations of “Sums of Two Squares” to/from other fields of math.

I am to teach section 18 of "Elementary Number Theory" (Dudley) - Sums of Two Squares - to an undergraduate Number Theory class, and am having trouble cultivating anything other than a rote dissection of the lemmas/theorems presented in the text.

The professor copies (exclusively) from the text onto the chalkboard during lectures, but I would like to present the students with something a little more interesting and that they cannot find in their text.

What are the connections of the "Sums of Two Squares" to other fields of mathematics? Why would anyone care about solving $n = x^2 + y^2$ in the integers?

I am aware of the norm of the Gaussian integers, and will probably mention something about how the identity $$(a^2 + b^2)(c^2 + d^2) = (ac -bd)^2 + (ad + bc)^2$$ is deeper than just the verification process of multiplying it out (e.g. I might introduce $\mathbb{Z}[i]$ and mention that "the norm is multiplicative").

What else is there? The book mentions (but only in passing) sums of three and four squares, Waring's Problem, and Goldbach's Conjecture.

Also, I have seen Akhil's answer and the Fermat Christmas question, but these don't admit answers to my question.

-
The solutions to $x^2+y^2=n$ describe all the points in $Z^2$ which belong to the same center with the center in $(0,0)$. You can also use them to find the intersection between $Z^2$ and a circle with the centre at some lattice point.... –  N. S. Mar 27 '12 at 16:22
@N.S. - I'd vote on that as an answer. –  The Chaz 2.0 Mar 27 '12 at 16:24
A theorem says every nonnegative integer is the sum of four squares of nonnegative integers. It is also true that every nonnegative integer is the sum of three triangular numbers, of five pentagonal numbers, of six hexagonal numbers, etc. Maybe that has no relevance to other areas of mathematics, but if you're wondering why you would care about sums of squares, maybe the fact that it's part of this larger pattern matters. –  Michael Hardy Mar 27 '12 at 16:24
It sounds from your question like the main problem here is the professor copying directly from the text onto the chalkboard. What a waste of student's time. Does the instructor explain to colleagues why his/her latest research is interesting by reading directly from the paper? Zzzzzz.... –  KCd Mar 28 '12 at 1:37
Asking which integers are sums of two squares is a quintessential theme from number theory. Do the students already find the course interesting at all?? Look at the number of solutions x,y for each n and see how erratically that count behaves as n increases step by step. Some regularity appears if we think about it at primes first. This illustrates the difference between the linear ordering way of thinking about integers in many other areas of math vs. the divisibility relation among integers that is central to number theory. –  KCd Mar 28 '12 at 1:44

Consider the Laplacian $\Delta = \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}$ acting on nice functions $f : \mathbb{R}^2 \to \mathbb{C}$ which are doubly periodic in the sense that $f(x, y) = f(x+1, y) = f(x, y+1)$. There is a nice set of eigenvectors one can write down given by $$f_{a,b}(x, y) = e^{2 \pi i (ax + by)}, a, b \in \mathbb{Z}$$

with eigenvalues $-4 \pi^2 (a^2 + b^2)$, and these turn out to be all eigenvectors, so it is possible to expand a suitable class of such functions in terms of linear combinations of the above.

Eigenvectors of the Laplacian are important because they can be used to construct solutions to the wave equation, the heat equation, and the Schrödinger equation. I'll restrict myself to talking about the wave equation: in that context, eigenvectors of the Laplacian give standing waves, and the corresponding eigenvalue tells you what the frequency of the standing wave is. So eigenvalues of the Laplacian on a space tell you about the "acoustics" of a space (here the torus $\mathbb{R}^2/\mathbb{Z}^2$). For more details, see the Wikipedia article on hearing the shape of a drum. A more general keyword here is spectral geometry.

-
By considering different periodicity conditions you can also motivate studying solutions to $n = ax^2 + bxy + cy^2$ for more general $a, b, c$, and working in higher dimensions you can motivate studying more general positive-definite quadratic forms. There is an interesting general question you can ask here about whether you can "hear the shape of a torus" (the answer turns out to be yes in two dimensions if you interpret "shape" suitably and no in general). –  Qiaochu Yuan Mar 27 '12 at 16:35
Of course you don't need me to tell you this, but this is a perfect example of what I am looking for. –  The Chaz 2.0 Mar 27 '12 at 16:36
@The Chaz: if you liked this then you might want to pick up a copy of Schroeder's Number theory in science and communication and look in particular at section 7.10. –  Qiaochu Yuan Mar 27 '12 at 16:39
Thanks again for this answer. I left it "un-accepted" for a while to encourage more answers. –  The Chaz 2.0 May 1 '12 at 2:49

At a much more elementary level, one might want to draw connections to what they already know.

For example, there is a very nice connection between the identity $(a^2 + b^2)(c^2 + d^2) = (ac -bd)^2 + (ad + bc)^2$ and the addition laws for cosine and sine.

As another example, suppose that $a$ and $b$ are positive, and we want to maximize $ax+by$ subject to $x^2+y^2=r^2$. Using $(a^2+b^2)(x^2+y^2)=(ax+by)^2+(ay-bx)^2$, we can see that the maximum of $ax+by$ is reached when $ay-bx=0$.

Then there is the generalization (Brahmagupta identity). Connection with Fibonacci numbers. Everything is connected to everything else!

-
Could you point me in the direction of the trig identities you had in mind? Also, is there a sign error? I might just be projecting my tendency to make such errors (cf revisions of this question!) –  The Chaz 2.0 Mar 27 '12 at 18:28
I was just thinking of $a=\cos x$, $b=\sin x$, $c=\cos y$, $d=\sin y$. That gives the right signs. For the max problem, I probably switched signs, doesn't matter, one can switch signs without changing correctness of identity. –  André Nicolas Mar 27 '12 at 19:08
Got it. Maybe the changed signs only matter in the context of the norm in $\mathbb{Z} [i]$... –  The Chaz 2.0 Mar 28 '12 at 1:56

In another direction, counting the solutions $n=ax^2+bxy+cx^2$, to quadratic forms with negative discriminant is often the starting place for a course on Algebraic Number Theory. I believe Gauss was one of the first people to think about this area. This leads to the definition of Class Number, and we can prove things like Dirichlet's Class Number Formula.

Solutions to $x^2+y^2$ is one of the simplest examples to start with.

-