Why divergence of a vector seems to change when I change the coordinate system

coordinate systemsvectors

I have a vector $\mathbf{u}$ contained in the $(x,y)$ plane, whose components depend only on $z$:

$\mathbf{u}=\bigl(u_x(z),u_y(z),0\bigr) $

for which the divergence calculated in a cartesian coordinate system is

$\nabla \cdot \mathbf{u}=\frac{\partial u_x}{\partial x}+\frac{\partial u_y}{\partial y}+\frac{\partial u_z}{\partial z}=0$

I can always express the same vector in a cylindrical reference system

$\mathbf{u}=\bigl(u_r(z),u_\theta(z),0\bigr)$

But now, if I try to calculate its divergence, I get

$\nabla \cdot \mathbf{u} = \frac{1}{r}\frac{\partial(ru_r) }{\partial r}+\frac{1}{r}\frac{\partial u_\theta }{\partial \theta}+\frac{\partial u_z}{\partial z}=\frac{u_r}{r}$

Since the divergence expresses a property of the vector field, I assumed that it doesn't change value based on the coordinate system that you choose. Then why am I getting this different result? Where am I wrong?

Best Answer

Your conversion of vector field is not correct.

We have $\mathbf{u}= u_1(z) \ \hat x + u_2(z) \ \hat y$ in cartesian coordinates. $u_1$ and $u_2$ are only function of $z$ and not $x, y$. So in cylindrical coordinates, they will again be only function of $z$.

Please note the unit vector conversion from cartesian to cylindrical -

$\hat x = \cos\theta \ \hat r - \sin\theta \ \hat\theta, \hat y = \sin\theta \ \hat r + \cos\theta \ \hat\theta$

So, $\mathbf{u} = (\cos\theta \ \hat r - \sin\theta \ \hat\theta) u_1(z) + (\sin\theta \ \hat r + \cos\theta \ \hat\theta) u_2(z) $

$u_r = u_1(z) \cos\theta+ u_2(z) \sin\theta$

$u_{\theta} = u_2(z) \cos\theta - u_1(z) \sin\theta$

$\displaystyle \small \frac{1}{r} \frac{\partial (r u_r)}{\partial r} + \frac{1}{r} \frac{\partial (u_{\theta})}{\partial \theta} = \frac{1}{r}(u_1(z) \cos\theta + u_2(z) \sin \theta ) + \frac{1}{r} (- u_2(z) \sin\theta - u_1(z) \cos\theta)$

$ = 0$

Related Question