# Divergence theorem

## Homework Statement

Here is a link to the problem:
http://www.brainmass.com/homework-help/physics/electromagnetic-theory/68800

## The Attempt at a Solution

To find the divergence

1/r^2*d(r)*(r^2*r^2*cos(theta))
+[1/r*sin(theta)]*d(theta)*(sin(theta)*r^2*cos(phi))
-[1/r*sin(theta)]*d(phi)*(r^2*cos(theta)*sin(phi))

Which gives

1/r^2*4*r^3*cos(theta)
+[1/r*sin(theta)]*(cos(theta)*r^2*cos(phi))
-[1/r*sin(theta)]*(r^2*cos(theta)*cos(phi))

Is this correct?
Looks correct to this point

Following this i get

=4*r*cos(theta)
What do you mean by "following this"? How did you get that and for what?

which gives me the right answer when i continue on with the question, however i am unsure about my second step... shouldn't i have to differentiate the 1/r*sin(theta) in the second term? And the 1/r^2 in the first? Or does the d(variable) only apply to the expressions written after it? As i guess you can tell, i'm confused and this is probably a really stupid question... Thanks in advance for you help ladies and gents.
It would help if you used parenthes:
div v= (1/r^2)Dr(r2vr)+ (1/r sin theta)Dtheta(sin theta vtheta)+ (1/r sin theta) Dphi(vphi)

Yes, the derivative only applies to the expression immediately following. Usually it is in the derivative symbol or in parentheses to indicate that.

Last edited by a moderator:

Defennder
Homework Helper
I'm a little confused as to the notational convention for $$\phi \ \mbox{and} \ \theta$$. Which one in this question is the azimuthal angle to the xy plane?

Phi is the azimuthal angle

4rcos(theta) came from simplifying the expressions above it, it is the divergence.

And thank you - you answered my question!