TITLE: Differentiation of an integral depending on a parameter
QUESTION [5 upvotes]: Let $f(t):=\int_0^{\pi/2} \arccos\frac{t-\tan^2x}{t+\tan^2x}\,dx$, for $0\leq t\leq 1$. I would like to differentiate $f$ with respect to $t$ by taking the partial of the integrand:
$$
f'(t)
 = \int_0^{\pi/2}\frac{\partial}{\partial t}
   \left(\arccos\frac{t-\tan^2x}{t+\tan^2x}\right)\,dx
 = -\int_0^{\pi/2} \frac{1}{\sqrt{t}}
                   \frac{\tan x}{t+\tan^2x}\,dx.
$$
I am not sure to be able to fully justify this step, in particular because $x$ can approach $\frac{\pi}2$ (from the left), where $\tan x\rightarrow +\infty$, and $t$ can approach $0$ (from the right), where $\frac 1{\sqrt{t}}\rightarrow +\infty$. Am I allowed to do this differentiation under the integral sign?
I also would like to be pointed to some reference about differentiation under the integral sign, for the Riemann integral. Any help would be very appreciated.

REPLY [2 votes]: Here is an indirect proof, using the fact that integrals are often easier to control than derivatives: Write
$$ k(t, x) = \arccos\left(\frac{t+\tan^2 x}{t-\tan^2 x}\right). $$
Then for each $t > 0$ and $0 < x < \frac{\pi}{2}$, we have the bound
$$ \left| \frac{\partial k}{\partial t} \right| = \frac{1}{t} \cdot \frac{\sqrt{t}\tan x}{t+\tan^2 x} \stackrel{\text{(AM-GM)}}{\leq} \frac{1}{2t}. $$
So if $0 < a < b$, then by the Fundamental Theorem of Calculus (FToC) and the Fubini's Theorem, 
\begin{align*}
f(b) - f(a)
&= \int_{0}^{\frac{\pi}{2}} (k(b, x) - k(a, x)) \mathrm{d}x \\
&= \int_{0}^{\frac{\pi}{2}} \int_{a}^{b} \frac{\partial k}{\partial t} \, \mathrm{d}t\mathrm{d}x \\
&= \int_{a}^{b} \int_{0}^{\frac{\pi}{2}} \frac{\partial k}{\partial t} \, \mathrm{d}x\mathrm{d}t \\
&= \int_{a}^{b} g(t) \mathrm{d}t,
\end{align*}
where $g : (0, \infty) \to \mathbb{R}$ is defined by
$$ g(t) = \int_{0}^{\frac{\pi}{2}} \frac{\partial k}{\partial t} \, \mathrm{d}x. $$
Since $g$ is continuous, FToC again tells that $f$ is an antiderivative of $g$, and therefore $f$ is differentiable with $f' = g$ as desired.