Wrong computation of divergence in cylindrical coordinates. Where is my error? The divergence of a vector field $X$ in $\mathbb{R}^3$ in Cartesian coordinates is given by
$$
\operatorname{div}X:=\frac{\partial X_x}{\partial x}+\frac{\partial X_y}{\partial y}+\frac{\partial X_z}{\partial z}\tag1
$$
where $X=X_x\frac{\partial}{\partial x}+X_y\frac{\partial}{\partial y}+X_z\frac{\partial}{\partial z}$. Let the change to cylindrical coordinates given by $(x,y,z)=(r\cos \alpha ,r\sin \alpha ,z)$  then I want to find the equivalent expression (1) using cylindrical coordinates. In cylindrical coordinates we have that $X=X_r\frac{\partial}{\partial r}+X_\alpha \frac{\partial}{\partial \alpha }+X_z\frac{\partial}{\partial z}$, therefore
$$
\begin{align*}
X_x&=X_r\frac{\partial x}{\partial r}+X_\alpha \frac{\partial x}{\partial \alpha }
=\cos \alpha X_r-r\sin \alpha X_\alpha \tag2\\[1em]
X_y&=X_r\frac{\partial y}{\partial r}+X_\alpha \frac{\partial y}{\partial \alpha }
=\sin \alpha X_r+r\cos \alpha  X_\alpha\tag3\\[1em]
\therefore\quad &\begin{bmatrix}
\cos \alpha & -r\sin \alpha \\ \sin \alpha & r\cos \alpha
\end{bmatrix}\begin{bmatrix}
X_r\\X_\alpha
\end{bmatrix}=\begin{bmatrix}
X_x\\X_y
\end{bmatrix}
\implies \begin{bmatrix}
\cos \alpha & \sin \alpha \\-\frac1{r}\sin \alpha &\frac1{r}\cos \alpha 
\end{bmatrix}\begin{bmatrix}
X_x\\X_y
\end{bmatrix}=\begin{bmatrix}
X_r\\X_\alpha 
\end{bmatrix}\tag4
\end{align*}
$$
In particular we find that
$$
\begin{align*}
\frac{\partial}{\partial x}=\cos \alpha \frac{\partial}{\partial r}-\frac1{r}\sin \alpha \frac{\partial}{\partial \alpha }\tag5\\
\frac{\partial}{\partial y}=\sin \alpha \frac{\partial}{\partial r}+\frac1{r}\cos \alpha \frac{\partial}{\partial \alpha }\tag6
\end{align*}
$$
Then
$$
\frac{\partial X_x}{\partial x}=\left(\cos \alpha \frac{\partial}{\partial r}-\frac1{r}\sin \alpha \frac{\partial}{\partial \alpha }\right)\left(\cos \alpha X_r  -r\sin \alpha X_\alpha \right)\\
=\cos ^2\alpha \frac{\partial X_r}{\partial r}-\cos \alpha \sin \alpha \left(X_\alpha +r\frac{\partial X_\alpha }{\partial r}+\frac1{r}\frac{\partial X_r}{\partial \alpha }\right)+\frac1{r}\sin ^2\alpha X_r\\
+\sin ^2\alpha \frac{\partial X_\alpha }{\partial \alpha }+\sin \alpha \cos \alpha X_\alpha\tag7
$$
and
$$
\frac{\partial X_y}{\partial y}=\left(\sin \alpha \frac{\partial}{\partial r}+\frac1{r}\cos \alpha \frac{\partial}{\partial \alpha }\right)\left(\sin \alpha X_r  +r\cos \alpha X_\alpha \right)\\
=\sin ^2 \alpha \frac{\partial X_r}{\partial r}+\cos \alpha \sin \alpha \left(X_\alpha +r\frac{\partial X_\alpha }{\partial r}+\frac1{r}\frac{\partial X_r}{\partial \alpha }\right)+\frac1{r}\cos ^2 \alpha X_r\\
+\cos ^2 \alpha\frac{\partial X_\alpha }{\partial \alpha } -\sin \alpha \cos \alpha X_\alpha\tag8
$$
Then finally we find that
$$
\frac{\partial X_x}{\partial x}+\frac{\partial X_\alpha }{\partial \alpha }=\frac{\partial X_r}{\partial r}+\frac{\partial X_\alpha }{\partial \alpha }+\frac1{r}X_r=\frac1{r}\frac{\partial}{\partial r}(rX_r)+\frac{\partial X_\alpha }{\partial \alpha }\tag9
$$
However the expected answer gives $\frac1{r}\frac{\partial X_\alpha }{\partial \alpha }$ instead of just $\frac{\partial X_\alpha }{\partial \alpha }$. I checked the previous calculations various times and I dont see any error, can someone enlighten what is wrong in the previous computation? Thank you in advance.
P.S.: I know how to find the correct answer using different ways to compute the above, but I want to know what is wrong in the above computation.
 A: The factor of $\frac{1}{r}$ is always problematic when going from vector calculus to differential geometry (and if one uses Wikipedia as a source), because in vector calculus/basic E&M courses, one always uses normalized vector field as the basis:
\begin{align}
\mathbf{e}_i:=\frac{\frac{\partial}{\partial x^i}}{\sqrt{g_{ii}}},
\end{align}
where $g$ is the (standard) metric tensor field on $\Bbb{R}^3$ and $g_{ij}=g(\frac{\partial}{\partial x^i},\frac{\partial}{\partial x^j})$ (no sum; we're simply taking a vector and dividing by its norm). In this case, given a vector field $X$, one expands it as
\begin{align}
X=\sum_{i=1}^n\xi^i\mathbf{e}_i
\end{align}
What you've done is write it as
\begin{align}
X&=\sum_{i=1}^nX^i\frac{\partial}{\partial x^i}
\end{align}
These are of course equivalent expressions; if we change the basis, the coefficients  change. For cylindrical coordinates, $g_{rr}=1, g_{\alpha\alpha}=r^2,=g_{zz}=1$, so  the relationship is that
\begin{align}
\begin{cases}
X^r&=\xi^r\\\\
X^{\alpha}&=\frac{1}{r}\xi^{\alpha}\\\\
X^z&=\xi^z
\end{cases}
\end{align}
Thus,
\begin{align}
\text{div}(X)&=\frac{1}{r}\frac{\partial}{\partial r}(r X^r)+\frac{\partial X^{\alpha}}{\partial \alpha}+\frac{\partial X^z}{\partial z}\\
&= \frac{1}{r}\frac{\partial}{\partial r}(r \xi^r)+\frac{1}{r}\frac{\partial \xi^{\alpha}}{\partial \alpha}+\frac{\partial \xi^z}{\partial z},
\end{align}
which is exactly what one finds in Wikipedia. You may want to see Calculate gradient in polar coordinates using exterior derivative, where OP had a similar issue, but with the gradient.
