Fernando Garcia

Home     Research     Blog     Other     About me


PHYS405 - Electricity & Magnetism I

Spring 2024

Problem 1.54

Check the divergence theorem for the function

v=r2cos(θ)r^+r2cos(ϕ)θ^r2cos(θ)sin(ϕ)ϕ^

Using as your volume one octant of the sphere of radius R. Make sure you include the entire surface.

Answer πR4/4

Let's start by recalling the divergence theorem (also known as The Fundamental Theorem for Divergences):

V(v)dτ=Svda

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 R. Feel free to move around the following 3D render of the octant to get familiar with its geometry.

To begin with the computations, let's take the divergence of v:

v=1r2r(r2vr)+1rsin(θ)θ(sin(θ)vθ)+1rsin(θ)vϕϕ=1r2r(r2r2cos(θ))+1rsin(θ)θ(sin(θ)r2cos(ϕ))+1rsin(θ)ϕ(r2cos(θ)sin(ϕ))=1r2(4r3cos(θ))+1rsin(θ)(r2cos(ϕ)cos(θ))+1rsin(θ)(r2cos(θ)cos(ϕ))=4rcos(θ)+rcot(θ)cos(ϕ)rcot(θ)cos(ϕ)=4rcos(θ)

The volume integral is then (recall that dτ=r2sin(θ)drdθdϕ):

V(v)dτ=ϕ=0π/2θ=0π/2r=0R(4rcos(θ))r2sin(θ)drdθdϕ=πR44

If you are not sure how to do the θ-integral, consider using u-substitution with u=sin(θ), which will turn your integral into udu.

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 da=r2sin(θ)dθdϕr^. Thus this first surface integral has the value:

S1=ϕ=0π/2θ=0π/2v(R2sin(θ)dθdϕr^)=ϕ=0π/2θ=0π/2(R2cos(θ))(R2sin(θ))dθdϕ=ϕ=0π/2θ=0π/2R4cos(θ)sin(θ)dθdϕ=R4ϕ=0π/2θ=0π/2cos(θ)sin(θ)dθdϕ=R412ϕ=0π/2dϕ=R4π4

For the surface on the xy-plane, we have da=rdrdϕθ^, so:

S2=ϕ=0π/2r=0Rv(rdrdϕθ^)=ϕ=0π/2r=0Rr3cos(ϕ)drdϕ=R44

We are left with two surfaces at constant ϕ, one at ϕ=0 and the other at ϕ=π/2. In both cases, we have da=rdrdθϕ^. Let's do the one at ϕ=0 first: S3=θ=0π/2r=0Rv(rdrdθϕ^)=θ=0π/2r=0Rr3cos(θ)sin(0)drdθ=θ=0π/2r=0R0drdθ=0

And the other one:

S4=θ=0π/2r=0Rv(rdrdθϕ^)=θ=0π/2r=0Rr3cos(θ)sin(π/2)drdθ=θ=0π/2r=0Rr3cos(θ)drdθ=R44

Now we can finally write:

Svda=S1+S2+S3+S4=R4π4+R44R44+0=R4π4

Which agrees with the value obtained by integrating the divergence over the octant's volume.


Back to PHYS405 site