Working only in cylindrical coordinates, I want to show that $\triangledown$$\cdot$$r$ = 3.
We are given that $r$ = $\rho$$\hat{e}$$_\rho$+$z$$\hat{e}$$_z$.
This seems to make sense, given that in cartesian coordinates, $\triangledown$$\cdot$$r$ = 3, where $r$ = $x$$\hat{i}$+$y$$\hat{j}$+$z$$\hat{k}$. However, it doesn't seem to work for cylindrical coordinates in this case.
We know that the del operator in cylindrical coordinates is $\triangledown$ = $\frac{\partial }{\partial \rho}$$\hat{e}$$_\rho$+$\frac{1}{\rho}$$\frac{\partial }{\partial \theta}$$\hat{e}$$_\theta$+$\frac{\partial }{\partial z}$$\hat{e}$$_z$.
Then, if we calculate $\triangledown$$\cdot$$r$, we get 2, because the $\hat{e}$$_\rho$ and $\hat{e}$$_z$ terms come out to be one each, and then the $\hat{e}$$_\theta$ terms is zero.
Can anyone spot a mistake in this work? Any help would be appreciated.
UPDATE:
The problem ended up being that I wasn't using the correct divergence equation in curvelinear coordinates. What I should have used is:
$\triangledown$ $\cdot$ $A$ = $\frac{1}{h_1h_2h_3}$[$\frac{\partial}{\partial u_1}$$(A_1h_2h_3)$ + $\frac{\partial}{\partial u_2}$$(A_2h_3h_1)$ + $\frac{\partial}{\partial u_3}$$(A_3h_1h_2)$]
where $h_1,h_2,h_3$ are scale factors.
By using this equation, I end up getting $\triangledown$$\cdot$$r$ = 3, where $r$ = $\rho$$\hat{e}$$_\rho$+$z$$\hat{e}$$_z$