Derivative of double integral with respect to upper limits

The Leibniz integral rule does work.

$$\begin{align}\frac{d}{dx} \int_{0}^{x} dy \left[\int_{0}^{x} f(y,z) dz \right] &=\int_{0}^{x} f(x,z) dz + \int_{0}^{x} dy \frac{\partial}{\partial x}\left[\int_{0}^{x} f(y,z) dz \right]\\ &= \int_{0}^{x} f(x,z) dz + \int_{0}^{x} dy \left[f(y,x) + \int_{0}^{x} \frac{\partial f(y,z)}{\partial x} dz\right]\\ &= \int_{0}^{x} f(x,z) dz + \int_{0}^{x} f(y,x) dy \end{align}$$ You only need to remember when the integration limit depends on $x$, $\frac{d}{dx}$ on the integral will pick up extra terms for the integration limits. In general:

$$\frac{d}{dx} \int_{a(x)}^{b(x)} g(x,y) dy = g(x,b(x)) b'(x) - g(x,a(x)) a'(x) + \int_{a(x)}^{b(x)} \frac{\partial g(x,y)}{\partial x} dy$$


Hint: Use the following fact:

Let $\phi(\alpha)=\int_{u_1}^{u_2}f(x,\alpha)dx, ~~a\leq\alpha\leq b$, where in the functions $u_1$ and $u_2$ may depend on the parameter $\alpha$. Then $$\frac{d\phi}{d\alpha}=\int_{u_1}^{u_2}f_{\alpha}dx+f(u_2,\alpha)\frac{du_2}{d\alpha}-f(u_1,\alpha)\frac{du_1}{d\alpha}$$

Here we can consider $x$ as $\alpha$ and consider $\int_0^{x}f(y,z)dy$ as $g(x,z)$.


Call your integral $I(x)$. What does $I(x)$ represent? It is the integral of function $f(y,z)$ over a square with one corner at $(0,0)$ and length of side equal to $x$. So that's $I(x)$. Now, if $x$ goes to $x+\Delta x$, what is $\Delta I$? That is the integral over the area made of two little slivers that wrap around your square from $(y=x, z=0)$, up to $(y=x, z=x)$, and back to $(y=0, z=x)$. So $\Delta I=\Delta x \times (\int_0^xf(x,z)dz + \int_0^xf(y,x)dy)$. Divide $\Delta I$ by $\Delta x$ and you have your derivative.


There is a different way, in my opinion cleaner. Let

$$ F(x,y):=\int_{0}^{x}\int_{0}^{y}f(u,v)\mathop{}\!d v\mathop{}\!d u $$

Then if we set $F_1(u,y):=\int_0^yf(u,v)\mathop{}\!d v$ then from the fundamental theorem of calculus we have that $$ \frac{\partial}{\partial x} F(x,y)=\frac{\partial}{\partial x}\int_{0}^x F_1(u,y)\mathop{}\!d u=F_1(x,y)=\int_{0}^{y} f(x,v)\mathop{}\!d v $$ Similarly, changing the order of integration, we can see that $\frac{\partial}{\partial y}F(x,y)=\int_0^{x}f(u,y)\mathop{}\!d u$. Therefore $$ \nabla F(x,y)=\left(\int_{0}^{y} f(x,v)\mathop{}\!d v,\int_0^{x}f(u,y)\mathop{}\!d u\right) $$

Now if you define the function $g:\mathbb{R}\to \mathbb{R}^2,\, t\mapsto (t,t)$ then $(F\circ g)(t)=F(t,t)$, and from the chain rule we finally get that

$$ (F\circ g)'(t)=\nabla F(g(t))\cdot g'(t)=\int_0^{t}f(t,v)\mathop{}\!d v+\int_0^{t}f(u,t)\mathop{}\!d u $$