Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Divergence theorem - sign of da

  1. Dec 5, 2008 #1
    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.

    [tex]\int_V (\triangledown \cdot \bold{v}) dV = \int_S \bold{v} d\bold{a} [/tex]

    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 [tex]\hat{\bold{\phi}}[/tex] and [tex]\hat{\bold{\theta}}[/tex]. The examples I worked on in the book say something like [tex]d\bold{a} = - dx dy \hat{\bold{z}}[/tex], 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. jcsd
  3. Dec 5, 2008 #2


    User Avatar
    Homework Helper

    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.
  4. Dec 5, 2008 #3
    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 [tex]d\bold{a}[/tex] 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?
  5. Dec 5, 2008 #4


    User Avatar
    Homework Helper

    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:
    [tex]dS = r^2 \sin \theta d\theta d\phi [/tex]
  6. Dec 5, 2008 #5
    Isn't that pretty tedious?

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

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

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

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

    Curved surface, [tex]d\bold{a} = r^2 sin\theta d\theta d\phi \hat{\bold{r}}[/tex]

    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.

    Thanks in advance for your help Defennder
  7. Dec 5, 2008 #6


    User Avatar
    Homework Helper

    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.
  8. Dec 6, 2008 #7


    User Avatar
    Homework Helper

    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.
  9. Dec 6, 2008 #8


    User Avatar
    Homework Helper
    Gold Member

    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 [tex]\hat{\theta}[/tex] 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.
  10. Dec 6, 2008 #9
    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 [tex]\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}}[/tex], 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.
  11. Dec 6, 2008 #10


    User Avatar
    Homework Helper

    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 [tex]\hat{\phi}[/tex] and [tex]\hat{\theta}[/tex] component of the vector function.

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

    Picture: 35a6glk.png

    Regarding your post above:
    There should be a minus sign here because [tex]\hat{\phi}[/tex] points inwards whereas for flux through a closed surface you want to evaluate the dot product of [tex]v_\phi[/tex] with [tex]d\mathbf{a}[/tex] which is in the opposite direction of [tex]\hat{\phi}[/tex].
  12. Dec 6, 2008 #11
    Ok, defennder, I think I got it. And I think I understand what gabba meant by the direction of [tex]\hat{\phi}}[/tex] now. Thanks a lot guys.

    [tex]\hat{\phi}}[/tex] for the x-z plane points inwards. Minus sign.

    [tex]\hat{r}[/tex] for curved surface always points outwards. Plus sign.

    [tex]\hat{\phi}}[/tex] for the y-z plane also points outwards. Plus sign.

    [tex]\hat{\theta}}[/tex] 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 [tex]\triangledown \bold{v}[/tex], are no go in spherical polar coordinates, right?
  13. Dec 6, 2008 #12


    User Avatar
    Homework Helper
    Gold Member

    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 [tex]-\hat{y}[/tex] direction. But you also know that [tex]\hat{y}=\sin\theta\sin\phi\hat{r}+\cos\theta\sin\phi\hat{\theta}+\cos{\phi}\hat{\phi}][/tex] (look inside the back cover of Griffiths). And you know [tex]\phi=0[/tex] for the entire x-z plane, so [tex]\sin\phi=0[/tex] and [tex]\cos\phi=1[/tex] and therfor [tex]-\hat{y}=-\hat{\phi}[/tex] for the x-z plane.

    Sort of; when you move on to chapter 2, you will see an [tex]\widehat{\mathbf{r}-\mathbf{r'}}[/tex] 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 [tex]\int_0^{\pi} \hat{x}\sin\theta d\theta=\hat{x}\int_0^{\pi}\sin\theta d\theta=2\hat{x}[/tex].
  14. Dec 7, 2008 #13
    I got it. There's nothing wrong with taking out the [tex]\hat{x}[/tex] 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.
  15. Dec 7, 2008 #14


    User Avatar
    Homework Helper
    Gold Member

    errm...your reasoning isn't quite correct.

    The reason you can pull [itex]\hat{x}[/itex] out of the integral is beacause its direction is constant over space. Put another way, [itex]\hat{x}[/itex] 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) [itex]\hat{x}[/itex] points in the same direction for both points.

    The same thing is not true of curvilinear unit vectors. If you draw the unit vector [itex]\hat{r}[/itex] for the point (x=1,y=0,z=0) you will see that it points in a different direction from [itex]\hat{r}[/itex] 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.
  16. Dec 7, 2008 #15
    Oops. I see. I think that makes things quite clear now. I have another question, but that's a different topic, will post a new thread later... thanks gabba!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook