Integration of function of two variables I'm studying Measure theory and Integration and i found this problem at Bartle's book "Elements of Integration". I understand that we have to use the Dominated Convergence Theorem but i don't see the way. Any advice\hint it would be very helpful.
Suppose the function $ x\to f(x,t) $ is $X$-measurable for each real number $t$, and the function $ t\to f(x,t) $ is continuous on R for each $x\in X$. In addition suppose that there integrable functions $g, h$ on $X$ such that $ |f(x,t)|\le g(x) $ and such that the improper Riemann integral satisfies the inequality 
$$
\int_{-\infty}^{\infty} |f(x,t)| \mathrm{d}t \le h(x).
$$ 
Show that 
$$
\int_{-\infty}^{\infty} \left[\int_X f(x,t) \mathrm{d}\mu(x) \right] \mathrm{d}t= \int_X \left[\int_{-\infty}^{\infty} f(x,t) \mathrm{d}t \right] \mathrm{d}\mu(x),
$$ 
where the integrals with respect to t are improper Riemann integrals.
 A: We first show that for any $a,b\in\mathbb R$,  $a<b$,
$$\int_{a}^{b} \int_X f(x,t) dμ(x)  dt= \int_X \int_{a}^{b} f(x,t) dt  dμ(x)$$
For LHS to make sense:


*

*$(A)$$f(x,t)$ needs to be measurable and integrable for every $t$ 

*$(B)$ $\int_X f(x,t)d \mu(x)$ needs to be Riemann integrable on $[a,b]$
$(A)$ is covered by the measurability assumption and the existence of $g$. For $(B)$, we have continuity in the integral by dominated convergence- if $t_n\to t$, then $f(x,t_n)\to  f(x,t)$ pointwise in $x$ (using continuity in $t$), and $\sup_n |f(x,t_n)| < g(x)$, $g\in L^1$, so
$$ \int_X f(x,t_n) d\mu \to \int_X f(x,t) d\mu .$$
A continuous function on $\mathbb R$ is Riemann integrable on every $[a,b]$.
For RHS to make sense:


*

*$(C)$ $f(x,t)$ needs to be Riemann integrable on $[a,b]$ for almost every $x$

*$(D)$ $\int_{a}^b f(x,t)dt$ needs to be measurable and integrable


$(C)$ is covered by the continuity assumption. For $(D)$, its measurable because  for each $x$, we can write it as the limit of the following functions, which are Riemann sums in $t$ (from If f is Riemann integrable on [a,b] then prove that there is an equispaced partition Pn such that limU(Pn,f) = limL(Pn,f) = the value of the integral. , we can choose the uniform grid mesh)
$$ R_n[f](x) := \sum_{i=1}^n  f\left(x,a+\frac{i(b-a)}n  \right) \frac{b-a}n\to \int_{a}^b f(x,t)dt$$
Integrability is by the bound  $$\int_X\left|\int_{a}^b f(x,t)dt\right| d\mu(x) \le \int_X\int_{a}^b |f(x,t)|dt d\mu(x)\le \int_X\int_{\mathbb R} |f(x,t)|dt d\mu(x) \le \int h d\mu < \infty$$ 
For the equality - Note that 
$$ R_n \left[ \int_X f d\mu\right ] = \int_X R_n f(x) d\mu(x)$$
By the Riemann integrability of $\int_X f d\mu$, the LHS converges to $\int_{a}^{b} \int_X f(x,t) dμ(x)  dt$. For the RHS, note that from $\sup_{t} |f(x,t)| \le g(x)$,
$$ |R_n f(x)| \le \sum_{i=1}^n  \left| f\left(x,a+\frac{i(b-a)}n  \right)\right|  \frac{b-a}n \le (b-a) g(x) \in L^1(X)$$
thus by Dominated convergence, the RHS converges to $\int_X \int_{a}^{b} f(x,t) dt  dμ(x)$.
To finish, we now use the assumption on the improper integral. The convergence of the improper integral
$$ F(x) = \lim_{\substack{a\to-\infty\\ b\to+\infty}} \int_a^b f(x,t) dt$$
is equivalent to the assertion that for any two sequences $a_n\to-\infty$ and $b_n\to\infty$, 
$$ F_n(x) := \int_{a_n}^{b_n} f(x,t) dt \to F(x).$$
The assumption $\int_{\mathbb R} |f(x,t)| dt < h(x)$ implies that $|F_n(x)|<h$, 
$$ |F_n(x)| \le \int_{a_n}^{b_n} |f(x,t)| dt  \le  \int_{-\infty}^{\infty} |f(x,t)| dt \le h(x)\in L^1.$$
Thus, by the equality for each fixed $[a,b]$ just proved and then dominated convergence,
\begin{align}
 \lim_{n\to\infty}\int_{a_n}^{b_n} \int_X f(x,t) dμ(x)  dt 
&= \lim_{n\to\infty}\int_X \int_{a_n}^{b_n} f(x,t) dt  dμ(x) \\
&= \lim_{n\to\infty} \int_X F_n(x) dx \\
&= \int_X F(x) dx \\ &=  \int_X \int_{\mathbb R} f(x,t) dμ(x)  dt
\end{align}
Thus, the improper integral $\int_{\mathbb R} \int_X f(x,t) dμ(x)  dt $ exists, and equals the claimed value.
