# Divergence theorem on Octant of a sphere

1. Apr 18, 2005

### Reshma

Hi everyone!

I am having some trouble with this particular problem on Vector Calculus from Griffith's book.

The question is: Check the divergence theorem for the vector function(in spherical coordinates)
$$\vec v = r^2\cos\theta\hat r + r^2\cos\phi \hat \theta - r^2\cos\theta\sin\phi\hat \phi$$
using your volume as one octant of the sphere of radius R.

According to the Divergence Theorem:
$$\int_v (\nabla.\vec v)d\tau = \oint_s \vec v.d\vec a$$

Here is how I went about it exclulsively using spherical coordinates:
Part 1: Volume integral
I found the divergence of the given vector field according to spherical coordinates and integrated it over the volume of the octant. I got the answer for the left hand side as $$\frac{\pi R^4}{4}$$ which tallies with the solution provided.

Part 2: Surface integral
Here is where my problem lies. While calculating the volume integral, you are find the volume integral over 4 surfaces of the octant viz. the spherical surface, xy plane, yz plane and xz plane.

For the spherical surface:Radius R is constant
$$d\vec a_1 = r^2\sin\theta d\theta d\phi \hat r$$

For the xy plane: $$\theta$$ is constant
$$d\vec a_2 = rdrd\phi \hat \theta$$

Now I don't have a clue on how to calculate the surface integral for the other two surfaces. Although I get the required answer by calculating the surface integral just over the spherical surface, I still want to know the procedure for the other surfaces since it is specifically mentioned in the question that the surface integral has to calculated over the entire surface.

Any help would be greatly appreciated.

Regards,
Reshma

2. Apr 18, 2005

### HallsofIvy

Staff Emeritus
For the xy-plane, it is NOT θ that is constant, it is $$\phi= \frac{\pi}{2}$$. ρ ranges from 0 to R, of course, and &theta; from 0 to $$\frac{\pi}{2}$$.

On the yz-plane, θ is constant: θ= $$\frac{\pi}{2}$$. ρ varies from 0 to R again and φ from 0 to $$\frac{\pi}{2}$$.

On the xz-plane, θ is constant: θ= 0. ρ varies form 0 to R and φ from 0 to $$\frac{\pi}{2}$$.

3. Apr 18, 2005

### Galileo

For the part of the surface in the xz-plane, $\phi=0$ so the field becomes:

$$\vec v = r^2\cos \theta \hat r +r^2 \hat \theta$$
This field is perpendicular to the normal at the surface (for points in the xz-plane:$\hat r$ and $\hat \theta$ lie in the xz-plane). So the flux through this side is 0.

For the yz-plane this fails and I think this is the place where you have to resort to more cumbersome calculations. My advice is to write everything out in cartesian components. Use:

$$\hat r = \sin \theta \cos \phi \hat x + \sin \theta \sin \phi \hat y +\cos \theta \hat z$$
$$\hat \theta = \cos \theta \cos \phi \hat x + \cos \theta \sin \phi \hat y -\sin \theta \hat z$$
$$\hat \phi = -\sin \phi \hat x +\cos \phi \hat y$$

Write it out and pick out the component pointing in the $-\hat x$ direction.
The difficulty is ofcourse that the spherical unit vector depend on the position as well.

4. Apr 18, 2005

### Galileo

On second thought, for the yz-plane, you can write $d\vec a = rdr d\theta \hat \phi$, that might work better :)

In physics (and Griffiths' EM in particular) the azimuthal angle is commonly taken to be $\phi$ and the declination angle $\theta$. In mathematics it's the other way around.

5. Apr 18, 2005

### jdavel

Reshma,

flux over the:

1) spherical boundary surface: (pi/4)R^4 (your result, I agree)

2) xz plane boundary surface: 0 (Galilleo's result, I agree)

So you need the flux over the:

3) xy plane boundary surface: you found the area element for this; now dot that with v and integrate (it's not hard)

4) yz plane boundary surface: I think you still need to find this area element, then dot with v and integrate.

Hint: Given the results of 1) and 2), you can see that 3) and 4) need to cancel. (They do!)

By the way, nice job showing us the work you already did. You're almost there!

6. Apr 18, 2005

### Theelectricchild

"In physics (and Griffiths' EM in particular) the azimuthal angle is commonly taken to be and the declination angle . In mathematics it's the other way around."

I always hated that--- even in EE they reverse it from math--- but I first learned it with the azimuthal angle to be phi...

7. Apr 18, 2005

### Galileo

When working in two dimensions and polar coordinates, the angle is always taken to be $\theta$, even in physics. So why change it when going to 3D? I remember it took me an hour once to figure out what was wrong with my calculation after getting a nutty answer. It's definitely not the kind of error you would think of soon (well, for me it is now).

8. Apr 18, 2005

### dextercioby

I've learnt it and used it in one way only.

polar plane

$$\rho,\varphi$$

cylindrical

$$\rho,\varphi,z$$

spherical

$$r,\varphi,\vartheta$$

Daniel.
[tex]

9. Apr 19, 2005

### Reshma

Thanks for the help everyone! I think I got the answers. BTW, can someone provide me with some links on line integrals, volume and surface integrals. I'm trying to solve the problems given at the end of Chapter 1 in Griffith's books and I'm finding them tougher than I expected, thanks to the limited resources I have. I would be very grateful if you folks can point out to me some resources which can help me solve Griffith's problems.

10. Apr 19, 2005