Derivative of area integral w.r.t. parameter (Stokes' theorem?) Let
$$g\left(p\right) = \iint_{R\left(p\right)} f\left(x\right)dA,$$
where $f$ is some continuous function on $\mathbb{R}^d$, and $R\left(p\right)$ is some subset of $\mathbb{R}^d$ parameterized by $p$. To give some examples, we could have $R\left(p\right) = \left\{x:\|x\|\leq p\right\}$, or perhaps an ellipse $\left\{x:x^\top B x\leq p\right\}$, or a parameter that can be changed to translate the shape (like moving the unit sphere in some direction), etc., but the problem is not restricted to these examples; however, we can assume that $R$ changes "smoothly" with $p$. Note that the function $f$ being integrated has no dependence on $p$. The parameter only affects the set over which $f$ is being integrated.
I would like to understand $\frac{dg}{dp}$. It seems like this should be related to Stokes' theorem or similar results, because if I change $p$ to $p+\Delta p$, most of the $x$ values in $R\left(p\right)$ will continue to be in the modified set; the change will only occur for $x$ around the boundary. So, the "net" change in $g$ should be some sort of integral over the boundary of $f$ combined with the "direction" in which the boundary is moving. But I am a bit lost as to how to formalize this -- the usual formulations of Stokes' theorem, Green's theorem etc. use a different setting. Would appreciate any pointers.
 A: Your choice of letter $p$ as the independent variable is a bit confusing and very non-standard. Let's use $t$ (thinking of the regions $R(t)$ varying with time). The most common situation, I think, is that the regions are evolving by flow by a vector field $F$ on $\Bbb R^n$. (I'm also going to switch that dimension to $n$, since there will be lots of derivatives with the letter $d$.) In that case, if $\phi_t(x)$ is the time $t$ flow, then $R(t) = \phi_t(R_0)$, with $R_0=R(0)$. Let's set $\omega = f(x)dx_1\wedge\dots\wedge dx_n$. We can use to change of variables theorem to write
$$g(t) = \int_{R(t)} \omega = \int_{\phi_t(R_0)} \omega = \int_{R_0} \phi_t^*\omega.$$
Now, differentiating under the integral sign,
$$g'(T) = \frac d{dt}\Big|_{t=T} \int_{R_0} \phi_t^*\omega = \int_{R_0} \frac {\partial}{\partial t}\Big|_{t=T} \phi_t^*\omega.$$
This derivative at $x\in R_0$ is nothing but the Lie derivative $\mathscr L_F\omega$ evaluated at $\phi_T(x)$.
But we can do it bare-hands here. I'm going to start by assuming that $T=0$.
$$\phi_t^*\omega = (\phi_t^*f) \phi_t^*(dx_1\wedge\dots\wedge dx_n) = 
(f\circ\phi_t)\ d(\phi_t)_1)\wedge\dots\wedge d(\phi_t)_n).$$
Now a few observations. First, $\phi_0(x)=x$ and $\frac d{dt}\phi_t = F\circ\phi_t$ by the definition of flow. Next, since smoothness tells us that $\dfrac{\partial^2\phi_t}{\partial t\partial x_i} = \dfrac{\partial^2\phi_t}{\partial x_i\partial t}$, we see that $\frac{\partial}{\partial t} (d\phi_t) = d(\frac d{dt}\phi_t) = dF\circ\phi_t$. We also need to observe that
$$\frac d{dt}\Big|_{t=0}(f\circ\phi_t)(x) = D_{F(x)} f = df(F(x)).$$
Since we're computing the derivative at $t=0$, the product rule will give
\begin{align*}
\frac d{dt}\Big|_{t=0} \phi^*\omega &= df(F) dx_1\wedge\dots\wedge dx_n + f(dF_1\wedge dx_2\wedge\dots\wedge dx_n + \dots + dx_1\wedge\dots\wedge dx_{n-1}\wedge dF_n) \\
&= \big(df(F) + f\,\text{div}\,F\big)dx_1\wedge\dots\wedge dx_n \\
&= \text{div}\,(fF)\,dx_1\wedge\dots\wedge dx_n
\end{align*}
Thus, by the Divergence Theorem, $g'(0)$ is the flux of $fF$ across the boundary of $R_0$. Starting the flow at time $t=T$ and using $\phi_{t+T}=\phi_t\circ\phi_T$, we now immediately deduce that the comparable formula holds at $t=T$, obtaining now the flux across the boundary of $R(t)$.
If one recognizes the definition of Lie derivative, one can apply the famous Cartan formula
$$\mathscr L_F\omega = \iota_F d\omega + d(\iota_F\omega).$$
In our case, $\omega$ is an $n$-form and so automatically $d\omega = 0$. We then apply Stokes's Theorem to get
$$\mathscr L_F\int_{R_0}\omega = \int_{R_0} \mathscr L_F\omega = \int_{R_0} d(\iota_F\omega) = \int_{\partial R_0} \iota_F\omega,$$
and this is precisely the flux we arrived at ultimately.
