Verifying interchange of limit and integral I have just encountered this exercise in a textbook:

Suppose $ f_n:\mathbb{R} \to \mathbb{R} $ is a sequence of nonnegative functions such that:

*

*Each $f_n $ is nonincreasing i.e. $ f_n(x) \leq f_n(y) $ for $x\geq y $


*$ f_n \uparrow f $ i.e $f_n \to f$ pointwise and $f_{n+1}(x) \geq f_n(x) $


*$\int_0^{\infty} f_n(x)dx \leq C $ for some real constant $C$
We are asked to verify $ \lim_{n\to\infty}{\int_0^{\infty}f_n(x)dx} = \int_{0}^{\infty} f(x)dx $ where the integrals are improper Riemann integrals.

This is what I have come up with: since $0 \leq f_n(x) \uparrow f $ we must have that $\int_0^{\infty}f_n(x)dx$ is a nondecreasing sequence bounded from above by $C$ so it is convergent to a finite limit. I am stuck here and cannot proceed, maybe there is a theorem to be used or something from measure theory which I am new at? I only know Fatou, dominated and monotone but the integrals here are improper Riemann and I don't know how to switch between Lebesgue and Riemann integrals. Any help would be appreciated.
 A: First note that the pointwise limit of nonincreasing functions is again nonicreasing. Thus $f$ is Riemann-integrable over every compact interval $[a,b] \subset \mathbb{R}$.
Next, the pointwise limit of nonnegative functions is nonnegative, hence
$$y \mapsto \int_0^y f(x)\,dx$$
is nondecreasing, and therefore
$$L := \lim_{y \to +\infty} \int_0^y f(x)\,dx$$
exists in $[0, +\infty]$. We will see that $L < +\infty$ later, so far we do not rule out the possibility that $L = +\infty$.
Now if you know that every function that is Riemann-integrable over a compact interval is also Lebesgue-integrable over that interval and the Riemann-integral and the Lebesgue-integral over that interval have the same value, you can use the monotone convergence theorem for Lebesgue-integrals to deduce that for every $y \in (0, + \infty)$ you have
$$\int_0^y f(x)\,dx = \lim_{n \to +\infty} \int_0^y f_n(x)\,dx\,.$$
You can also obtain that using only Riemann-integrals, by showing that the convergence $f_n(x) \to f(x)$ is good enough, but that's a lot more work. So if you can use that bit of Lebesgue-theory, do it.
Furthermore, since the $f_n$ are non-negative it follows that
$$0 \leqslant \int_0^y f_n(x)\,dx \leqslant \int_0^{+\infty} f_n(x)\,dx \leqslant C$$
for all $n$, and all $y \in (0, +\infty)$, whence
$$0 \leqslant \int_0^y f(x)\,dx \leqslant C$$
for all $y$, and therefore $L \leqslant C$.
Finally, for every $\varepsilon > 0$ you can pick $y$ such that
$$\int_0^y f(x)\,dx > L - \varepsilon\,.$$
Then, using the monotone convergence theorem again we have
$$\lim_{n \to \infty} \int_0^{+\infty} f_n(x)\,dx \geqslant \lim_{n \to +\infty} \int_0^y f_n(x)\,dx > L - \varepsilon\,.$$
This holds for all $\varepsilon > 0$, hence
$$\lim_{n \to \infty} \int_0^{+\infty} f_n(x)\,dx \geqslant L\,.$$
The other inequality follows from
$$\int_0^{+\infty} f_n(x)\,dx = \lim_{y \to +\infty} \int_0^y f_n(x)\,dx \leqslant \lim_{y \to +\infty} \int_0^y f(x)\,dx = L$$
for all $n$.
