# 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)

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)

• For the integration limits, is it $F(s)=\gamma$ or $s=\gamma$? May 19, 2018 at 1:20
• @Szeto $s=\gamma$. I will add that May 19, 2018 at 1:25
• By the way, is it okay to interpret that F(s) has some discontinuities, making it not differentiable at some isolated points? May 19, 2018 at 2:18
• If you are able to convert it to an integral using the PDF instead, you could avoid this question altogether and apply the Leibniz rule. i.e. $$\int(\gamma-s) d F(s) = \int(\gamma-s)f(s)d s$$ where $f(s)$ is the PDF. However, this doesn't really answer your question regarding Leibniz rule applying to the integral with the CDF. May 19, 2018 at 2:27
• If it has a finite number of discontinuities, in theory you could split up the integral at each of the discontinuities and convert to the PDF. May 19, 2018 at 2:34

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).$$

• I have two questions then: 1) If I were to use the Leibniz integral rule, is it always that $\int_0^\gamma dF(s) = F(\gamma)-F(0)$? Using Fund. Thm. of Calculus comes to mind, but $f$ may not be continuous so I'm not sure it applies? 2) For this all that is required is $dF$ is lebesgue integrable? (and some condition on $\gamma-s$ but that is linear so I'm assuming it's fine) May 19, 2018 at 18:44
• @user106860, As I mentioned in the beginning of my answer, I interpreted the integral as the Riemann-Stieltjes integral as is often done in probability theory. The integral $$\int_{a}^{b} \phi(x) \, dF(x)$$ is well-defined as long as $\phi$ is continuous and $F$ is monotone increasing on $[a, b]$, and the equality $\int_{a}^{b} dF(x) = F(b) - F(a)$ is always true for such $F$. May 19, 2018 at 18:46
• And for integration by parts, I am used to seeing it applied to $\int u(x) v'(x)dx$, but here we have $\int u dv$, where $v$ is a function. What conditions are needed to be able to use integration by parts here? Wikipedia says that for $dv= v'(x)dx$ we need $v'(x)$ lebesgue integrable, but here with $dF(s)$ and $f(s)$ maybe have mass points, it is not necessarily that $dF(s) = f(s)ds$? If that is maybe not clear, I restate: how we can be sure that we can use integration by parts with $dF(s)$? May 19, 2018 at 18:52
• @user106860, Of course it is also proved for Riemann-Stieltjes integral. Basically, most of thing you can think of the usual Riemann integral extends to Riemann-Stieltjes integral without much hassle. May 19, 2018 at 18:54

I am not an expert in probability theory, but I think my knowledge is just sufficient to tackle this problem.

Assume $\gamma>0$ for convenience.

Let $\{a_i\}$ where $a_i>0$ be the discontinuities of $F(s)$. For $a_k<\gamma<a_{k+1}$, we can rewrite your integral as $$\int_0^{a_1-\epsilon}(\gamma-s)f(s)ds+\left(\sum_{j=1}^{k-1}\int^{a_{j+1}-\epsilon}_{a_j+\epsilon}(\gamma-s)f(s)ds\right)+\int^\gamma_{a_k+\epsilon}(\gamma-s)f(s)ds$$

Differentiating it yields

$$\int_0^{a_1-\epsilon}f(s)ds+\left(\sum_{j=1}^{k-1}\int^{a_{j+1}-\epsilon}_{a_j+\epsilon}f(s)ds\right)+\int^\gamma_{a_k+\epsilon}f(s)ds$$

Although a $\gamma$ appears in the integration limit of the last integral, but if you apply Leibniz integral rule carefully, you can see directly bringing the differentiation into the integral would give the correct result.

EDIT:

I should have explicitly state that $\epsilon$ is to be taken the limit $\to 0^+$.

Also, it might be counterintuitive that the value of the integrand at a point does not affect the value of the integral.

Proof:

Indeed, when decomposing your integral into partitions, I didn’t write out some integrals, whose absolute value is $$\vert\int^{a_j+\epsilon}_{a_j-\epsilon}f(s)ds\vert\le(a_j+\epsilon-(a_j-\epsilon))|\text{max}_{[a_j-\epsilon, a_j+\epsilon]}f(s)|=2\epsilon |\text{max}_{[a_j-\epsilon, a_j+\epsilon]}f(s)|$$ which vanishes in the limit, as long as the function is not infinite in the region.

• So $a_i$ can be points where $f(a_i)\not=0$ (i.e. mass points) correct? May 19, 2018 at 2:53
• @user106860 As long as $\lim_{s\to a_i^+}F(s)\ne\lim_{s\to a_i^-}F(s)$, $a_i$ is a discontinuity. May 19, 2018 at 3:05
• @Sveto but isn't this not counting $f(a_1), f(a_2),\dots f(a_k)$? May 19, 2018 at 15:17
• @user106860 Can you elaborate? I don’t really understand. May 19, 2018 at 15:18
• Suppose $f$ is continuous and defined on $0,1$. Also suppose that $f(.5) =.2$. Then $F$ has a discontinuity is $.5$. Suppose this is the only discontinuity. If I use the method you wrote to calculate $F(.6)$, won't it be too low by $.2$ because your integral does not include the point $.5$ (i.e. you integrate below $.5-\epsilon$ and above $.5+\epsilon$, but not at $.5$) May 19, 2018 at 15:22