I found the following excerpt on this web site: http://jeff560.tripod.com/d.html. It gives references to specific papers of both Lagrange and Gauss. The inverse square law for the electric force is usually associated with Coulomb, but was apparently first inferred by Priestley on the basis of Franklin's observation that there is no electric field inside a hollow conductor and analogy to the known analogous property for gravity.
The history of the theorem is bewildering with many re-discoveries.
O. D. Kellogg Foundations of Potential Theory (1929, p. 38) has the following note on the result “known as the Divergence Theorem, or as Gauss’ Theorem or Green’s Theorem”:
A similar reduction of triple integrals to double integrals was employed by Lagrange: Nouvelles recherches sur la nature et la propagation du son Miscellanea Taurinensis, t. II, 1760-61; Oeuvres t. I, p. 263. The double integrals are given in more definite form by Gauss Theoria attractionis corporum sphaeroidicorum ellipticorum homogeneorum methodo novo tractate, Commentationes societas scientiarum Gottingensis recentiores, Vol III, 1813, Werke Bd. V pp. 5-7. A systematic use of integral identities equivalent to the divergence theorem was made by George Green in his Essay on the Mathematical Theory of Electricity and Magnetism; Nottingham, 1828 [Green Papers, pp. 1-115].
Kline (pp. 789-90) writes that Mikhail Ostrogradski obtained the theorem when solving the partial differential equation of heat. He published the result in 1831 in Mem. Ac. Sci. St. Peters., 6, (1831) p. 39. J. C. Maxwell had made the same attribution in the 2nd edition of the Treatise on Electricity and Magnetism (1881). See also the Encyclopaedia of Mathematics entry Ostrogradski formula
For Gauss’s theorem Hermann Rothe “Systeme Geometrischen Analyse, Erster Teil” Encyklopädie der mathematischen Wissenschaften mit Einschluss ihrer Anwendungen Volume: 3, T.1, H.2 p. 1345 refers to Gauss’s Allgemeine Lehrsätze in Beziehung auf die im verkehrten Verhältnisse des Quadrats der Entfernung wirkenden Anziehungs- und Abstossung-Kräfte 1839 in Werke Bd. V (especially pp. 226-8.)
Brian Hayes wrote a column on the volume of the $n$-sphere for American Scientist a couple of years ago, available online here. It includes a bit of history, with bibliography, toward the end, which might be of help here.
Added 4/26/13: Here are a couple of pertinent passages from Brian's article:
"... Sommerville mentions the
Swiss mathematician Ludwig Schläfli
as a pioneer of n-dimensional geometry.
Schläfli’s treatise on the subject, written
in the early 1850s, was not published
in full until 1901, but an excerpt translated into English by Arthur Cayley appeared in 1858. The first paragraph of
that excerpt gives the volume formula
for an n-ball, commenting that it was
determined “long ago.” An asterisk
leads to a footnote citing papers published in 1839 and 1841 by the Belgian
mathematician Eugène Catalan."
and
"Not one of these early works pauses to comment on the implications of
the formula—the peak at n=5 or the
trend toward zero volume in high dimensions. Of the works mentioned by
Sommerville, the only one to make these
connections is a thesis by Paul Renno
Heyl, published by the University of
Pennsylvania in 1897."
Best Answer
I fished around in Google scholar and found so many examples that I don't feel like listing any of the links. Nonetheless, a clear picture emerges of an answer that I found a bit surprising: The notation $\mathbb{Z}_p$ for the $p$-adic integers evolved in three separate parts. I should also explain that the real science of etymology is about the evolution of words or notation, not just "when did it first happen".
The subscript notation not only for the $p$-adic integers, but more generally for $p$-adic completions, already appears in several papers in the 1930s and 1940s. For instance Carl Ludwig Siegel says in 1941, "$R$ is the field of rational numbers, $R_p$ the field of $p$-adic numbers, where $p$ denotes any prime number, $R_\infty$ the field of real numbers; moreover $J$ is the ring of integral numbers and $J_p$ the ring of $p$-adic integers". Of course, no one would use this notation today!
The use of $Z$ for the integers has a semi-separate history. I even found an old paper, but more recent than this one by Siegel, that used $Z$ for the integers but $R$ for the $p$-adic integers, with no subscript.
Generally the notation for $p$-adic integers and $p$-adic numbers standardized at $Z_p$ and $Q_p$ in the 1950s. Quite possibly Bourbaki, Algebra, deserves credit for standardizing $Z$ and $Q$ for integers and rationals.
Blackboard bold notation ($\mathbb{Z}$ and $\mathbb{Q}$) came last, at least in print. Despite its name, it's no longer obvious to me that blackboard bold actually first came from blackboards or from typewriters. It's sometimes also credited to Bourbaki, but this seems to be wrong. There is a historical account by Lee Rudolph (in comp.text.tex) that credits certain typewriter models in the 1960s for producing blackboard bold typography for the integers, etc. If that is where it started, then the notation seemed to catch on fairly quickly, although there were holdouts that used ordinary bold for decades after that. (But, before blackboard bold was fashionable, it wasn't even standard to make the set of integers bold $\mathbf{Z}$ instead of just $Z$.)
As an aside, the collision of notation between the $p$-adic integers and the integers mod $p$ is unfortunate. I really prefer to write $\mathbb{Z}/n$ for the integers mod $n$, because it is then written exactly as it reads. Also, partly since it is such a commonly used object, I see no need for extra parentheses, or an extra $\mathbb{Z}$, and certainly just using an $n$ subscript is bad. I'm optimistic that this notation is the way of the future and it would be an interesting separate question in history of notation.
(Sorry, I didn't see the entire string of comments before I wrote all of this. The comments make most of these remarks, but it seems useful to combine them into one historical summary.)