Measure theory: showing $\frac{1}{\pi} \int_{0}^{\pi} \cos (t \sin x - nx) dx$ is differentiable for all $n \geq 0$ and $t \in \mathbb{R}$. Problem: For each natural number $n$, let
$J_n \colon \mathbb{R} \to \mathbb{R}$ be given by
$$ J_n(t) = \frac{1}{\pi}
\int_{0}^{\pi} \cos (t \sin x - nx) dx, \quad
t \in \mathbb{R}.$$
Show that $J_n$ is differentiable for all $n\geq 0$
and that
$$J_1'(0) = \frac{1}{2}, \qquad 
J_n'(0) = 0, \quad \text{for }n\neq 1.$$
My difficulty: I'm using Schilling and trying to use the differentiability lemma (12.5):

-------
I'm having a tough time showing (a), and even when I showed it by not so pretty means, I needed to convert the Riemann integral in
$J_n$ to a Lebesgue integral, but the theorem for it requires that the function inside is measurable on the closed set $[0,\pi]$ which I haven't shown in (a), since we require $(a,b)$ there which is open.
Do I need to show measurability again then?
I feel like I'm missing some simple and mechanical approach to this problem. Maybe some simpler argument for measurability that gives it on $[0,\pi]$ and $(0,\pi)$ at the same time?
Help would be much appreciated.
 A: For the Borel σ-algebras, measurability of a function on $[0,\pi]$ or of its restriction to $(0,\pi)$ is the same because for any $A\subset(0,\pi),$
$A\in\mathcal B_{(0,\pi)}\Leftrightarrow A\in\mathcal B_{[0,\pi]},$ and adding a point to a subset of $[0,\pi]$ does not change its belonging (or not) to $\mathcal B_{[0,\pi]}.$ The same holds for the Lebesgue σ-algebras.
A: Fix $n\geq0$ and $t\in\mathbb{R}$. Let $(t_{m})$ be an arbitrary
sequence of real numbers such that $t_{m}\neq t$ and $t_{m}\rightarrow t$.
We go to prove that the limit $\lim_{m\rightarrow\infty}\frac{J_{n}(t_{m})-J_{n}(t)}{t_{m}-t}$
exists (and independent of the choice of $(t_m)$). It will follow that $J'_{n}(t)$ exists and equals to that
limit.
Let $x\in[0,\pi]$. We go to estimate $\frac{\cos(t_{m}\sin x-nx)-\cos(t\sin x-nx)}{t_{m}-t}.$
By Mean-Value Theorem, there exists $\xi$ (which depends on $t_{m}$,
$t,$$n$, and $x$) such that
\begin{eqnarray*}
 &  & \frac{\cos(t_{m}\sin x-nx)-\cos(t\sin x-nx)}{t_{m}-t}\\
 & = & \frac{-1}{t_{m}-t}\sin(\xi)\cdot\left[(t_{m}\sin x-nx)-(t\sin x-nx)\right]\\
 & = & -\sin\xi\sin x.
\end{eqnarray*}
Hence, $\left|\frac{\cos(t_{m}\sin x-nx)-\cos(t\sin x-nx)}{t_{m}-t}\right|\leq1$.
For each $m$, let $g_{m}:[0,\pi]\rightarrow\mathbb{R}$ be defined
by
$$
g_{m}(x)=\frac{\cos(t_{m}\sin x-nx)-\cos(t\sin x-nx)}{t_{m}-t}.
$$
By the above discussion, $|g_{m}(x)|\leq1$. By direct calculation,$\lim_{m\rightarrow\infty}g_{m}(x)=-\sin(t\sin x-nx)\cdot\sin x$.
Define $g:[0,\pi]\rightarrow\mathbb{R}$ by $g(x)=\lim_{m\rightarrow\infty}g_{m}(x)=-\sin(t\sin x-nx)\cdot\sin x$.
Now, by Lebesgue Dominated Convergence Theorem, $\lim_{m\rightarrow\infty}\frac{1}{\pi}\int_{0}^{\pi}g_{m}(x)dx=\frac{1}{\pi}\int_{0}^{\pi}g(x)dx$.
That is,
$$
\lim_{m\rightarrow\infty}\frac{J_{n}(t_{m})-J_{n}(t)}{t_{m}-t}=-\frac{1}{\pi}\int_{0}^{\pi}\sin(t\sin x-nx)\cdot\sin x\,dx.
$$
Therefore, $J_{n}'(t)$ exists and equals to $-\frac{1}{\pi}\int_{0}^{\pi}\sin(t\sin x-nx)\cdot\sin x\,dx.$
