Approximating the volume integral by a surface integral via the divergence theorem