# Easy question about divergence in cylindrical coordinates

1. Nov 12, 2007

### EricVT

Consider a cylindrical shell so that the cross sectional radius is some constant a.

In the first term of the divergence expression in cylindrical coordinates:

$$\frac{1}{r}\frac{\partial}{\partial r}(rA_{r})$$

When I multiply the radial component by r, do I go ahead and substitute r=a before I take the derivative with respect to r or do I substitute r=a after I take the derivative with respect to r?

Thanks a lot.

2. Nov 12, 2007

### EricVT

Well for example, I have the A_r component of my vector:

$$A_{r}=Pcos\theta$$

And r=a is constant.

So if I do the divergence by multiplying A_r by r and then taking the derivative with respect to r, I get that that the first term is:

$$\frac{1}{r}\frac{\partial}{\partial r}(rA_{r}) = \frac{1}{r}\frac{\partial}{\partial r}(rPcos\theta) = \frac{Pcos\theta}{r}$$

And then evaluate at r=a.

However, if I put in r=a before taking the derivative then I get:

$$\frac{1}{r}\frac{\partial}{\partial r}(rA_{r}) = \frac{1}{r}\frac{\partial}{\partial r}(aPcos\theta) = 0$$

Which way is correct?

3. Nov 12, 2007

### dynamicsolo

I was backing and forthing on this and finally deleted my post because I was second-guessing things. I believe the correct thing to do is to differentiate first and then evaluate at r = a . If you set r = a first, you set certain terms constant which will seem to have zero derivative, but don't in fact. Seeing your example satisfied me as to this point. So I'm reasonably sure your first result is the correct one.