# Homework Help: Divergence theorem - sign of da

1. Dec 5, 2008

### bigevil

1. The problem statement, all variables and given/known data

This is just a general question. My fundamentals aren't very solid because I'm studying on my own at the moment.

$$\int_V (\triangledown \cdot \bold{v}) dV = \int_S \bold{v} d\bold{a}$$

I am trying to find out the sign of the area integral on a surface defined by spherical polar coordinates. What I learned from my current text is that for Cartesian coordinates it is easy to find out the sign by tracing the outward direction of the surface. For instance, for the base of a cube on the x-y axis, da is in the negative z-direction.

But what about for spherical polar coordinates? For instance, a quarter sphere defined by radius r, polar angle (theta) 0 to π/2 and azimuthal angle (phi) 0 to π/2. This gives us a curved area and two plane surfaces, one in the x-y axis, one in the y-z axis and one in the x-z axis. Which of these then are positive and negative?

2. After some thought

I was thinking why not just define the polarity as I would in Cartesian coordinates.Then the x-z and x-y ones would be negative, the rest positive. But I'm not sure if I'm on the right track here. Surely you'd imagine that my book would have something to say about that if it was really the case.

Another way I am thinking about is why not define it along the $$\hat{\bold{\phi}}$$ and $$\hat{\bold{\theta}}$$. The examples I worked on in the book say something like $$d\bold{a} = - dx dy \hat{\bold{z}}$$, which tacks onto the directions of the coordinate axes. But surely it is too much trouble to deduce the direction of the individual vectors.

Last edited: Dec 5, 2008
2. Dec 5, 2008

### Defennder

I'm kind of confused as to what your actual question is. Are you asking which of the two possible directions is the outward normal vector for a surface element dS of a closed surface? If so, then it is evident that if it is a closed surface, the outward normal vector is the one which points from the inside of the closed surface to the outside.

3. Dec 5, 2008

### bigevil

Not really.

Say I have a quarter sphere defined by radius r, polar angle (theta) 0 to π/2 and azimuthal angle (phi) 0 to π/2. And I would like to evaluate $$d\bold{a}$$ for its four surfaces in terms of Cartesian coordinates.

I could tell you what the outward normal vectors are and which direction they point in terms of the Cartesian axes. But what about in spherical coordinates?

4. Dec 5, 2008

### Defennder

In this case you'll want to work with both Cartesian and spherical coordinates. Use cartesian coordinates to evaluate the flux through the flat surfaces, and spherical coordinates for the curved surface.

For the flux through the curved surface you'll need the expression for a differential surface element of a spherical surface:
$$dS = r^2 \sin \theta d\theta d\phi$$

5. Dec 5, 2008

### bigevil

Isn't that pretty tedious?

I'll work that example out to show you what I mean.

Plane surface along the y-z axis: $$d\bold{a} = r dr d\theta \hat{\bold{\phi}}, \phi = \pi / 2$$

Plane surface along the x-z axis: $$d\bold{a} = r dr d\theta \hat{\bold{\phi}}, \phi = 0$$

Plane surface along the x-y axis: $$d\bold{a} = r sin\theta dr d\phi \hat{\bold{\theta}}, \theta = \pi / 2$$

Curved surface, $$d\bold{a} = r^2 sin\theta d\theta d\phi \hat{\bold{r}}$$

I have some problem with the plane surfaces, namely, is the *sign* correct? (The r vector is radial and normal, therefore, positive by convention. Right?) I've worked a few of these problems out. I have no problem with the integrals for the individual surfaces. They do add up and tally with the volume integrals *if* the signs are right. And the problem is that more often than not I get the sign wrong. Hopefully there's a simpler solution than having to convert to Cartesian.

6. Dec 5, 2008

### Defennder

How is that tedious? The flat surfaces should only be expressed in terms of Cartesian coordinates, so why are you using spherical coordinates? Doing so only makes things difficult for yourself. On the other hand, the spherical curved surface should be represented only in terms of spherical coordinates so as to exploit the mathematical simplicity due to symmetry. Once you evaluate the flux for each individual component, just sum all of them up.

The normal vector for the curved surface appears correct. I didn't check those for the plane surfaces, because I believe it's a lot easier if you used the Cartesian coordinate system to evaluate those. Be flexible; don't stick to only one coordinate system or you'll run into a lot of problems when you encounter certain geometrical problems.

7. Dec 6, 2008

### Defennder

I'm posting your PM here because it's against PF policy to address homework type questions by PM:
Hi, it'll help if you post the question as well. Because the scanned page doesn't say what the question is, in particular I don't know what the vector function v is supposed to be.

8. Dec 6, 2008

### gabbagabbahey

There's nothing wrong with using spherical coordinates for evaluating the integrals for the planar surfaces on your quarter-sphere. In fact, I would argue that in this case the integration is easier in spherical coord's since part of the boundary of the flat surfaces is a quarter circle centered at the origin.

However, one thing you need to take heed of is that in general the spherical unit vectors are position dependent and cannot be treated as constants when integrating (over space). Luckily, in this case your integrand will be a scalar (the dot product of two vectors is a scalar; and likewise for the divergence of a vector).

One way to determine the correct sign for your da is to note that $$\hat{\theta}$$ points in the direction of increasing theta. So, for which of your flat surfaces does the normal point in the direction of increasing theta?

Another foolproof method is to decompose your spherical unit vector in terms of Cartesian unit vectors (the correct decompositions are easy to find in any vector calc text) and plug in your values of theta or phi for that surface.

9. Dec 6, 2008

### bigevil

Well, defennder, I sent you solutions by PM exactly because I thought homework solutions from textbooks shouldn't be posted on PF. Anyway the solutions are dime a dozen, I just don't understand them.

The question is, check the divergence theorem for $$\bold{v} = r^2 cos \theta \bold{\hat{r}} + r^2 cos \phi \bold{\hat{\theta}} - r^2 cos \theta sin\phi \bold{\hat{\phi}}$$, using as your volume one octant of the sphere of radius R, which runs from 0 to R, 0 to π/2 for the polar angle theta, and 0 to π/2 for azimuth phi.

Question diagram: http://i37.tinypic.com/35a6glk.png

------------

gabbagabbahey, thanks for that. I'm still stuck though –*what does it mean to point in the direction of increasing "theta"? If, say, I take the "direction" to be parallel to the z-axis, then none of them are. The normal of the "base" of the surface, in the x-y plane, points in the negative z-axis. I'm not sure about the other two plane surfaces.

One thing that occurred to me was that the "signs" that appeared in the solutions were assigned in the same way as they would be if the question was in Cartesian coordinates, meaning that those plane normal vectors pointing parallel to the negative x/y/z axes have "negative" sign. But I'm not sure if that is the "right" way.

10. Dec 6, 2008

### Defennder

Yeah, in this case evaluating the flux through the planar surfaces is easier in spherical coordinates than in Cartesian coordinates (something which I somehow failed to see earlier on), since at the planar surfaces, the only vector component of the field involved is the $$\hat{\phi}$$ and $$\hat{\theta}$$ component of the vector function.

So your vector field here is $$\mathbf{v} = r^2 \cos \theta \ \hat{r} + r^2 \cos \phi \ \hat{\theta} - r^2 \cos \theta \sin \phi \ \hat{\phi}$$.

Picture:

There should be a minus sign here because $$\hat{\phi}$$ points inwards whereas for flux through a closed surface you want to evaluate the dot product of $$v_\phi$$ with $$d\mathbf{a}$$ which is in the opposite direction of $$\hat{\phi}$$.

11. Dec 6, 2008

### bigevil

Ok, defennder, I think I got it. And I think I understand what gabba meant by the direction of $$\hat{\phi}}$$ now. Thanks a lot guys.

$$\hat{\phi}}$$ for the x-z plane points inwards. Minus sign.

$$\hat{r}$$ for curved surface always points outwards. Plus sign.

$$\hat{\phi}}$$ for the y-z plane also points outwards. Plus sign.

$$\hat{\theta}}$$ for the x-y plane points outwards. Plus sign.

-------------

All right. So basically I will be fine with spherical polar coordinates when taking divergences and Laplacians, but any operations on v that give vectors, like curl and gradient $$\triangledown \bold{v}$$, are no go in spherical polar coordinates, right?

12. Dec 6, 2008

### gabbagabbahey

Another way to see this (mathematically) is to start by writing the outward Normal in Cartesian coordinates. Clearly, for the x-z plane that normal should point in the $$-\hat{y}$$ direction. But you also know that $$\hat{y}=\sin\theta\sin\phi\hat{r}+\cos\theta\sin\phi\hat{\theta}+\cos{\phi}\hat{\phi}]$$ (look inside the back cover of Griffiths). And you know $$\phi=0$$ for the entire x-z plane, so $$\sin\phi=0$$ and $$\cos\phi=1$$ and therfor $$-\hat{y}=-\hat{\phi}$$ for the x-z plane.

Sort of; when you move on to chapter 2, you will see an $$\widehat{\mathbf{r}-\mathbf{r'}}$$ inside the integrand in Coulomb's law (Griffith's writes it as a script 'r'). You will find that you will have to decompose this vector into Cartesian unit vectors in order to integrate properly.

However, just because you need to express the unit vectors in Cartesan, doesn't mean you cant use r,theta and phi for your integration variables (In fact, in many cases this is exactly what you will want to do).

For example, there is nothing wrong with integrating $$\int_0^{\pi} \hat{x}\sin\theta d\theta=\hat{x}\int_0^{\pi}\sin\theta d\theta=2\hat{x}$$.

13. Dec 7, 2008

### bigevil

I got it. There's nothing wrong with taking out the $$\hat{x}$$ because its magnitude is a constant, right? Whereas the spherical polar coordinate unit vectors are mutually orthonormal but are also dependent on one another, hence not constants.

Thanks guys.

14. Dec 7, 2008

### gabbagabbahey

The reason you can pull $\hat{x}$ out of the integral is beacause its direction is constant over space. Put another way, $\hat{x}$ points in the same direction whether your at the point (1,2,3) or (0,0,8). if you draw a diagram with those two points on it, you will see that (not surprisingly) $\hat{x}$ points in the same direction for both points.
The same thing is not true of curvilinear unit vectors. If you draw the unit vector $\hat{r}$ for the point (x=1,y=0,z=0) you will see that it points in a different direction from $\hat{r}$ for the point (0,1,0). That is, the spherical unit vectors are position dependent. This is why you cannot treat them as constant when integrating over space.