# Mysterious Factor of 2 in Divergence Theorem

1. Mar 7, 2006

### Living_Dog

Let $$\vec{v} = r^{2} \hat{r}$$. Show that the divergence theorm is correct using $$0 <= r <= R , 0 <= \theta <= \pi , and 0 <= \phi <= 2\pi$$.

$$\int \nabla \cdot \vec{v} d \tau = \int \vec{v} \cdot d \vec{a}$$

First the divergence of $$\vec{v}$$.

$$\nabla \cdot \vec{v} = 2r$$.

Then the volume integral:
$$\int \int \int (2r) r^{2}sin \theta dr d\theta d\phi = 2 \int r^{3} dr \int sin \theta d\theta \int d\phi = 2 \cdot \frac{1}{4} r^{4} \left|^{R}_{0} \cdot 2 \cdot 2 \pi = 2 \pi R^{4}$$.

Ok, fine. But now do the area integral on the right. Since it is over the surface only, then $$r = R$$ and the integral is only over $$\theta$$ and $$\phi$$.

$$\int \vec{v} \cdot d\vec{a} = \int r^{2}\left|_{r=R} \cdot R^2 \int sin \theta d \theta \int d \phi = R^{4} \cdot 2 \cdot 2 \pi$$

And the last time I checked, $$2 \pi R^{4} \not= 4 \pi R^{4}$$

Please help since I am going nuts with this minute detail! :surprised

-LD

Last edited: Mar 7, 2006
2. Mar 7, 2006

### neutrino

Are you sure about that?

3. Mar 7, 2006

### Living_Dog

Factor of 2 won't go away!

Well, I thought the problem was that $$\nabla \cdot \vec{v}$$ was not a simple derivative. But after thinking about it a while I think it is. So I am "sure" that $$\nabla \cdot \vec{v} = 2r$$.

Here's my reasoning: $$\nabla = \hat{r} \partial_r + \theta$$ and $$\phi$$ terms. However, $$\vec{v}$$ only has the $$\hat{r}$$ component. I.e. $$v_\theta$$ and $$v_\phi$$ are both 0 (zero).

So when you take the dot product you obtain: $$\partial_r (r^{2})$$ which most definitely equals 2r.

...or show me where I'm wrong.

-LD

Last edited: Mar 7, 2006
4. Mar 8, 2006

### neutrino

Well, the expression for the radial component of divergence in spherical coordinates is
$$\frac{1}{r^2} \frac{\partial (r^2 v_r)}{\partial r}$$

Last edited: Mar 8, 2006
5. Mar 8, 2006

### arildno

Living-Dog:
Your understanding of polar coordinate description is rather shaky, in particular when it comes to differntiating a vector properly.
Remember that the unit vectors in a polar coordinate system are dependent upon the variables; therefore, in order to differentiate correctly, you must, in essence, also differentiate the unit vectors themselves, in addition to differentiating the vector components.

Let's rewrite your velocity field in Cartesian coordinates, and calculate the divergence first by means of this:
$$\hat{r}=\frac{x}{r}\hat{x}+\frac{y}{r}\hat{y}+\frac{z}{r}\hat{z}, r=\sqrt{x^{2}+y^{2}+z^{2}}$$
$$\vec{v}=r^{2}\hat{r}=r(x\hat{x}+y\hat{y}+z\hat{z})$$
$$\nabla\cdot\vec{v}=\frac{\partial(xr)}{\partial{x}}+\frac{\partial(yr)}{\partial{y}}+\frac{\partial(zr)}{\partial{z}}=r+\frac{x^{2}}{r}+r+\frac{y^{2}}{r}+r+\frac{z^{2}}{r}=4r$$

Note that this is in accordance with neutrino's answer, and that this is where the mysterious factor of 2 comes in..

Last edited: Mar 8, 2006
6. Mar 8, 2006

### Living_Dog

As arildno so accurately described my understanding of polar coordinates, the spherical coordinate del is still a mystery to me.

Sorry and thanks for your patience.

-LD

Last edited: Mar 8, 2006
7. Mar 8, 2006

### Living_Dog

Good point. I am going to study polar coordinates before I move on. I copied and pasted your reply to my notes. Thanks! :)

-LD

8. Mar 8, 2006

### Living_Dog

Problem 1.38 part (b)

I have thought about this part for a while and after making 2 separate attempts (one using the polar coordinates and one using rectangular coordinates) I am stuck for the solution. I keep getting 0 (zero) and I know that is incorrect. The surface integral yields the correct answer, $$4 \pi$$.

$$\int_V \nabla \cdot \vec{v}_2 d\tau$$

where $$\vec{v}_2 = \frac{1}{r^2} \hat{r}$$.

As neutrino pointed out, the r-component of del is:
$$\frac{1}{r^2} \frac{\partial (r^2 v_r)}{\partial r}$$.

First the polar coordinate method:

$$\frac{1}{r^2} \frac{\partial (r^2 \cdot \frac{1}{r^2})}{\partial r} = \frac{1}{r^2} \cdot \frac{\partial (1)}{\partial r} = 0$$.

Next the rectangular coordinate method:

$$\vec{v_2} = \frac{\hat{r}}{r^2}$$,

which in rectangular coordinates is:

$$\vec{v_2} = \frac{sin \theta cos \phi \hat{x} + sin \theta sin \phi \hat{y} + cos \theta \hat{z}}{x^2 + y^2 + z^2}$$.

But

$$\begin{array} {c} sin \theta cos \phi = \frac{x}{r} \\ sin \theta sin \phi = \frac{y}{r} \\ cos \theta = \frac{z}{r} \\ \end{array}$$

Putting all the pieces together and taking the rectangular coordinate divergence yields:

$$\nabla \cdot \vec{v_2} = \frac{\partial}{\partial x} (\frac{x}{r^3}) + \frac{\partial}{\partial y} (\frac{y}{r^3}) + \frac{\partial}{\partial z} (\frac{z}{r^3}) = \frac{1}{r^3} - \frac{3x^2}{r^5} + \frac{1}{r^3} - \frac{3y^2}{r^5} + \frac{1}{r^3} - \frac{3z^2}{r^5} = \frac{3}{r^3} - \frac{3(x^2 + y^2 + z^2)}{r^5} = \frac{3}{r^3} - \frac{3r^2}{r^5} = \frac{3}{r^3} - \frac{3}{r^3} = 0$$.

HELP!

Last edited: Mar 8, 2006
9. Mar 9, 2006

### arildno

You have calculated correctly.
Remember that there is a singularity at the origin.
Hence, strictly speaking, the volume integral doesn't exist, and the divergence theorem isn't violated.

10. Mar 9, 2006

### Living_Dog

thx! :)

Yes, $$\lim_{r->0} \frac {1}{r^2} -> \infty$$.

Say what?!?

That seems contradictory to me. How can it be that:
1. the lhs of the div theorem doesn't exist ($$\int_V d\tau$$ doesn't exist)
2. the rhs yields a value of $$4\pi$$
3. the div theorem is still not violated?!?

I just re-read Griffith's question. He doesn't say we should prove the divergence theorem but rather that we compare our answer to problem 1.16. Problem 1.16 is the same as #1.38(b) except he said that the answer should surprise us and then asked "...can you explain it?"

Besides my questions above, it seems to me that the divergence of a singularity is 0 (zero) because the singularity looks like a flat empty space?!? This is too weird.

"Onward through the fog!"
-LD

Last edited: Mar 9, 2006
11. Mar 9, 2006

### arildno

No, you've misunderstood.
The divergence theorem is derived under the asumption that the divergence of the function is DEFINED at all points within the volume.

Since the function v2 is not defined at the origin, neither is any of its derivatives defined there.
Hence, the underlying assumption behind the divergence theorem is not fulfilled, and therefore, it is in principle no reason why the theorem should hold for this case.

It should be mentioned, though, that since the value of the surface integral is independent of the size&shape of the region enclosing the origin, we are entitled to define the divergence of v2 as:
$$\nabla\cdot\vec{v}_{2}=4\pi\delta$$
where $\delta$ denotes Dirac's delta "function".
By the properties of the delta "function", we have, indeed:
$$\int_{V}4\pi\delta{dV}=4\pi$$
where V is a volume enclosing the origin.

Last edited: Mar 9, 2006
12. Mar 9, 2006

### Living_Dog

Excellent! I don't think Griffith mentions this requirement in the chapter. But that's ok, I got it now. :) Also, the next section after this one is the Dirac Delta function.

---

BTW, I did Prob. 1.39 with similar errors. The divergence and the volume integral went easily. But then I did the surface integral and the answer didn't agree.

I re-did the divergence and the volume integral and then checked the surface integral again. Still nothing. Then I said I must be doing something wrong and realized that I was only taking the top spherical part of the volume (it's a bowl on the xy-plane with the "open" end down).

So happily I did the 2nd surface integral and expected the sum to give the correct result.

But before I rushed off to do this second (flat) surface I realized that d$$\vec{a}$$ is different for this surface than it is for the spherical top portion. Correct! ... except I was getting a minus sign somewhere...

After some thinking I decided to check the definition of $$\hat{z}$$ and sure enough, since the unit normal vector for this surface was -$$\hat{z}$$, and -$$\hat{z} = -cos\theta\hat{r} + sin \theta\hat{\theta}$$ I realized my last mistake and added the last portion to the first to get the correct answer!

-LD (aka "Learning_Dog" :)

Last edited: Mar 9, 2006
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook