1

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?

Yamato
  • 72

2 Answers2

2

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.

Kurt G.
  • 17,136
  • I have learned that the tansformation rule is $u=u^re_r+u^{\theta}e_{\theta}+u^{z}e_{z}$, where $ e_r=( \cos\theta, \sin \theta, 0), e_{\theta}=(-\sin\theta, \cos\theta, 0)$, which is different from yours, it confused me again.. – Yamato Dec 07 '23 at 02:48
  • Kurt, your “popular notation” seems just wrong. Writing $\mathbf x$ and $\mathbf r$ as their unit vector equivalents is misleading and, IMO, plain wrong. You can’t have $\partial_r$ equal to two completely different things. – Ted Shifrin Dec 07 '23 at 03:52
  • @TedShifrin Wikipedia (which is imho is mostly useful) uses that notation. I find it at least a bad notation for the reason I gave in the second bullet point. I'll put a hat on top of $\boldsymbol{x,r}$ even though I don't think it makes a big difference. – Kurt G. Dec 07 '23 at 06:32
  • Of course it makes a big difference. That’s the standard physics notation for a unit vector. And wiki employs it, according to your link. – Ted Shifrin Dec 07 '23 at 07:22
  • Sorry, I am not sure about what the identity "$e_r=\partial_r$" means, because LHS is a vector in $\mathbb{R}^3$ and RHS is a operator. – Yamato Dec 12 '23 at 15:56
  • @Yamato That identity does not mean that $\partial_r$ is a vector in $\mathbb R^3,.$ It means that $e_r,e_\theta,e_z$ are an ON basis of $\mathbb R^3$ and $\partial_r,\frac1r\partial_\theta,\partial_z$ are an ON basis of a vector space that it isomorphic to $\mathbb R^3,.$ As I tried to advertise in the last sentence of the answer this operator formalism has a lot of advantages and in modern differential geometry it is standard. – Kurt G. Dec 12 '23 at 17:42
0

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.

TurlocTheRed
  • 6,458