Periods and commas in mathematical writing I just realized that I am a barbarian when it comes to writing. But I am not entirely sure, so this might be the right place to ask. When typing display-mode formulae do you guys add a period after the formula ends a sentence? 
Like:

This is the formula for a circle $$x^2 + y^2 = r^2.$$
  Therefore blabla...

or 

This is the formula for a circle $$x^2 + y^2 = r^2$$
  Therefore blabla...

My supervisor has been complaining a lot that I don't use period and commas in my display-mode formulae. But I get uneasy doing that because it doesn't feel natural to me, I took a look at two books at random and both of them so far do the punctuation in their display formulae.. I know this is stupid of me and its amazing I have never noticed that.
Edit: This would be a fantastic opportunity to see what people actually like as opposed to what they think they like.  Everyone who has an opinion on what the punctuation should be should provide an illustrative example of such so that by the voting it can be seen what is actually preferred.  If you do this, make your answer just the example (so provide any general homilies in another answer) so that the voting truly reflects the community view of the example.
 A: N. David Mermin wrote an article, What's wrong with these equations, Physics Today, October 1989, p.9, reprinted in his book, Boojums all the Way Through, in which he gave three rules concerning displayed equations in papers. 
$\it Rule\ 3$ (Math is Prose Rule). The Math is Prose Rule simply says:
$$\it End\ A\ Displayed\ Equation\ with\ a\ Punctuation\ Mark . \tag{3} $$
Mermin goes on to discuss this at some length. 
If anyone is curious, Rule 1 is
$$\it Number\ All\ Displayed\ Equations , \tag{1} $$
and Rule 2 (the "Good Samaritan Rule") is
$$\it When\ Referring\ to\ an\ Equation\ Identify\ It\ by\ a\ Phrase\ as\ Well\ as\ a\ Number . \tag{2} $$
A: Whichever rule you follow, the journal you send it to will want the opposite.
A: On a technical side, if you want to avoid cluttering your display formulas with punctuation in the LaTeX code, but still be able to show it inside the formula, take a look at this brilliant answer by Alexey on stackoverflow.
You may even later disable the display of that punctuation if you think that it gets in the way (which is my point of view), look at the comments to the answer linked above.
For me this is the perfect solution: I can send a paper with punctuation for publishing, or compile it without punctuation for me, and I can always copy-paste the display formulas without having to remove that pesky punctuation.
A: Note: pedantic typophile here, so don't mind the details.
First, the logic.
When sections of text of different languages [domains] are mixed, they can occur side-by-side as equals, or one section could be embedded within another [which is the typical case].
Language identification is pretty straightforward in most scenarios, eg:

The grammar of this very sentence is English, even if we embed right-to-left inline Arabic text like أبجد هوز within it.

Within the text أبجد هوز there should be no English punctuation nonsense. Not unless you happen to be re-embedding English text within the Arabic text, eg:

We can embed  inline Arabic text which itself has embedded inline English text, eg قائلا أن Google Chrome is good هو الحق., within a main English text like how it's done in this very sentence.

Now consider instead of inline embedding, we do "block-level" embedding:

The grammar of this very sentence is English, even if we embed right-to-left "block-level" Arabic text like:هذا نص على مستوى الكتلة الطويلة باللغة العربية. هذا نص على مستوى الكتلة الطويلة باللغة العربية.
..within it.

The outer English sentence may even contain no furthur text after embedding the block-level Arabic text, eg:

This very sentence ends with a block-level Arabic text, after this embedded text:هذا نص على مستوى الكتلة الطويلة باللغة العربية. هذا نص على مستوى الكتلة الطويلة باللغة العربية.
And this very sentence is a new sentence after the embedded block-level Arabic text.

We can surmise that for English grammar, terminating punctuation marks are optional after block-level embeds (cf. 1) (cf. 2a) (cf. 2b) (cf. 3) (cf. 4) (cf. 5) (cf. 6) (cf. 7a) (cf. 7b) (cf. 8) (cf. 9) (cf. 10).
If an editor insists on having optional fullstops shown, eg:

Assume we have an editor who insists on having a fullstop after this block-level embed:هذا نص على مستوى الكتلة الطويلة باللغة العربية. هذا نص على مستوى الكتلة الطويلة باللغة العربية.
. Said fullstop can be produced as desired, as seen right before this very sentence.

..readers will find it jarring because it's atypical for stray English punctuations to appear as the first text of the line as they would normally be kerned with the preceding text.
Hence, to make it appear less jarring to readers, we should too kern the fullstop with the preceding text [the block-level Arabic text], as such:

This very sentence has its fullstop kerned with the text before the fullstop [the block-level Arabic text]: هذا نص على مستوى الكتلة الطويلة باللغة العربية.                                                               .
Look carefully at the previous sentence before this very sentence. It ends with a fullstop which is kerned with the block-level Arabic text embed before it.

Also see "Widows and orphans".

Now, on to Maths text.
The concept we outlined for foreign text within English text applies regardless of the interacting languages. For block-level maths text embedded within English text, the syntax thus looks like:



Just as with the Arabic text, there are distinct non-overlapping areas allocated to the text of each language. There's no logical sense if the grapheme(s) of the outer language [English text] appears within the area allocated to the embedded language [Maths text]:

In fact, it is so senseless that a quick reader can't easily tell if the grapheme refers to a punctuation of the outer text [English], or if the grapheme is actually part of the embedded text [Maths] itself.
So, applying the concepts mentioned, we can either have a stray fullstop after the block-level embed:

..or we can kern the punctuation with the block-level embed preceding it:

..or we can go without the fullstops altogether (My preferred solution.). With the context of the text, and the capitalization of the next English sentence right after the Maths text, ambiguity is almost non-existent:

Consider this text:
$$x^2 + y^2 = r^2$$
 Even if the reader does not see a fullstop after the Maths text, it's obvious that this very sentence is a full standalone sentence and the embedded Maths text is not part of this sentence. 

..and:

Consider this text:
$$x^2 + y^2 = r^2$$
..which is a basic equation. Since the English text after the Maths text begins with a two-dot ellipsis, it's obvious to the reader that the English text which continues after the Maths text belongs to the same sentence as the Maths text.

The end.

More on MathJax.
You can produce punctuation kerning in Stackexchange posts using a combination of vertical spacing [<br>] and horizontal spacing [&nbsp;].
It's possible to use pure-MathJax to achieve punctuation kerning on StackExchange posts. Sample code:
$$
\color{transparent}{
\quad\text{.}
}
\begin{align}x^2 + y^2 = r^2
&
\\
&\quad\text{.}
\end{align}
$$

..which outputs:
$$
\color{transparent}{
\quad\text{.}
}
\begin{align}x^2 + y^2 = r^2
&
\\
&\quad\text{.}
\end{align}
$$
..(And here's a screenshot:

..) but the font of the "fullstop" produced by MathJax is not the same as the font of the fullstop produced by normal English text.
Another issue is there is no control over pixel-perfect vertical-spacing as the vertical spacing using MathJax's align is a multiple of 24px [0px, 24px, 48px, etc].
A: This is something I've never paid attention to until graduate school, but virtually every book uses the convention that formulae in display mode are part of the text. Every Springer text for instance uses these conventions.
If we define the function $f:\mathbb{R}\rightarrow\mathbb{R}$ by
$$
f(x) = e^x,
$$
then we can place a comma after the definition to indicate a pause one might take if speaking such a sentence. We could also have defined the function by
$$
f(x) = \sin(x).
$$
As this last definition was the end of a sentence, it ought to have a period. Finally we could also have
$$
|f(x) - f(x_0)| < \varepsilon
$$
whenever $|x - x_0| < \delta$. Here, no punctuation was needed.
There are exceptions: Spanier's Algebraic Topology doesn't follow these conventions, but Hardy does, and all modern books that I've read do. Unless I pay attention, I don't even notice the punctuation.
A: My view on this seems to be contrary to most of the other opinions expressed here.  I think periods and commas in display mode are so ugly that they should never be used.  Display mode is something removed from text mode, in another dimension as it were, so vestiges of text mode like punctuation should never appear in display mode. 
Granted this aesthetic judgment, what should one do instead?  For a start, one can choose not to display things that don't really have to be displayed.  As I see it, there are only two reasons for displaying something:  Either it is too large and unwieldy to put in text mode, or it is a short formula that is so important that one wants to make it stand out on the page by displaying it.  The latter situation should only occur rarely, otherwise the author seems to be constantly shouting, like writing half of one's message in ALL CAPS.  Historically there may have been typographical reasons for displaying all math longer than a couple characters, but I don't think that's the case any more.  As an illustration of this principle of avoiding unnecessary displays, I think the equation for a circle in the original post is something that could easily be put in text mode within the paragraph rather than in display mode.  (Unless the equation for a circle was the main new result in your paper that you wanted to highlight, of course!)
So if one only displays things that really have to be displayed, the problem is somewhat ameliorated.  For the large displays that remain, one can argue that their sheer size alone provides enough of a separation for the reader that putting punctuation after them is unnecessary.  Certainly this is the case for commas in most situations.  For periods a solution that might placate the purists is the following:  If the sentence does not continue after the display, then warn the reader that this is happening by putting a colon right before the display.  This might involve a slight rephrasing to make a colon fit in gracefully.  In my own writing I have often ended a sentence with an unpunctuated display, with a clear conscience, but I may try using this colon rule more systematically in the future.
A: Mathematics is part of a text in the same way that poetry might be part of a literary essay.  When citing poetry, a set off (i.e., displayed as a quote) part of a verse almost universally keeps exactly the punctuation from the original and nothing more, with the exception of putting in ellipses to mark elided text within (i.e., not at the beginning or at the end) the excerpt.
Poetry is not exactly analogous to mathematics in this respect, since if punctuation was added, it would not be clear whether the additional punctuation were part of the original, and this is pretty crucial to the metre of the poem.  But I think the analogy does show that it does not follow from "A mathematical text is, before everything else, a text." that we should add punctuation to mathematics that is set off.
There's a reasonable issue of taste here that is not settled by dogma.  Publisher style nearly always trumps other considerations; if you have the luxury to choose, balance issues of consistency with your closer colleagues with practical issues of layout and your own sense of style.
A: Any  punctuation should aid the reader.
Don't get me started on the `Oxford comma'.
A: The problem is compounded by the following facts:


*

*There are different style sheets for different disciplines and even subdisciplines that use mathematics.  For example, do you put a punctuation mark that happens to follow a quoted item inside or outside the quotation marks?  Once upon a time, it was a universal rule, so far as I know, to put the punctuation inside, but computer folk began to depart from this convention due to the importance of exact quotation in formal languages and full-text searching.

*Different implementations of TeX and its kin, by design or oversight, force different choices with respect to: $\operatorname{Blah}, \operatorname{Blah},$ on the one hand, and $\operatorname{Blah}, \operatorname{Blah}$, on the other hand, at least, if you want to avoid the risk of having a punctuation badly split to the next line every now and then.
A: Plain text needs some punctuation. Otherwise it can easily appear confusing. But a displayed formula should be burnt into the brain of the reader as it is. Every additional punctuation is disturbing this aim. I think that the new paragraph starting below the formula is sufficient to mark an interruption if there is any.
A: Displayed formulas can serve two roles in a math paper: as abbreviations for text that would otherwise be unreadable, and as figures (or illustrations) that are referred to by the text but are not part of it grammatically.  My opinion is that in the former case they should be punctuated, but in the latter they should not.
Here are some examples.
1) If $x$ and $y$ are the coordinates of a point on a circle of radius $r$ then
$x^2 + y^2 = r^2$.
2) The coordinates of a point of a circle of radius $r$ satisfy the following equation.
$x^2 + y^2 = r^2$
3) The following diagram commutes.
(diagram without any punctuation)
I think these examples demonstrate the necessity of distinguishing the two roles a displayed equation can play.  As Simon already pointed out above, there is no reasonable place to put a punctuation mark in a commutative diagram, presumably because a commutative diagram can't be read aloud.  On the other hand, it's difficult to view the sentence in the first example as complete without a period at the end of the equation.
I suggest the following rule of thumb: if the formula can be removed from the text without breaking the flow of a sentence, then it does not need to punctuated.  Otherwise, it should be punctuated as it would be if the symbols were expanded into words.

Many authors use a colon where I used a period in the second example and follow the equation with a period.
2') The coordinates of a point on circle of radius $r$ satisfy the following equation:
$x^2 + y^2 = r^2$.
I don't consider this incorrect, but I do consider it a completely different sentence from 2).
A: The rule is: there is no rule.
Punctuation is intended to add clarity to a body of text.  If punctuation after a formula does so, put it in.  If it does not, leave it out.  My default is to put it in on the principle that the mathematics expressions are part of the text and therefore subject to its rules.  However, this can conflict with comprehension particularly where the punctuation can be mistaken for a part of the formula.
As a guideline, I would say that for short formulae, put it in (for example, in your example in your question) since the reader can read those quickly enough that they don't lose the thread of the text.  However, the average reader cannot parse larger formulae so quickly and so will effectively stop reading in order to understand the mathematics, then start reading again afterwards.  Thus the formula itself acts as a sort of punctuation mark and so does not need any further adornment.
Of course, there are always grey areas (even gray ones) and that's where you'll find the most vociferous eraser fights.  But the zeroth law (or, if you prefer, Rule 42) is: the one that makes it clearest is the right choice.
A: Yes, but I always use "\ ." or "\ ," to separate the punctuation from the formula.
A: Mathematics embeds in natural language inheriting the grammatical structure of its 'host'. So mathematical constructions (eg. sets) are nouns, relations (like $\le$, $\in$ and $=$) are verbs, properties are adjectives and quantifications like $\forall x$ are adverbial phrases. The usual rules of grammar of the host natural language, including punctuation rules, now extend naturally.
So, for example, the sentence after this one is a perfectly good self-contained sentence so it should end with a period. $(x+1)^2>x^2+2x$.
A: My meta-guide with respect to that is 

Tautology 2.3.1 — A mathematical text is, before everything else, a text.

from Michèle Audin's Conseils aux auteurs de textes mathématiques, which you can get from her webpage.
A corollary is that when one writes a mathematical text one is writing sentences, to which all rules which apply to sentences of course apply. And, say, sentences end in a period.
A: I disagree with the convention to punctuate formulas. What does it bring to the reader, besides confusion? (one time, I confused a comma and a prime, and I wasted a lot of time). 
The reader does not need punctuation after a formula anyway, because usually, he stops to understand it.
Math formulas already harbor a lot of indexes and signs, so adding punctuation does not help.
A: A math paper should follow all the usual rules of grammar, so in particular there should be subjects and verbs and the sort of punctuation you'd expect to find in a piece of nontechnical writing. I would prefer to write the following:
The formula for a circle is $$ x^2+y^2=r^2. $$
If I had to use the wording in the original question, I would write
This is the formula for a circle: $$ x^2+y^2=r^2. $$
Occasionally, the aesthetics of the page make punctuation look awkward. For example, one might write:
Therefore, the following diagram commutes:  

M×N -> M⊗RN
   \    |
    \   |
     \  | 
      v v
       A

with no punctuation after the diagram. There isn't any sensible location for a period at the end of a sentence, so I'd leave it out.
A: The reason for including the punctuation is that text with math in it is still text, and the math is usually (not always) a grammatically functioning part of the text. The reason for leaving it out is that it looks ugly because we're juxtaposing elements of two writing systems in which symbols have completely different meanings. Either possibility can be jarring to the reader.
A good way to deal with these problems is to leave some white space between the equation and the punctuation.

The Pythagorean theorem,
        $$ A^2+B^2=C^2 \qquad   , $$
  has been known since ancient times.

The comma doesn't cling to the equation like an alien parasite, so I find the effect less jarring as a reader. In LaTeX, I use a \qquad for this.
In my personal style, I also sometimes end a sentence with a displayed equation set off by a colon, without a period after the equation.

Thus from Euclid's five postulates we have arrived at our final result, known as the Pythagorean theorem:
       $$ A^2+B^2=C^2 $$

The colon acts like a signal on the tracks that tells the train conductor we're nearing the end of the sentence. The construction of the sentence reinforces the reader's subconscious expectation that the sentence will not continue after the equation. Grammatically, the equation does not function as any part of speech. The style is similar to what one would use in introducing a diagram that was in-line in the body of the text and had no caption or figure number. For example, in an article about knots, you might have many little drawings of knots sprinkled throughout the text. Other possibilities would be to put a period after the equation, or to replace the colon with a period. The disadvantage of replacing the colon with a period is that we lose the glue between the sentence and the equation it's referring to.
A: I follow the rules of English grammar, except when LaTeX makes it look weird.  For example, I think the period looks awful here:
$$\frac{\sum_{i=0}^n f(n)}{q} = \left[\frac{N_{r_i}}{M+\int g \,d\mu}\right]_H.$$
