= Solution
Write $r=|\mathbf r|$ and $q=\mathbf p\cdot\mathbf r$. Away from the origin, $\nabla q=\mathbf p$ and $\nabla r^{-m}=-m\mathbf r/r^{m+2}$. The <product rule> gives
$$
\nabla\cdot(q\mathbf r r^{-5})=q r^{-5}+q(3r^{-5}-5r^{-5})=-q r^{-5},\qquad \nabla\cdot(\mathbf p r^{-3})=-3q r^{-5}.
$$
Consequently the <divergence> of $\mathbf E=3q\mathbf r r^{-5}-\mathbf p r^{-3}$ is zero. For any closed surface bounding a region that excludes the origin, the field is smooth throughout that region, and the <divergence theorem> proves
$$
\boxed{\int_A\mathbf E\cdot d\mathbf S=0.}
$$
For the infinite cylinder, use $\mathbf r=(a\cos\phi,a\sin\phi,z)$ and outward <unit normal> $(\cos\phi,\sin\phi,0)$. With $\mathbf p=(0,0,1)$, $q=z$, $dS=a\,d\phi\,dz$, and $\mathbf E\cdot\mathbf n=3az/(a^2+z^2)^{5/2}$. Hence the direct <surface flux> is
$$
\int_0^{2\pi}\int_{-\infty}^\infty\frac{3a^2z}{(a^2+z^2)^{5/2}}dz\,d\phi=\boxed0.
$$
The integrand is <odd> in $z$ and absolutely integrable. This calculation treats the unbounded cylindrical side directly, without applying the bounded-region <divergence theorem> across the field's singularity.
Back to article page