Iterated Limits Schizophrenia Consider the functions $g_n(x)$, with $n\in\mathbb{N}$, $n \ge 1$ and
$x\in\mathbb{R}$, defined as follows:
$$
   g_n(x) = \begin{cases}
            2n^2x & \text{if }0 \le x < 1/(2n) \\
            2n - 2 n^2 x & \text{if } 1/(2n) \le x < 1/n \\
            0 & \text{everywhere else} \end{cases}
$$
Standard mathematics argument:
These functions are triangular, and they all disappear outside of
$[0,1]$, so I can compute $\int_0^1 g_n(x) \, dx = 1$ for every $n$.
For every $x$, $\lim_{n \rightarrow \infty} g_n(x) = 0$.So the limit and the integration can't be interchanged.
Here is an animated picture of the functions:

The function $g_n(x)$ becomes a sharp peak at $x=0$ for $n \rightarrow \infty$
and, geometrically, it certainly does not disappear or becomes zero. Instead, it seems
that we get, in the end, what physicists know as a delta function. Informally:
$$
   \delta(x) = \begin{cases}
            0 & \text{for } x \ne 0 \\
            \infty & \text{for } x = 0
               \end{cases} \qquad ; \qquad
   \int_{-\infty}^{+\infty} \delta(x) \, dx = 1
$$
Whatever definition might be the "rigorous" one, a 
delta function,
roughly speaking, is just a very large peak near $x = 0$ with area normed to $1$.
Furthermore, it is typical that the following 
function, triangular
as well, is indeed supposed to converge to the delta function - instead of becoming zero -
for $n \rightarrow \infty$ and nobody has any doubt about it.
$$
   D_n(x) = \begin{cases}
            n^2x + n & \text{if } -1/n \le x \le 0 \\
            n - n^2x & \text{if } 0 \le x \le +1/n \\
            0 & \text{everywhere else} \end{cases}
$$
The only thing that distinguishes $g_n(x)$ from $D_n(x)$ is that the maximum of
the former is shifted an infinitesimal distance $\lim_{n \rightarrow \infty}
1/(2n)$ with respect to the maximum of the latter at $x=0$.So it's easy to
see that these functions become one and the same for $n \rightarrow \infty$:
$$
  \lim_{n \rightarrow \infty} g_n(x) =
  \lim_{n \rightarrow \infty} D_n(x) = \delta(x)
$$
Therefore, in the end, we have two arguments that, unfortunately, also
lead to different outcomes for the iterated limit.

According to standard mathematics, the iterated limits do not commute:
    $$\int_0^1 \left[ \lim_{n \rightarrow \infty} g_n(x) \right] \, dx = 0
\qquad \text{and} \qquad
\lim_{n \rightarrow \infty} \left[ \int_0^1 g_n(x) \, dx \right] = 1 $$

According to this physicist, the 
iterated limits do commute:
    $$\int_0^1 \left[ \lim_{n \rightarrow \infty} g_n(x)  \right] \, dx = 1
\qquad \text{and} \qquad
\lim_{n \rightarrow \infty} \left[ \int_0^1 g_n(x) \, dx  \right] = 1 $$


And the question is, of course the following.
Is it possible to escape from this apparent paradox? How then?
 A: That depends on what you mean by $\lim_{n\to \infty} g_n(x)$. The pointwise limit is zero, so the integral is zero. And if you put the parentheses so: $\lim_{n\to \infty} (g_n(x))$ then we have to conclude that the limit is zero and
$$\int_0^1 \lim_{n\to \infty} (g_n(x))\,dx=\int_0^1 0\,dx=0$$
However, you can also read this as $\lim_{n\to \infty} (g_n\, dx)$ where $dx$ denotes the usual Lebesgue measure. This is a limit of measures and it does, in fact, converge to the point measure at $0$, so that 
$$\int_{[0,1]} \lim_{n\to \infty} (g_n\, dx)=\int_{[0,1]}d\delta_0=1$$
(I've changed the notation because $\int_0^1$ can be confusing in this case, as $\int_{(0,1)}d\delta_0=0$).
So the "paradox" actually comes from different kinds of limits, and the arising confusion comes from not explaining the kind of convergence that is used in each case.
A: The equality $\lim_{n\to\infty}g_n(x)=\delta(x)$ is incorrect. In fact, $\lim_{n\to\infty}g_n(x)=0$ for all $x$ (including $x=0$). For $D_n$, 
$$
\lim_{n\to\infty}D_n(x)=\begin{cases}0,&\ x\ne0,\\ \infty,&\ x=0\end{cases}
$$
So, saying that the two limits are equal makes no sense. 
The physicists can "get away with it" because they formally treat $\delta$ as a function, although it is not. This is well-understood by mathematicians. One uses the functions $g_n$, $D_n$ to define linear functionals over the space of continuous functions. Given a continuous function $f$, one defines
$$
\varphi_n:f\mapsto\int_0^1f(t)g_n(t)dt.
$$
One can check that $\lim_{n\to\infty}\varphi_n(f)=f(0)$. So the functionals $\varphi_n$ converge pointwise to the functional $\delta:f\mapsto f(0)$. Physicists love an intuitive vision of things, so they claim that this new functional should also be integration against a function, that they call $\delta(x)$, the Dirac function. So, for them, 
$$\tag{1}
\delta(f)=\int_0^1f(t)\delta(t)dt.
$$
This last equality makes no sense mathematically. What happens is that one wants to think of $\delta(t)dt$ as a measure, and integrate $f$ against it. And this can be done:
$$\tag{2}
\delta(f)=\int_{[0,1]}f(t)d\delta(t),
$$
where now one considers the measure $\delta$ given by 
$$
\delta(S)=\begin{cases}1,&\ 0\in S,\\ 0,&\ 0\not\in S\end{cases}
$$
What happens then is that physicists use $(1)$, while they should be using $(2)$. But they use $(1)$ in a way that it just becomes notation for $(2)$ which is the right one mathematically.
A: There is a difference between $\lim\limits_{n\to\infty}g_n(x)$ and $\lim\limits_{n\to\infty}g_n$. Since $x$ is specified, $\lim\limits_{n\to\infty}g_n(x)$ means the pointwise limit of $g_n$; that is, the limit of $g_n$ under the topology of pointwise convergence, aka the product topology. With $\lim\limits_{n\to\infty}g_n$, the topology under which the limit is taken is not clear, but if taken in the sense of distributions, that is under the weak-* topology on $C_c^\infty$, the limit would be the Dirac delta distribution.
If rather than
$$
\int_0^1\left[\lim_{n\to\infty}g_n(x)\right]\,\mathrm{d}x = 1\tag{1}
$$
which is false, the physicist said, or meant,
$$
\int_0^1\left[\lim_{n\to\infty}g_n\right](x)\,\mathrm{d}x = 1\tag{2}
$$
then the limit could be taken in the sense of distributions, under which $(2)$ would be correct.
A: The mathematics does not say the limits never commute in your case, just that they do not necessarily do so. It just so happens that the limit of your $g_n$'s is a distribution, the $\delta$-distribution, which correspons to the dirac measure, but it need not necessarily have been this nice. At least this is my understanding of the matter.
