Check the divergence theorem for the function
Using as your volume one octant of the sphere of radius
Answer
Let's start by recalling the divergence theorem (also known as The Fundamental Theorem for Divergences):
In other words, if we want to integrate the divergence of a field over a volume, we could equally compute the (closed) surface integral of the field, where the closed surface is the surface that encloses the aforementioned volume.
We will integrate over an octant of a sphere of radius
To begin with the computations, let's take the divergence of
The volume integral is then (recall that
If you are not sure how to do the
Now, we have 4 surfaces to take care of to compute the surface integral.
Let's start by the surface at a constant radius (blue surface in the 3D render above). For it, we have that
For the surface on the
We are left with two surfaces at constant
And the other one:
Now we can finally write:
Which agrees with the value obtained by integrating the divergence over the octant's volume.