# How to construct a counterexample to $\lim_{n\to\infty} \int_0^1 f_n(x)dx=\int_0^1f(x)dx$

Suppose $f_n(x), f(x)$ are continuous on $[0,1]$ and $\lim_{n\to \infty}f_n(x)=f(x)$ for all $x\in [0,1]$. Since the convergence is not necessarily uniform, there must exist a counterexample to the fact that $$\lim_{n\to\infty} \int_0^1 f_n(x)dx=\int_0^1f(x)dx$$ but I couldn't come up with any. I don't even understand what properties should $f_n$ have to begin with (except that this sequence is not uniformly convergent).

After I finished typing this question, I found this in similar questions. But I'm still wondering how could one come up with such a counterexample or how to come up with a different counterexample? What should I bear in mind to construct it? Obviously the key idea is that the limit of the integral is not the integral of the limit, but what subideas can I exploit?

Let $f_n$ be the tent function with support $[0, 1/n]$ and with $f_n(1/(2n)) = 2n$. Then it's clear that \begin{align} \int^1_0 f_n(x)\ dx = \frac{1}{2}\text{height }\cdot \text{ base} = 1. \end{align} Moreover, $f_n\rightarrow 0$ pointwise everywhere. Fix $x \in (0, 1]$, then there exists $N$ such that $x>N^{-1}$. In particular, we see that for all $n>N$ we have that $f_n(x) = 0$ since $x>\frac{1}{N}>\frac{1}{n}$. Of course, this is not uniform.
• Sorry, I can't see why this argument at the end implies that the convergence is not uniform. The negation of the definition is: there is $\epsilon$ such that for all $N$ there is $n>N$ and $x_0\in[0,1]$ with $|f_n(x_0)-0|\ge \epsilon$. What does it have with the inequalities $x > 1/N > 1/n$? – user531232 Aug 10 '18 at 2:38
• Oh, I see. You used $x > 1/N > 1/n$ to prove pointwise convergence... But how do I see that there is no uniform convergence directly? Of course I can deduce it from the fact that the limit and the integral do not "commute" and appeal to the corresponding theorem, but perhaps it's useful to see it directly. – user531232 Aug 10 '18 at 2:59
• Or can I just deduce that the convergence is not uniform from the fact that $\sup_{x\in [0,1]}|f_n(x)|=2n\to +\infty$? – user531232 Aug 10 '18 at 3:07