Given the vector field $\vec a(r, \theta, \phi) = \frac3r \vec e_r = \frac3r \begin{pmatrix} \cos(\phi) \sin(\theta) \\ \sin(\phi) \sin(\theta) \\ \cos(\theta)\end{pmatrix}$, I have to calculcate the flux through a sphere with radius R.
To do this, I want to apply divergence theorem: $ \int_V\nabla \cdot \vec a = \int_A \vec a \cdot d\vec f $
Applying the right side of the equation above gives me $12\pi R$, but the left side gives me $0$.
$\nabla \cdot \vec a = \frac{3}{r^2}\cos(\phi)\sin(\theta) + \frac{6}{r^2}\sin(\phi)\cos(\theta)$
Thus, if you calculate $\int_0^{2\pi}d\phi$ in the volume integral you receive $0$ since $\int_0^{2\pi} \sin(x) dx= \int_0^{2\pi} \cos(x) dx = 0 $
Where is my mistake?