# Applying Leibniz Rule

I found the following problem on a comprehensive exam:

Let $f : \mathbb{R}^2 \to \mathbb{R}$ be a continuous function and consider the function $F: \mathbb{R}^2 \to \mathbb{R}$ given by $$F(x,y) = \int_{D_{x,y}} f(u,v)\,du\,dv, \qquad D_{x,y} = \left\{(u,v) \in \mathbb{R}^2 \,\middle|\, u^2 + v^2 \leq x^2 + y^2 \right\}$$

Is $F(x,y)$ differentiable? If yes, find the differential $DF$.

To me, it seems that this is a straight forward application of Leibniz Rule, but I've never applied it in such a setting:

Treating $y$ as a constant, we can describe F(x,y) (somewhat inelegantly) as $$\int_{h_1(x)}^{h_2(x)} \int_{g_1(x,v)}^{g_2(x,v)} f\,du\,dv$$ where $h_1,h_2$ are differentiable. Then if we let $$G(v) = \int_{g_1(x,v)}^{g_2(x,v)} f\,du\,dv$$ We get $\frac{d}{dx}F(x,y) = G(h_2(x)h_2'(x) - G(h_1(x))h_1'(x)$. Does this seem correct? This does not seem like a very adequate answer.

I'd like to ask for some more insight into problems of this form, verification for if the my attempt had any validity, and a more complete answer if possible.

Thanks.

Let $r(x,y):=\sqrt{x^2+y^2}$ and $$h(r):=\int_{D_r}f(u,v)\>{\rm d}(u,v)=\int_0^r \int_0^{2\pi}f(\rho\cos\phi,\rho\sin\phi)\>\rho\>d\phi\>d\rho\ .\tag{1}$$ Then $$F=h\circ r\ .$$ It follows that $$F_x=h'(r)r_x,\quad F_y=h'(r)r_y\ .$$ From $(1)$ we deduce $$h'(r)=r\,\int_0^{2\pi}f(r\cos\phi,r\sin\phi)\>d\phi\ ,$$ and $$r_x={x\over r},\quad r_y={y\over r}\ .$$ It follows that $$\nabla f(x,y)=(F_x,F_y)=(x,y)\ \int_0^{2\pi}f\bigl(\sqrt{x^2+y^2}\cos\phi,\sqrt{x^2+y^2}\sin\phi\bigr)\>d\phi\ .$$

I think we can get something explicit using polar coordinates. Let $\hat{f}(\rho,\theta):=f(\rho\cos\theta,\rho\sin\theta)$ and $\hat{F}(\rho,\theta):=F(\rho\cos\theta,\rho\sin\theta)$. We will calculate the gradient of $\hat{F}$ in terms of $\hat{f}$. We have:

$$\hat{F}(\rho,\theta)=\int_{B_\rho(0)} f=\int_0^\rho\int_0^{2\pi}\hat{f}(r,\phi) r\,\,d\phi dr = \int_0^\rho r\int_0^{2\pi}\hat{f}(r,\phi) \,\,d\phi dr .$$

Now since $g(r):=r\int_0^{2\pi}\hat{f}(r,\phi)\,d\phi$ in continuous by hypothesis, we have:

$$\frac {1}{h}(\hat{F}(\rho+h,\theta)-\hat{F}(\rho,\theta))= \frac {1}{h} \int_\rho^{\rho+h} r\int_0^{2\pi}\hat{f}(r,\phi) \,\,d\phi dr \longrightarrow\rho\int_0^{2\pi}\hat{f}(\rho,\phi) \,\,d\phi \qquad h\to0.$$

Hence $\frac{\partial\hat{F}}{\partial\rho}(\rho,\theta)=\rho\int_0^{2\pi}\hat{f}(\rho,\phi) \,\,d\phi$. Moreover we observe that $\hat{F}(\rho,\theta_1)=\hat{F}(\rho,\theta_2)$ for all $\theta_1,\theta_2$, then $\frac{\partial\hat{F}}{\partial\theta}(\rho,\theta)=0$. Now we can go back to cartesian coordinates using that $F(x,y)=\hat{F}(\sqrt{x^2+y^2},\theta(x,y))$ for some function $\theta(x,y)$. Hence:

\begin{align}\frac{\partial F}{\partial x}(x,y) &= \frac{\partial\hat{F}}{\partial\rho} \bigg(\sqrt{x^2+y^2},\theta(x,y)\bigg)\frac{\partial \rho(x,y)}{\partial x}(x,y)+ \frac{\partial\hat{F}}{\partial\theta} \bigg(\sqrt{x^2+y^2},\theta(x,y)\bigg)\frac{\partial \theta(x,y)}{\partial x}(x,y)=\\&= \frac{\partial\hat{F}}{\partial\rho} \bigg(\sqrt{x^2+y^2},\theta(x,y)\bigg)\frac{\partial \rho(x,y)}{\partial x}(x,y)=\\&=x\int_0^{2\pi}\hat{f}(\sqrt{x^2+y^2},\phi)\,d\phi, \end{align}

and analogously:

$$\frac{\partial F}{\partial y}(x,y) =y\int_0^{2\pi}\hat{f}(\sqrt{x^2+y^2},\phi)\,d\phi.$$