Pointwise convergence to zero, with integrals converging to a nonzero value For $n\in{\mathbb{N}}$ let $$f_n(x)=nx(1-x^2)^n\qquad(0\le x\le 1).$$
Show that $\{f_n\}_{n=1}^\infty$ converges pointwise to $0$ on $[0,1]$.
Show that $\{\int_0^1f_n\}_{n=1}^\infty$ converges to $\frac12$.
I've already shown both of these statements to be true. What I don't understand is this: how can $f_n$ converge pointwise to $0$, yet the sequence $\{\int_0^1f_n\}_{n=1}^\infty$ converges to $\frac12$? Isn't that almost like saying $f(x)=0\qquad(a\le x\le b)$, but $\int_a^bf(x)=\frac12$?
Clearly that would be false. I know this has something to do with that this is a sequence of functions but it still baffles my mind. Thanks in advance.
 A: Pointwise convergence of a sequence of functions doesn't necessarily imply convergence of their integrals. 
Here's a simpler example. Let $f_n$ be a rectangle over the interval $(0,1/n]$ with height $n$. Then the $f_n$ get narrower and taller as $n\to\infty$, maintaining an area of $1$ for every $n$. So $\int_0^1f_n\to1$ as $n\to\infty$. But you can see that the $f_n$ converge pointwise to zero everywhere, since for every $x>0$ there will be a point past which all the rectangles are so narrow that they've already 'squeezed past' $x$. These $f_n$ have the odd property that all their area 'escapes' as they converge, so that their limit has area zero.
BTW, there is a condition on the $\{f_n\}$ that assures that pointwise convergence of $f_n$ to $f$ implies $\int f_n\to\int f$: it's called 'uniform integrability'.
A: Perhaps easier to visualize: Let $f_n$ be a triangular spike over $[1/(2n),1/n]$ of height $2n.$ Fixing any $x\in (0,1],$ these triangles eventually all lie to the left of $x.$ Hence $f_n(x)$ is eventually $0.$ Also, $f_n(0) = 0$ for every $n.$ Thus $f_n \to 0$ pointwise on $[0,1].$ But $\int_0^1f_n = 1/2$ for every $n.$
A: Have you tried sketching the first few functions? 
As $n$ increases, the area under the function graph "flows" further and further to the right end like a wave while remaining constant.
As $f_n(1)=0$ for all $n$ and every point $x<1$ falls behind the wave sooner or later, the pointwise convergence follows.
The underlying problem is that swapping limits (and integration is a limit) is not always allowed; the basic example for sequences is $\lim_{n\to\infty}\lim_{m\to\infty}\frac{n}{n+m}=0\ne1= \lim_{m\to\infty}\lim_{n\to\infty}\frac{n}{n+m}$.
A: In my way of understanding, you can say that at each point $x$, the behavior $f(x)$ has nothing to do with the rest of the values $f(y), y \neq x$. On the other hand, the integral $\int_{0}^{1} f(x) dx = \| f\|_{1,[0,1]}$ takes into account all of $f$. 
That is, pointwise convergence of $f_{n}$ (local behavior) does not tell you much about the convergence of $\int_{0}^{1} f_{n}(x) dx$ (global behavior). Which is why we need the idea of uniform convergence.
