TITLE: What motiveted Gauss to formulate his theorem on quadratic reprocity?
QUESTION [6 upvotes]: Im trying to connect his work on quadratic reciprocity with some simple question, like solution to certain diophantine equation or representing primes. Any ideas? I find it hard to imagine that he out of the blue just wanted to characterize the primes for which certain equations were solvable. I did read something about him wanting to write primes as sums of squares just like Fermat had done  in $p=x^{2}+y^{2}$ for instance. But having $ax^{2}+bx+c=pk$ dont look like an attempt to achieve this, he doesn't seam to try getting $k=1$ either

REPLY [3 votes]: See Chapter 1 of Cox. Primes of the form $x^2+ny^2$ and Chapter 1 of Lemmermeyer. Reciprocity Laws: From Euler to Eisenstein for some info and further references.