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.
 A: 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. 
A: 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! 
A: 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.
A: One of my favorite math videos of all time (3Blue1Brown "Pi hiding in prime regularities") https://www.youtube.com/watch?v=NaL_Cb42WyY studies the question of how many lattice points are on a certain circle in the plane (a problem about counting how many times a number is a sum of 2 squares), and transforms that into a factorization problem in $\mathbb Z[i]$. Due to regularity of how primes factor in $\mathbb Z[i]$, we ultimately get a formula for $\pi$ in terms of the Dirichlet $L$-function for the non-primitive quadratic character $\chi_4$ of conductor $4$.
This (and generalizations of this problem to other quadratic number rings $\mathbb Z[r]$) connects arithmetic in $\mathbb Z[r]$, lattice points on circles/ellipses, lattice regions approximating disks/ellipses, infinite sum formulas for $\pi$, the Dirichlet class number formula, the non-vanishing of $L(1,\chi)$ (the $L$-functions at $s=1$), which lead to things like Dirichlet's theorem of primes in arithmetic progressions, and the generalized Riemann hypothesis.
This material is explored in https://terrytao.wordpress.com/2014/11/23/254a-notes-1-elementary-multiplicative-number-theory/, https://terrytao.wordpress.com/2014/11/28/245a-supplement-1-a-little-bit-of-algebraic-number-theory-optional/.
