I'm running into some troubles with the integration of a spherically symmetric 3D function. I'm having the following expression to evaluate : $ I=\int_0^{2\pi} d\phi \int_0^\pi \sin\theta d\theta\int_0^\infty \frac{\partial f}{\partial r} r^2 dr $
where the generic function $f$ only depends on the radius $r$. If I where in Cartesian coordinates, there wouldn't be any $r^2$ term and the integral would be 0 provided that $f$ vanishes at infinity (which is ok).
Now, in spherical coordinates, this does not seem to be true. If I integrate first over the angles, I get a factor $4\pi$ in front of the radial integral. I can then integrate by parts to remove the partial derivative and I obtain : $ I=-8\pi\int_0^\infty f(r)r dr $ as the boundary terms vanish if $f(r) \rightarrow 0$.
At first sight, this seems to be correct. However, when looking at the definition of integration by parts in $R^n$:
$ \int_{\Omega} \frac{\partial u}{\partial x_i} v \,d\Omega = \int_{\Gamma} u v \, \nu_i \,d\Gamma - \int_{\Omega} u \frac{\partial v}{\partial x_i} \, d\Omega $
Where $\nu_i$ is a unit vector on $\Gamma$ the boundary of $\Omega$. My previous computation does not seem to be right. The $r^2$ term is part of the integration measure $d\Omega$ and should thus not be taken into account for the "derivative-swap". This would mean that my first integral is $0$ for all functions $f$ that behave nicely and vanish sufficiently fast as $\rightarrow\infty$. $ I= \left| f(r) r^2 \right|_{r=0}^{r=\infty} = 0 $
Which (if any) of the two version is correct ?
Do you know any good reference on integration by parts in non-cartesian coordinates.