Can a sequence of functions integrable on [a,b] converge pointwise to a non-integrable function? There is a theorem in Spivak's Calculus: 
I want to understand the limitations of this theorem, e.g. why it requires uniform convergence and not pointwise convergence. So I have two questions:


*

*Find a sequence of functions $\{f_n\}$ such that $\forall n: f_n$ is integrable on [a, b], $\{f_n\}$ converges pointwisely to some function $f$ on [a, b], and $f$ is not integrable on [a, b]

*Find a sequence of functions $\{f_n\}$ such that $\forall n: f_n$ is integrable on [a, b], $\{f_n\}$ converges pointwise to some function $f$ on [a, b], $f$ is integrable on [a, b], but $\int_a^b{f} \neq lim_{n \rightarrow \infty}{\int_a^b{f_n}}$
 A: For your first quesion, Carry on Smiling's answer is the same as the one I was going to give. Let $r_1, r_2, \ldots$ be an enumeration of $\mathbb{Q} \cap [0,1]$, and consider the functions $f_n \colon [0, 1] \to \mathbb{R}$ defined by
$$
f_n(x) =
\begin{cases}
1 & \text{if } x \in \{r_1,\ldots, r_n\} \\
0 & \text{otherwise.}
\end{cases}
$$
Each $f_n$ is integrable because it is discontinuous at only a finite number of points. But the pointwise limit
$$
f(x) =
\begin{cases}
1 & \text{if } x \in \{r_i : i \in \mathbb{N} \} \\
0 & \text{otherwise.}
\end{cases}
$$
is not integrable.
For your second question, consider the functions $g_n \colon [0,1] \to \mathbb{R}$ defined by
$$
g_n(x) =
\begin{cases}
n - n^2x & \text{if } 0 < x < 1/n \\
0 & \text{otherwise}.
\end{cases}
$$
The region bounded by $g_n$ and the x-axis is a triangle with vertices $(0,0)$, $(0, n)$, and $(1/n, 0)$, which has area $1/2$. Furthermore, $g_n$ converges pointwise to the constant-zero function. We then have
$$
\lim_{n \to \infty}\int_0^1 g_n(x)\,dx = \frac{1}{2} \not= 0 = \int_0^10\,dx.
$$
A: Example $1$: 
Let $q_1,q_2,q_3\dots$ be a numbering of the rational numbers.
Define $f_n(x)$ as $f(x)=0$ if $x$ is rational, and for a rational number $q_i$ let $f_n(x)=1$ if $i\leq n$ and $f_n(x)=0$ otherwise. Each such function is clearly integrable as it is $0$ at all points except a finite number. But it is easy to see the sequence $f_n$ converges pointwise to $f$, where we define $f(x)=0$ if $x$ is irrational and $f(x)=1$ if $x$ is rational. This function is not integrable.
A: For 2: Consider $f_k(x)=\frac{-2k^2x}{(k^2x^2+1)^2}$, which goes to $0$ as $k \to \infty$. The antiderivative is $\frac{1}{k^2x^2+1}$. So we have:
$$\int_{0}^{1}f_k(x)dx=-1 \ne 0$$
The reason that pointwise convergence does not work is that even though we have that $f_k(x)$ will get close to $f(x)$, the rate of convergence can be different for different values of $x$.
A: Let's work on $[0,1].$ 1. Define $f_n(x) = (1/x)\cdot\chi_{[1/n,1]}(x).$ Then $f_n(x)$ converges to $1/x$ pointwise on $(0,1],$ and $f_n(0) = 0$ for all $n.$ The pointwise limit is clearly not integrable on $[0,1],$ not even in the improper sense.


*Let $f_n(x)= n^2x^n(1-x).$ Then $f_n \to 0$ pointwise on $[0,1].$ But


$$\int_0^1 n^2x^n(1-x)\,dx = \frac{n^2}{(n+1)(n+2)}\to 1.$$
