A question on a integral in radial direction. How can one compute the following integral? 
$$
\frac{\partial}{\partial r}\int_{\partial B(0,r)}f(r,x)dx. 
$$
I know a similar integral
$$
\frac{\partial}{\partial r}\int_{B(0,r)}f(r)dx
=\int_{\partial B(0,r)}f(r)dx+\int_{B(0,r)}\frac{\partial}{\partial r}f(r)dx. 
$$
Maybe I don't fully understand the latter integral either. I would appreciate it if someone could kindly explain what is going on. 
More specifically I want to compute something like
$$
\frac{\partial}{\partial r}\int_{\partial B(0,r)}\frac{f(x)}{r}dx.
$$
 A: In many cases like this, it is best to do a change of variables so that the domain of integration remains invariant. Let me do the specific case, which should illustrate well the basic concepts. 


*

*Given the integral $\int_{\partial B(0,r)} f(x)/r \mathrm{d} x$, the domain of integration is a function of $r$. This makes taking the derivative difficult. So we perform first a change of variables to uniformise the domain of integration. Notice that $\partial B(0,r)$ is $r$ times $\partial B(0,1)$ as a set in $\mathbb{R}^n$. So the change of variable $x = ry$ makes
$$ \int_{\partial B(0,r)} \frac{f(x)}{r} \mathrm{d} x = \int_{\partial B(0,1)} \frac{f(ry)}{r} \mathrm{d}(ry) = \int_{\partial B(0,1)} f(ry)r^{n-2} ~\mathrm{d}y$$
where in the change of variable we treat $r$ as a given constant. (Note that $\partial B(0,r)$ is an $n-1$ dimensional surface, so the Jacobian is $r^{n-1}$ from the change of variables. 

*Now we can take the derivative easily, since the domain of integration is fixed, we can (assuming various regularity properties about $f$) interchange integration and differentiation, and we end up with
$$ \partial_r \int_{\partial B(0,r)} \frac{f(x)}{r} \mathrm{d} x = \int_{\partial B(0,1)} \partial_r [r^{n-2}f(ry)] \mathrm{d}y = \int_{\partial B(0,1)} r^{n-2}y\cdot (\nabla f)(ry) + (n-2)r^{n-3} f(ry) ~\mathrm{d}y $$
using chain rule. 

*If we want, we can change variables back
$$ \int_{\partial B(0,1)} r^{n-2} y\cdot (\nabla f)(ry) + (n-2)r^{n-3} f(ry) ~\mathrm{d}y = \int_{\partial B(0,r)} \frac{x}{r^2} \cdot (\nabla f)(x) + \frac{n-2}{r^2} f(x)~\mathrm{d}x $$
and get the final answer. 


Observe that in the final answer there are two terms: the first term corresponds to how the value of $f$ changes when we move from $\partial B(0,r)$ to the slightly larger $\partial B(0,r+ \Delta r)$; the second term reflects the fact that when we move from $\partial B(0,r) \to \partial B(0,r+\Delta r)$, the sphere becomes bigger and the area element increases. 
