For example, what is $\frac{d}{dx}\int_{1}^{x^{2}} \ln(t)\,dt$? Let $F(x) =\int_{1}^{x} \ln(t) \, dt$. Then the first FTC yields $F'(x)=\ln(x)$ $\frac{d}{dx}F(x^{2})=2xF'(x^{2}) = 2x\ln(x^{2}).$While the First Fundamental Theorem of Calculus tells us that $\frac{d}{dx}\!\int_a^x f(t)\,dt = f(x),$and the Second Fundamental Theorem tells us that for a fixed antiderivative $F$, $\int_{a}^{b} f(t)\,dt = F(b) - F(a),$neither addresses directly what happens when the integrand itself or the limits of integration depend on the variable of differentiation - which may be the case in many problems in applied mathematics. The Leibniz rule fills this gap by combining both FTCs and the chain rule into one versatile formula. # Statement > [!NOTE] Lemma > Let $I,J \subset \mathbb{R}$ be open real intervals. Let $a, b:I\to J$ be [[Continuous Differentiability|continuously differentiable]] functions and $g:I\times J\to \mathbb{R}$ such that both $g$ and $\partial_{y}g$ are [[Continuous Real Function|continuous]]. Then for all $x\in I,$ $\frac{d}{dx}\left( \int_{a(x)}^{b(x)} g(x,y) \; dy \right) = g(x,b(x))b'(x)-g(x,a(x))a'(x) + \int_{a(x)}^{b(x)} \partial_{x} g(x,y)\; dy. \tag{1}$ # Proof The [[Fundamental theorem of calculus|first fundamental theorem of calculus]] gives that $\partial_{b}\int_{a}^{b}g(x,y)\, dy=g(x,b)$ and $\partial_{a}\int_{a}^{b}g(x,y)\, dy=-g(x,a)$. Furthermore, we may see that $\partial_{x}\int_{a}^{b}f(x,y)\, dy =\int_{a}^{b} \partial_{x}f(x,y)\, dy$ as follows: we start by expressing $\int_{a}^{b} f(x,y)\, dy$ using the [[Fundamental theorem of calculus|second FTC]] - fix $c\in \mathbb{R}$ $\int_{a}^{b} f(x,y)\, dy=\int_{a}^{b} \left( \int_{c}^{x} \partial_{x} f(x, y) \, dx + f(c,y) \right)\, dy = \int_{a}^{b} \int_{c}^{x} \partial_{x} f(x, y) \, dx \, dy + \int_{a}^{b} f(c,y) \, dy .$[[Fubini's theorem|Fubini's theorem]] yields $\int_{a}^{b} \int_{c}^{x} \partial_{x} f(x, y) \, dx \, dy = \int_{c}^{x}\int_{a}^{b} \partial_{x}f(x,y) \, dy \, dx$ so differentiating both sides above, the first FTC again yields that $\partial_{x}\int_{a}^{b} f(x,y) \, dy =\int_{a}^{b} \partial_{x} f(x,y)\, dy+0$ (the second term doesn't depend on $x$). Next, we apply the chain rule to derive the stated result. Let $x\in[\alpha,\beta]$ and define the map$\begin{aligned}G:[\alpha,\beta]\times I\times J&\to\mathbb{R}\\(x,a,b)&\mapsto\int_a^bg(x,y)\mathrm{d}y\end{aligned}$and the curve $\begin{align} \gamma\colon[\alpha,\beta]&\to[\alpha,\beta]\times I\times J\\x&\mapsto(x,a(x),b(x)). \end{align}$ Our assumptions yield that curve is differentiable with derivative $\gamma^{\prime}(x)=(1,a^{\prime}(x),b^{\prime}(x)).$ Combining the [[Chain rule for derivative|chain rule]] and the above gives $\begin{aligned}\frac{d}{dx}\left(\int_{a(x)}^{b(x)}g(x,y)\:\mathrm{d}y\right)&=\frac{d}{dx}\left(G\circ\gamma\right)(x)=\nabla G(\gamma(x)) \cdot\gamma'(x)\\&=\partial_{x}G(\gamma(x))+a^{\prime}(x)\partial_{a}G(\gamma(x))+b^{\prime}(x)\partial_{b}G(\gamma(x))\\&=\int_{a(x)}^{b(x)}\partial_{x}g(x,y)\mathrm{d}y-g(x,a)a^{\prime}(x)+g(x,b(x))b^{\prime}(x).\end{aligned}$