How to Derivate Divergence in Cylindrical Coordinates?

103 Views Asked by At

I am trying to derivate divergence in cylindrical coordinates, following is my derivation which is wrong and different from text book. I am confused why the derivation is wrong.

Denote $\nabla_x=(\partial_{x_1},\partial_{x_2},\partial_{x_3}) $ , $\nabla=(\partial_{r},\partial_{\theta},\partial_{z}) $, $u(x_1,x_2,x_3)=(u_1(x_1,x_2,x_3),u_2(x_1,x_2,x_3),u_3(x_1,x_2,x_3))=u^re_r+u^{\theta}e_{\theta}+u^ze_z$ is a vector field, where $(x_1, x_2, x_3)$ is the Cartesian coordinates and $(r, \theta, z)$ is cylindrical coordinates. The gradient operator can be written as follows $$\nabla_x =(\cos(\theta)\cdot\partial_r-r^{-1}\sin(\theta)\cdot\partial_{\theta}, \sin(\theta)\cdot\partial_r+r^{-1}\cos(\theta)\cdot\partial_{\theta},\partial_z)$$ and $u$ can be written as $$u=(\cos(\theta)u^r+\sin(\theta)u^{\theta}, -\sin(\theta)u^r+\cos(\theta)u^{\theta},u^z)$$ Thus, we make dot product of them and only need to observe the coefficient of $\partial_r u^r$ we will know this derivation is wrong: $$\nabla_x\cdot u=[\cos^2(\theta)-\sin^2(\theta)]\partial_r u^r+....$$ but why?

2

There are 2 best solutions below

6
On BEST ANSWER

The correct transformation rules are: \begin{align} \partial_x&=\cos\theta\,\partial_r-\tfrac1r\sin\theta\,\partial_\theta\,,\\[2mm] \partial_y&=\sin\theta\,\partial_r+\tfrac1r\cos\theta\,\partial_\theta\,,\\[2mm] u^x&=\cos\theta\,u^r-r\sin\theta\,u^\theta\,,\\[2mm] u^y&=\sin\theta\,u^r+r\cos\theta\,u^\theta\,. \end{align} You should take them and check that the vector field is coordinate independent: $$ u^x\partial_x+u^y\partial_y+u^z\partial_z=u^r\partial_r+u^\theta\partial_\theta+u^z\partial_z\,. $$ Then, \begin{align}\require{cancel} \partial_xu^x&=\big(\cos\theta\,\partial_r-\tfrac1r\sin\theta\,\partial_\theta\big)\big(\cos\theta\,u^r-r\sin\theta\,u^\theta\big)\\ &=\cos^2\partial_ru^r-\cancel{\cos\theta\sin\theta\,u^\theta}+\tfrac1r\sin^2\theta\, u^r-\bcancel{\tfrac1r\sin\theta\cos\theta\,\partial_\theta u^r}+\cancel{\sin\theta\cos\theta\,u^\theta}\\&\quad+\sin^2\theta\,\partial_\theta\,u^\theta\,,\\[2mm] \partial_yu^y&=\big(\sin\theta\,\partial_r+\tfrac1r\cos\theta\,\partial_\theta\big)\big(\sin\theta\,u^r+r\cos\theta\,u^\theta\big)\\[2mm] &=\sin^2\theta\,\partial_ru^r+\cancel{\sin\theta\cos\theta\,u^\theta}+\tfrac1r\cos^2\theta\, u^r+\bcancel{\tfrac1r\cos\theta\sin\theta\,\partial_\theta u^r}-\cancel{\cos\theta\sin\theta\,u^\theta}\\&\quad+\cos^2\theta\,\partial_\theta u^\theta\,. \end{align} The divergence is therefore \begin{align} \partial_xu^x+\partial_yu^y+\partial_zu^z&=\partial_ru^r+\tfrac1ru^r+\partial_\theta u^\theta+\partial_zu^z\,. \end{align} It is a popular convention to use the orthonormal basis $\{\partial_r,\tfrac1r\partial_\theta,\partial_z\}$ instead of the coordinate basis $\{\partial_r,\partial_\theta,\partial_z\}\,.$ In the orthonormal basis the vector field has obviously the $\theta$-component $u_{on}^\theta=ru^\theta$ while the other two do not change. The divergence can then be written as $$ \partial_xu^x+\partial_yu^y+\partial_zu^z=\tfrac1r\partial_r(ru^r)+\tfrac1r\partial_\theta u_{on}^\theta+\partial_zu^z\,. $$ To address your comment: Popular notations for the normalized basis vector fields are \begin{align} \boldsymbol{\hat{x}}&=\boldsymbol{e}_x=\partial_x\,,&\boldsymbol{\hat{y}}&=\boldsymbol{e}_y=\partial_y\,,\\ \boldsymbol{\hat{r}}&=\boldsymbol{e}_r=\partial_r\,,&\boldsymbol{\hat{\theta}}&=\boldsymbol{e}_\theta=\tfrac1r\partial_\theta\,,\\ \end{align} (let's ignore the trivial $z$-coordinate). When you invert my first two transformation rules you get in this notation \begin{align} \boldsymbol{e}_r&=\cos\theta\,\boldsymbol{e}_x+\sin\theta\,\boldsymbol{e}_y\,,\\ \boldsymbol{e}_\theta&=-\sin\theta\,\boldsymbol{e}_x+\cos\theta\,\boldsymbol{e}_y\,. \end{align} In components this is exactly what you have learned.

My advice:

  • Know if you are using normalized or unnormalized basis vector fields.

  • Try the partial derivatives notation and the unnormalized coordinate basis $\{\partial_r,\partial_\theta\}$ because you will be able to derive every coordinate transformation rule simply from the chain rule without remembering anything.

0
On

I know a couple ways of doing this.

$\vec{ds}=dr\hat{r} + rd\theta \hat{\theta} + dz \hat{k}$

$df = \nabla f \cdot \vec{ds}=\frac{\partial f}{\partial r}dr+\frac{\partial f}{\partial \theta}d\theta + \frac{\partial f}{\partial z}dz\implies \nabla f = \frac{\partial f}{\partial r}\hat{r} + \frac{1}{r}\frac{\partial f}{\partial \theta}\hat{\theta}+\frac{\partial f}{\partial z} \hat{z}$

$\implies \nabla r = \hat r, \nabla \theta = \frac{1}{r}\hat{\theta}, \nabla z = \hat{z}$

$\vec{E} = E_r\hat{r}+E_\theta \hat \theta + E_z\hat{z}=E_r \nabla r + rE_\theta\hat{\theta}+E_z\nabla z$

$\nabla \cdot (f \vec{B})=\nabla f \cdot \vec{B} +f (\nabla \cdot \vec{B})$

Main Base Form: $\nabla \cdot \vec{E} = \nabla(E_r) \cdot \hat{r} +E_r(\nabla \cdot \hat{r})+\nabla E_\theta \cdot \hat{\theta} + E_\theta (\nabla \cdot \hat{\theta}) + \nabla E_z \cdot \hat{z} + E_z (\nabla \cdot \hat{z})$

$\nabla \cdot \vec{E} = \frac{\partial E_r}{\partial r}+E_r(\nabla \cdot \hat{r}) + \frac{1}{r}\frac{\partial E_\theta}{\partial \theta}+E_\theta(\nabla \cdot \hat{\theta}) + \frac{\partial E_z}{\partial z}+E_z(\nabla \cdot \hat{z})$

Since $\hat{z}$ is a constant vector, $\nabla \cdot \hat{z}=0$.

By definition $\nabla \cdot \hat {r}= \lim_{\Delta V \to 0} \frac{\int \int 1 \cdot rd\theta dz}{\int\int\int rdrd\theta dz}= \frac{1}{r}\frac{\partial}{\partial r}(1\cdot r)=1/r$

$\nabla \cdot \hat{\theta} = \frac{\int \int 1 \cdot dr dz}{\int\int\int rdrd\theta dz}=\frac{1}{r}\frac{\partial }{\partial \theta}(1)=0$

So $\nabla \cdot \vec{E} = \frac{\partial E_r}{\partial r}+\frac{E_r}{r} + \frac{1}{r}\frac{\partial E_\theta}{\partial \theta}+ \frac{\partial E_z}{\partial z}$

Alternatively, the $\lim_{\Delta V \to 0}$ integrals could have been used for the full vector and not just the unit vectors, but its somewhat tedious and mistake prone.

The alternative I provided also readily leads to a curl:

What I refer to as Main Base Form above is essentially the same argument for curls only with cross products instead of dot products. Then there's the vector identity $\nabla \times \nabla f =0$

Main Base Form (curl): $\nabla \times \vec{E} = \nabla(E_r) \times \hat{r} +E_r(\nabla \times \hat{r})+\nabla E_\theta \times \hat{\theta} + E_\theta (\nabla \times \hat{\theta}) + \nabla E_z \times \hat{z} + E_z (\nabla \times \hat{z})$

So $\nabla \times \vec{E} = \nabla E_r \times \nabla r + E_r(\nabla \times \nabla r)+ \nabla E_\theta\times (r\nabla \theta)+E_\theta(\nabla \times (r\nabla \theta))+\nabla E_z \times \hat{z}+E_z(\nabla \times \nabla z) $

$\implies \nabla \times \vec{E} = \nabla E_r \times \nabla r + r \nabla E_\theta \times \nabla \theta + E_\theta \nabla r \times \nabla \theta+ \nabla E_z \times \hat{z}$

But $\nabla r \times \nabla \theta = \hat {r} \times \frac{\hat{\theta}}{r}=\frac{\hat {z}}{r}$

So $\nabla \times \vec{E} = \nabla E_r \times \nabla r + r \nabla E_\theta \times \nabla \theta + \frac{E_\theta \hat{z}}{r}+ \nabla E_z \times \hat{z}$

Most of these lines are just derivation and proof. The Main Base Form is intuitive and memorizing the divergence of the unit vectors fill in the blanks and are easy to memorize since only 1 is non-zero. The curl is even easier.

There is an integral definition of curl often used to derive it. It requires six integral expressions and I always mess up their signs.