Hunter Liu's Website

6. Week 5: Integrals and Limits

≪ 5. Week 4: Differentiable Functions | Table of Contents | 7. Week 6: Integrals and Meshes ≫

I’ll be sticking to Rudin’s notation, definitions, and conventions.

On your homework last week, you were tasked with showing that the sequence of functions given by \[f_N(x) = \sum _{n=0}^{N} 2 ^{-n} \sin \left( 10^n x \right)\] is a sequence of smooth functions that converges to a nowhere-differentiable continuous function, \(f(x)\). Heuristically, one would like to say that \[f’(x) = \frac{d}{dx} \lim _{N\to\infty} f_N(x) =\lim _{N\to\infty} \frac{d}{dx} f_N(x),\] and one expects that since the rightmost limit doesn’t exist, neither does the leftmost. But the \(\frac{d}{dx}\) symbol hides within it a limit, and limits don’t commute! One must instead carefully show (similar to what we did last week) that the middle limit doesn’t exist.

In fact, the limit \(\lim _{N\to\infty} \frac{d}{dx} f_N(x)\) failing to exist does not imply that \(f\) is non-differentiable.

Lemma 1. (Bump Function)

Let \[\phi(x) = \begin{cases} \exp\left( -\frac{1}{x} \right) & x > 0, \\ 0 & x \leq 0.\end{cases}\] Then \(\phi(x)\) is smooth on \(\mathbb{R}\). Additionally, the function \[\chi(x) = \frac{\phi(x+1)\phi(1-x)}{\phi(x+1)\phi(1-x)+\phi\left( x-\frac{1}{2} \right)+ \phi\left( -x-\frac{1}{2} \right)}\] is smooth on \(\mathbb{R}\), satisfies \(\chi(x) = 1\) when \(\left\lvert x \right\rvert \leq \frac{1}{2}\), and \(\chi(x) = 0\) when \(\left\lvert x \right\rvert \geq 1\).

Graph this guy on Desmos to convince yourself. You can prove the smoothness of \(\phi\) by spamming L’Hôpital’s rule with the chain rule and some induction. Note \(\chi\) is well-defined, as for every \(x\) one of the terms in its denominator will be nonzero.

Now define the function \[f_0(x) = x \chi (x).\] Clearly \(f_0’(x) = 1\). Now define \[f_n(x) = \begin{cases} f_0\left( 2^kx \right) & n = 2k, \\ -f_0\left( 2^kx \right) & n = 2k+1.\end{cases}\] It’s easy to check that \(f(x) = \lim _{n\to\infty}f_n(x)\) exists, and in fact \(f(x) = 0\) for all \(x\). Hence \(f’(0)\) exists, but \(\lim _{n\to\infty} f_n’(x)\) does not exist.

Okay this is a really troll example since I’m forcing the derivatives of \(f_n\) to flip and flop like fishes, but the point still stands — we have to be really careful when mixing limits with derivatives. You can modify this construction to even make the convergence uniform (a bit more on this later) and the point still stands.

Limits and Integrals

So this now brings us to an important question: can I swap limits with integrals? In other words, if \(\left\lbrace f_n(x) \right\rbrace\) is a sequence of Riemann integrable functions on an interval \([a, b]\) and \(f(x) = \lim _{n\to\infty} f_n(x)\) exists at each point, is it true that \(f(x)\) is Riemann integrable? If so, can we say that \[\int _{a}^{b}f(x) dx = \int _{a}^{b} \lim _{n\to\infty} f_n(x) dx = \lim _{n\to\infty} \int _{a}^{b} f_n(x) dx?\]

The answer is unfortunately no in general. Let \(\left\lbrace q_n \right\rbrace\) be an enumeration of \(\mathbb{Q}\cap \left[ 0,1 \right]\), and define the functions \[f_n(x) = \begin{cases} 1 & x \in \left\lbrace q_1, q_2, \ldots, q_n \right\rbrace, \\ 0 & \textrm{otherwise.}\end{cases}\] One has that \(f_n\in \mathscr{R}\) for all \(n\), since they are only discontinuous at finitely many points. Moreover, one can show that \(f_n(x)\) converges pointwise to the function \[f(x) = \begin{cases} 1 & x\in \mathbb{Q}\cap \left[ 0,1 \right], \\ 0 & \textrm{otherwise.}\end{cases}\] However, \(f(x)\) is not Riemann integrable on \([0, 1]\).

Proof
Let \(\mathcal{P} = \left\lbrace 0 = x_0 < x_1 < \cdots < x_n = 1 \right\rbrace\) be any partition of \([0, 1]\). Since every nonempty interval contains a rational, we have \[M_i = \sup _{x\in \left[ x _{i-1}, x_i \right]} f(x) = 1.\] Likewise, since every nonempty interval contains an irrational, we have \[m_i = \inf _{x\in \left[ x _{i-1}, x_i \right]} f(x) = 0.\] Thus, no matter what \(\mathcal{P}\) is, we have \[\begin{align*} U\left( f, \mathcal{P} \right) = 1 && \textrm{and} && L \left( f, \mathcal{P} \right) = 0,\end{align*}\] and \(f\) is not Riemann integrable. \(\square\)

Like derivatives, integrals are secretly limits taken over all partitions as the mesh size tends to \(0\), and the above pathology is yet another manifestation of the fact that limits don’t commute. That being said, there are still scenarios in which one can justify the swapping of a limit with an integral.

Definition 2.

Let \(\left\lbrace f_n \right\rbrace\) be a sequence of functions defined on a common domain. We say \(f_n\) converges uniformly to a limit function \(f\) if for all \(\epsilon > 0\), there exists some \(N_ \epsilon \) such that \(n \geq N _ \epsilon \) implies \[\left\lvert f_n(x) - f(x) \right\rvert < \epsilon \] for all \(x\). That is to say, \(\sup_x \left\lvert f_n(x) - f(x) \right\rvert \leq \epsilon .\)

Theorem 3.

Suppose \(\left\lbrace f_n \right\rbrace\) is a sequence of Riemann integrable functions on the interval \([a, b]\), and suppose \(f_n\to f\) uniformly on \([a, b]\). Then \(f\) is Riemann integrable on \([a, b]\), and \[\int _{a}^{b} f(x) dx = \lim _{n\to\infty} \int _{a}^{b} f_n(x) dx.\]

Proof

We’ll proceed in two steps: first, we’ll show that \[\lim _{n\to\infty} \int _{a}^{b} f_n(x) dx \] exists to begin with. Then, we’ll argue that \(\int _{a}^{b} f(x) dx\) must exist and coincide with this limit.

Let \(\epsilon > 0\). There exists some \(N_ \epsilon > 0\) such that for all \(n, m > N_ \epsilon \), \(\left\lvert f_n(x) - f_m(x) \right\rvert < \epsilon \) for all \(x\in [a, b]\). Then, we have \[\begin{align*} \left\lvert \int _{a}^{b} f_n(x) dx - \int _{a}^{b} f_m(x) dx \right\rvert & = \left\lvert \int _{a}^{b} \left( f_n(x) - f_m(x) \right) dx \right\rvert \\ & \leq \left( \sup _{x} \left\lvert f_n(x) - f_m(x) \right\rvert \right) \cdot (b-a) \\ & \leq \epsilon \left( b-a \right).\end{align*}\] Thus, the sequence of integrals \(\int _{a}^{b} f_n(x) dx\) forms a Cauchy sequence and must have a limit \(L = \lim _{n\to\infty} \int _{a}^{b} f_n(x) dx\).

Let \(\epsilon > 0\). For \(n\) sufficiently large depending on \(\epsilon \), we have \(\left\lvert f(x) - f_n(x) \right\rvert < \epsilon \) for all \(x\). Then, one has for any partition \(\mathcal{P} = \left\lbrace a = x_0 < x_1 < \cdots < x_n = b \right\rbrace\) that \[\begin{align*} U(f, \mathcal{P}) &= \sum _{i=1}^{n} \Delta x_i \sup _{\left[ x _{i-1}, x_i \right]} f(x) \\ & \leq \sum _{i=1}^{n} \Delta x_i \left( \sup _{\left[ x _{i-1}, x_i \right]} f_n(x) + \epsilon \right) \\ & = U \left( f_n, \mathcal{P} \right) + \epsilon \left( b-a \right). \end{align*}\] Similarly, for such \(n\), we have that \[L \left( f, \mathcal{P} \right) \geq L \left( f_n, \mathcal{P} \right) - \epsilon (b - a).\]

Now select \(n\) so large that both \(\sup_x \left\lvert f_n(x) - f(x) \right\rvert < \epsilon \) and so that \(\left\lvert L - \int _{a}^{b} f_n(x) dx \right\rvert < \epsilon .\) After choosing \(n\), we have for all partitions with sufficiently small mesh sizes that \(U \left( f_n, \mathcal{P} \right) < \int _{a}^{b} f_n(x) + \epsilon \) and that \(L \left( f_n, \mathcal{P} \right) > \int _{a}^{b} f_n(x) - \epsilon \). Thus, \[U\left( f, \mathcal{P} \right) < U \left( f_n, \mathcal{P} \right) + \epsilon (b - a) < \int _{a}^{b} f_n(x) dx + \epsilon \left( b-a +1\right) < L + \epsilon\left( b-a+2 \right).\] Likewise, \[L \left( f, \mathcal{P} \right) > L \left( f_n, \mathcal{P} \right) - \epsilon (b-a) > \int _{a}^{b}f_n(x)dx - \epsilon \left( b-a+1 \right) > L - \epsilon \left( b-a+2 \right).\] We conclude that for all \(\epsilon > 0\), every partition with sufficiently small mesh size depending on \(\epsilon \) satisfies \[U(f, \mathcal{P}) - L(f, \mathcal{P}) < 2 \epsilon \left( b-a+2 \right),\] so \(f\in \mathscr{R}\). Moreover, upon taking \(\epsilon \to 0\) we see that \[L \leq \sup _{\mathcal{P}} L \left( f, \mathcal{P} \right) \leq \inf _{\mathcal{P}} U \left( f, \mathcal{P} \right) \leq L,\] hence \(L = \int _{a}^{b} f(x) dx\) by definition. \(\square\)

Although this proof is somewhat involved, in principle I think it’s quite straightforward if we interpret integrals as areas beneath the graph of a function. If \(f(x)\) is always within \(\epsilon \) of \(f_n(x)\), then the graph of \(f\) lies in an \(\epsilon \)-wide band around the graph of \(f_n\). Hence, the difference between the integrals of \(f_n\) and \(f\) is no larger than the area of the band, assuming the latter integral exists.

We can interpret what we just proved in the context of metric space topology as follows.

Let \(\mathcal{B} \left( [a, b] \right)\) be the set of bounded functions \([a, b]\to \mathbb{R}\). Define the metric \(d_\infty\) on \(\mathcal{B}\) as \[d_\infty (f, g) = \sup _{x\in [a, b]} \left\lvert f(x) - g(x) \right\rvert.\] Then \(\mathscr{R} \subseteq \mathcal{B}\) is closed (with respect to this metric), and the integral operator \(\mathscr{R} \to \mathbb{R}\) taking \(f\mapsto\int _{a}^{b} f(x) dx\) is continuous with respect to this metric (and the standard Euclidean metric).

Question 4.

How much of the above remains true if we replace \(dx\) with \(d \alpha \), i.e. if we replace Riemann integrals with Riemann-Stieltjes integrals?

Problem 5.

Suppose \(f : [0, \infty)\to \mathbb{R}\) is Riemann integrable on every interval of the form \([a, b] \subset [0, \infty)\). Define the indefinite integral \[\int _{0}^{\infty} f(x) dx := \lim _{n\to\infty} \int _{0}^{n} f(x) dx,\] if the limit exists. Given an example of a sequence of functions \(f_n\) converging uniformly to a limit \(f\) on \([0,\infty)\) such that \[\int _{0}^{\infty}f(x) dx \neq \lim _{n\to\infty} \int _{0}^{\infty} f_n(x) dx.\]

Hint
Imagine a gliding hump…

It is true in general that \[\int \lim _{n\to\infty} f_n(x) dx \leq \lim _{n\to\infty} \int f_n(x) dx\] whenever the limits and integrals exist, even if the convergence is not uniform. This is nearly a “conservation of mass” principle: when taking limits, you can make areas (or “mass”) disappear by “sending it to \(\infty\)”, but you can’t make mass appear out of thin air.

You can make this even more robust by saying \[\int \lim _{n\to\infty} f_n(x) dx \leq \liminf _{n\to\infty} \int f_n(x) dx,\] assuming the limits and integral on the left exist. This is known as Fatou’s lemma, but it’s a bit beyond the scope of this class.