TITLE: Can I use Leibniz' rule to differentiate when integral is $\int_0^\gamma f(\gamma,s)dF(s)$, instead of $\int_0^\gamma f(\gamma,s)ds$ ($F$ is a CDF)
QUESTION [7 upvotes]: Specifically, suppose I have a CDF $F$ and an integral
$$
\int_0^\gamma (\gamma-s)dF(s)
$$
and I want to find
$$
\frac{d}{d\gamma} \int_0^\gamma (\gamma-s)dF(s)
$$
(Note that the upper limit $\gamma$ indicates that $s=\gamma$)

If the integral was $\int_0^\gamma (\gamma-s)ds$ then I can apply Liebniz rule. Can I still use Liebniz rule even though my integral is of the form $\int_0^\gamma f(\gamma,s)dF(s)$, instead of $\int_0^\gamma f(\gamma,s)ds$

(if $F$ is differentiable than I can (rigorously/correctly) write $dF(s) = f(s)ds$ and have the standard form. But if $F$ has mass point(s)... then I don't know)

REPLY [3 votes]: I will interpret the integral as Riemann-Stieltjes integral. Then by integration by parts,
\begin{align*}
\int_{0}^{\gamma} (\gamma-s) \, dF(s)
&= \left[ (\gamma-s)F(s) \right]_{0}^{\gamma} + \int_{0}^{\gamma} F(s) \, ds \\
&= -\gamma F(0) + \int_{0}^{\gamma} F(s) \, ds \\
&= \int_{0}^{\gamma} (F(s) - F(0)) \, ds.
\end{align*}
So we have
$$ \frac{d}{d\gamma} \int_{0}^{\gamma} (\gamma-s) \, dF(s) = F(\gamma) - F(0) = \int_{0}^{\gamma} dF(s) $$
at every continuity point $\gamma$ of $F$. But also notice that this is exactly what we expect when applying the Leibniz integral rule:
$$ \frac{d}{d\gamma} \int_{0}^{\gamma} (\gamma-s) \, dF(s)
\quad``\,=\text{''}\quad \underbrace{(\gamma - \gamma)F'(\gamma)}_{=0} + \int_{0}^{\gamma} dF(s).  $$