Improper integral - equivalent definition?

I think this is a counterexample.

Let $g$ be any non-negative function on $\mathbb{R}$ such that the improper Riemann integral $\int_{-\infty}^\infty g$ exists. Let $S = \{ q + (p/q) : q, p = 1, 2, \ldots \}$, and let $f(x)$ be equal to $g(x)$ except on $S$, where $f(x) = 1$.

Since $S$ has only finitely many points in any finite interval, $f$ is continuous and equal to $g$ except on the countable set $S$, therefore $\int_{-\infty}^\infty f$ exists, and is equal to $\int_{-\infty}^\infty g$.

But for $q = 1, 2, \ldots$, the sum $\sum_{n = -\infty}^\infty f(n/q)$ diverges to $+\infty$, therefore the limit on the left hand side of (1) does not exist.

Update: it gets worse, I'm afraid.

One might still reasonably hope that, if $f$ is continuous (which rules out this counterexample as it stands), and $f$ is non-negative, and $\int_{-\infty}^\infty f$ exists, then all the infinite sums on the left hand side of (1) exist, so there's a fair chance that (1) holds under these (arguably not too restrictive) conditions.

Define the countable set $S \subset \mathbb{R}$, in the same way as before. Because $S$ has only finitely many points in any finite interval, it can be arranged as a strictly increasing sequence, $s_1 < s_2 < \ldots$.

Choose a convergent series $\sum_{k=1}^\infty t_k$ such that $t_k > 0$ and $s_k + t_k \leqslant s_{k+1} - t_{k+1}$ ($k = 1, 2, \ldots$).

Let $h: (-1, 1) \to \mathbb{R}$ be a "bump function", such as: $$ h(y) = e^{y^2/(y^2 - 1)} \qquad (-1 < y < 1). $$

Define: $$ f(s_k + yt_k) = \frac{h(y)}{s_k} \qquad (k = 1, 2, \ldots; \ -1 < y < 1), $$ and let $f$ have the value $0$ everywhere outside the pairwise disjoint open intervals $(s_k - t_k, s_k + t_k)$.

Observe that for $l = 1, 2, \ldots$, we have $n/l \in S$ and $f(n/l) = l/n$ for all $n > l^2$, and therefore: $$ \sum_{n = -\infty}^\infty f\left(\frac{n}{l}\right) \geqslant \sum_{n = l^2 + 1}^\infty f\left(\frac{n}{l}\right) = l\sum_{n = l^2 + 1}^\infty \frac{1}{n} = +\infty. $$

Thus: $f$ is smooth everywhere on $\mathbb{R}$; $f(x) \geqslant 0$ for all $x \in \mathbb{R}$; $f(x) \to 0$ as $x \to \pm \infty$; the improper Riemann integral $\int_{-\infty}^\infty f$ exists (it is bounded above by $2\sum_{k=1}^\infty t_k/s_k$, and therefore by $2\sum_{k=1}^\infty t_k$); yet, the inner series on the left hand side of (1) diverges to $+\infty$ for all positive integral values of $l$.

So, even though the parameter $\Delta x$ on the left hand side of (1) may assume any strictly positive value, the series expression under the outer limit sign becomes undefined for arbitrarily small values of $\Delta x$, so the limit itself is not well defined, even for this quite "reasonable" function $f$.

Further update: essentially the same construction, and same argument, with these minor changes: $$ f(s_k + yt_k) = \frac{h(y)}{s_k\log s_k}, \\ \sum_{n = -\infty}^\infty f\left(\frac{n}{l}\right) \geqslant l\sum_{n = l^2 + 1}^\infty \frac{1}{n\log n} = +\infty, $$ shows that (1) fails even for smooth $f$ such that $\int_{-\infty}^\infty f$ exists and $f(x) = O\left(\frac{1}{\left\lvert{x}\right\rvert\log\left\lvert{x}\right\rvert}\right)$ for large $\left\lvert{x}\right\rvert$.


This is a possibly overcomplicated proof of the conjectured identity: \begin{equation} \lim_{\delta \to 0+} \sum_{n = -\infty}^\infty f(n\delta)\delta = \int_{-\infty}^\infty f \tag{1}\label{eq:A} \end{equation} for the improper Riemann integral of a function $f: \mathbb{R} \to \mathbb{R}$, based on these hypotheses about $f$:

  1. $f$ is integrable on all finite intervals of $\mathbb{R}$;
  2. $f(x) = O\!\left(\frac{1}{x^2}\right)$, for large $\left\lvert{x}\right\rvert$. $\newcommand{\abs}[1]{\left\lvert#1\right\rvert}$ $\newcommand{\R}{\mathbb{R}}$ $\newcommand{\Z}{\mathbb{Z}}$ $\renewcommand{\phi}{\varphi}$ $\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}$

By hypothesis, there exist $M, A > 0$ such that $\abs{f(x)} \leqslant M/x^2$ for $\abs{x} \geqslant A$.

$\int_0^\infty f$ exists, by the Cauchy convergence criterion, because, if $A \leqslant a \leqslant b$, $$ \bigg\lvert\int_0^b f - \int_0^a f\bigg\rvert = \bigg\lvert\int_a^b f\bigg\rvert \leqslant \int_a^b \abs{f} \leqslant \int_a^b \frac{M}{x^2}\,dx = M\left(\frac{1}{a} - \frac{1}{b}\right) < \frac{M}{a} $$ and this tends to $0$ as $a$ tends to $\infty$. Similarly for $\int_{-\infty}^0 f$; therefore $\int_{-\infty}^\infty f$ exists.

Also, it is clear that all the sums on the left hand side of $\eqref{eq:A}$ converge, by comparison with $\sum 1/n^2$. But we need precise information on this convergence.

For $\delta > 0$, let $S(\delta) = \sum_{n = -\infty}^\infty f(n\delta)\delta$. There exists a positive real number $N(\delta)$ (which we may take as large as we please) such that: \begin{equation} \bigg\lvert S(\delta) - \!\!\!\!\sum_{\abs{n} \leqslant N} f(n\delta)\delta \bigg\rvert < -\frac{1}{\log\delta} \ \text{ for all } N \geqslant N(\delta). \tag{2}\label{eq:B} \end{equation} The expression $-1/(\log\delta)$ is chosen so that it tends only slowly to $0$ as $\delta \to 0$; any other similarly slowly shrinking function would have done instead.

The size of $N(\delta)$ turns out to be critical, so we estimate it carefully. Certainly we require $N(\delta)\delta > A$ for all $\delta$, in order to use our hypothesis on $f$. Also: $$ \lim_{\delta \to 0+} N(\delta)\delta = +\infty. $$ Both these properties are guaranteed by the choice of $N(\delta)$ that follows, so long as $\delta$ is small enough. (Certainly $\delta < 1$, otherwise $\eqref{eq:B}$ is ill-defined.) If $N\delta \geqslant A$: \begin{gather*} \bigg\lvert \sum_{\abs{n} > N} f(n\delta)\delta \bigg\rvert \leqslant \sum_{\abs{n} > N} \abs{f(n\delta)}\delta \leqslant \frac{2M}{\delta}\!\!\!\sum_{n=N+1}^\infty \frac{1}{n^2} < \frac{2M}{\delta}\!\!\!\sum_{n=N+1}^\infty \frac{1}{n(n - 1)} = \frac{2M}{N\delta}. \end{gather*}

Accordingly, we define $N(\delta)$ by the equation $N(\delta)\delta = -2M\log\delta$.

Consider the change of variables $\phi: (-1, 1) \to \R$, where: $$ \phi(y) = \frac{1}{1 - y} - \frac{1}{1 + y} = \frac{2y}{1 - y^2}, \ \ \phi'(y) = \frac{2(1 + y^2)}{(1 - y^2)^2} \ \ \ (-1 < y < 1). $$

If we write $y_n = \phi^{-1}(n\delta)$ for all $n \in \Z$, then by Taylor's Theorem: \begin{gather*} \sum_{\abs{n} \leqslant N(\delta)} f(n\delta)\delta = \!\!\!\!\sum_{\abs{n} \leqslant N(\delta)} f(\phi(y_n))(\phi(y_{n+1}) - \phi(y_n)) = \\ \sum_{\abs{n} \leqslant N(\delta)} f(\phi(y_n))\phi'(y_n)(y_{n+1} - y_n) + \!\!\!\!\sum_{\abs{n} \leqslant N(\delta)} f(\phi(y_n))\frac{\phi''(y_n^*)}{2}(y_{n+1} - y_n)^2, \end{gather*} for some $y_n^*$ such that $y_n < y_n^* < y_{n+1}$ ($\abs{n} \leqslant N(\delta)$).

The first of these two subexpressions is 'almost' a Riemann sum for the integral $\int_{-1}^{1} f(\phi(y))\phi'(y)\,dy$. Note that the integrand remains bounded at the endpoints, because $\phi'(y) \sim \phi(y)^2$ as $y \to \pm 1$, and therefore, for $y$ close to $\pm 1$, $$ \abs{f(\phi(y))\phi'(y)} \leqslant \frac{M\phi'(y)}{\phi(y)^2} \sim M. $$

Define a function $F: (-1, 1) \to \R$, and numbers $c(\delta), d(\delta) \in (-1, 1)$, by: \begin{align*} F(y) & = f(\phi(y))\phi'(y) \ \ (-1 < y < 1), \\ c(\delta) & = \phi^{-1}(-N(\delta)\delta), \\ d(\delta) & = \phi^{-1}((N(\delta) + 1)\delta)). \end{align*} Then $\lim_{\delta \to 0+} c(\delta) = -1$, $\lim_{\delta \to 0+} d(\delta) = 1$, and, because $F$ is bounded at $\pm 1$, \begin{equation} \int_{-\infty}^\infty f = \lim_{\delta \to 0+} \int_{-N(\delta)\delta}^{(N(\delta) + 1)\delta} f = \lim_{\delta \to 0+} \int_{c(\delta)}^{d(\delta)} F = \int_{-1}^1 F. \tag{3}\label{eq:D} \end{equation}

The desired conclusion $\eqref{eq:A}$ follows from $\eqref{eq:B}$, $\eqref{eq:D}$, and: \begin{equation} \lim_{\delta \to 0+} \sum_{\abs{n} \leqslant N(\delta)} f(n\delta)\delta = \int_{-1}^1 F, \tag{4}\label{eq:F} \end{equation} which we now prove.

We obtained, above, a lengthy expression of the form: $$ \sum_{\abs{n} \leqslant N(\delta)} f(n\delta)\delta = I(\delta) + J(\delta), $$ remarking at the time that $I(\delta)$ is 'almost' a Riemann sum. In fact (here we temporarily denote the integer $\floor{N(\delta)}$ by '$N$' for readability), the expression $$ F(y_{-N})(1 + y_{-N}) + I(\delta) + F(y_{N+1})(1 - y_{N+1}) $$ is a Riemann sum for the partition $(-1, y_{-N}, y_{-N+1}, \ldots, 0, \ldots, y_N, y_{N+1}, 1)$, tagged with values $(y_{-N}, y_{-N}, y_{-N+1}, \ldots, 0, \ldots, y_N, y_{N+1})$. By the continuity of $\phi$, the maximum of the interval lengths $y_{n+1} - y_n$ tends to $0$ with $\delta$; and we have already remarked that $y_{N+1}$ tends to $1$ and $y_{-N}$ to $-1$; and $F$ is bounded.

From the facts just mentioned, it follows that: $$ \lim_{\delta \to 0+} I(\delta) = \int_{-1}^1 F, $$ and so the proof of $\eqref{eq:F}$, and therefore of $\eqref{eq:A}$, reduces to: $$ \lim_{\delta \to 0+} J(\delta) = 0, $$ or in full: $$ \lim_{\delta \to 0+} \sum_{\abs{n} \leqslant N(\delta)} f(\phi(y_n))\frac{\phi''(y_n^*)}{2}(y_{n+1} - y_n)^2 = 0. $$

By our hypotheses, $f$ is integrable, and therefore bounded, on the interval $[-A, A + \delta]$, therefore the factor $f(\phi(y_n))\phi''(y_n^*)$ is bounded for $n \in \Z$ such that: $$ -\phi^{-1}(A) \leqslant y_n < y_n^* < y_{n+1} \leqslant \phi^{-1}(A + \delta), $$ or equivalently, $$ -A \leqslant n\delta < \phi(y_n^*) < (n + 1)\delta \leqslant A + \delta. $$ Such terms therefore contribute at most a fixed multiple of $\sum_n (y_{n+1} - y_n)^2$ to the absolute value of the summation; and because $\lim_{\delta \to 0+} \max_n (y_{n+1} - y_n) = 0$, and $\sum_n (y_{n+1} - y_n) < 2$, this part of the sum tends to $0$ in the limit as $\delta \to 0$.

What now remains to be proved is: \begin{equation} \lim_{\delta \to 0+} \sum_{A/\delta \leqslant \abs{n} \leqslant N(\delta)} f(\phi(y_n))\frac{\phi''(y_n^*)}{2}(y_{n+1} - y_n)^2 = 0. \tag{5}\label{eq:H} \end{equation} For such $n$, we have: $$ \abs{f(\phi(y_n))\frac{\phi''(y_n^*)}{2}} \leqslant \frac{M\abs{\phi''(y_n^*)}}{2\phi(y_n)^2} = \frac{M\abs{\phi''(y_n^*)}}{2n^2\delta^2}. $$ Note that: $$ \phi''(y) = \frac{4(3y + y^3)}{(1 - y^2)^3} \ \ \ (-1 < y < 1). $$ By taking $A$ large enough, we can assume that all values of the argument $y$ under consideration satisfy $1/\sqrt{2} \leqslant \abs{y} < 1$, so that $\abs{y} \leqslant 2\abs{y^3}$, and therefore: $$ \abs{\phi''(y)} \leqslant \frac{28\abs{y}^3}{(1 - y^2)^3} = \frac{7\abs{\phi(y)}^3}{2}. $$ We also have the inequality: $$ \abs{\phi(y_n^*)} \leqslant (\abs{n} + 1)\delta. $$ Putting it all together: $$ \abs{f(\phi(y_n))\frac{\phi''(y_n^*)}{2}} \leqslant \frac{7M\abs{\phi(y_n^*)}^3}{4n^2\delta^2} \leqslant \frac{7M\delta(\abs{n} + 1)^3}{4n^2} = \frac{7M\abs{n}\delta}{4}\left(1 + \frac{1}{\abs{n}}\right)^3. $$ Taking $A$ large enough, we can assume $\abs{n} \geqslant 22$, therefore $\left(1 + \frac{1}{\abs{n}}\right)^3 < \frac{8}{7}$, and: $$ \abs{f(\phi(y_n))\frac{\phi''(y_n^*)}{2}} \leqslant 2M\abs{n}\delta \leqslant 2MN(\delta)\delta = -4M^2\log\delta. $$ Having been careful with our estimates so far, we can afford to be sloppy now! We have $\phi'(y) \geqslant 2$, for all $y$, therefore $y_{n+1} - y_n \leqslant \delta/2$, for all $n$. This and the fact that $\sum_n (y_{n+1} - y_n) < 2$ together imply that the sum in $\eqref{eq:H}$ is bounded above by $-4M^2\delta\log\delta$, which does tend to $0$ with $\delta$. This completes the proof.