How to calculate $∇(r^2/(2z(1+a/z^2)))$ in cylindrical coordinates How to calculate $$∇\bigg(\frac{(ρ^2)}{2z(1+\frac{a}{z^2})}\bigg)$$ where the function is in cylindrical coordinates $$ρ^2=x^2+z^2$$
$$∇\bigg(\frac{x^2+z^2}{2z(1+\frac{a}{z^2})}\bigg)$$
Is the answer in Cartesian coordinates a vector
$$[x/(z(1+a/z^2))),y/(z(1+a/z^2))),1/((a-z^2)/(a+z^2)^2)]$$
In cylindrical coordinates a vector ?
$$[ρ/(z(1+a/z^2))),0,1/((a-z^2)/(a+z^2)^2)]$$

You need the gradient operator for cylindrical coordinates, e.g. see here.
$$
\nabla f = 
\frac{\partial f}{\partial \rho} e_\rho + 
\frac{1}{\rho}\frac{\partial f}{\partial \varphi} e_\varphi + 
\frac{\partial f}{\partial z} e_z
$$
and apply it to
$$
f(\rho, \phi, z) = \frac{\rho^2}{2z \left( 1 + \frac{a}{z^2} \right)}
$$
so
\begin{align}
\nabla f = 
\frac{\rho}{z \left( 1 + \frac{a}{z^2} \right)} e_\rho -
\frac{\rho^2}{\left( 2z \left( 1 + \frac{a}{z^2} \right) \right)^2} 
\left( \left( 1 + \frac{a}{z^2} \right)
- z \left(2\frac{a}{z^3} \right) \right) e_z \\
= 
\frac{\rho}{z \left( 1 + \frac{a}{z^2} \right)} e_\rho -
\rho^2 \frac{1 - \frac{a}{z^2}}{\left( 2z \left( 1 + \frac{a}{z^2} \right) \right)^2} e_z \\
\end{align}
In Cartesian coordinates it would be
$$
\nabla f = 
(\partial_x, \partial_y, \partial_z) f(x,y,z) =
(\partial_x, \partial_y, \partial_z) 
\frac{x^2 + y^2}{2z \left( 1 + \frac{a}{z^2} \right)}
$$
