I have a vector field which is originallly written as $$ \mathbf A = \frac{\mu_0~n~I}{2} ~\hat \theta$$ and I translated it like this $$\mathbf A = 0 ~\hat{r},~~ \frac{\mu_0 ~n~I~r}{2} ~\hat{\theta} , ~~0 ~\hat{\phi}$$ ($r$ is the distance from origin, $\theta$ is azimuthal angle and $\phi$ is the polar angle).
I want to calculate its divergence, so I have two options either change it into Cartesian system and then take the curl or take the curl in spherical coordinates. Let’s take the curl in spherical coordinates:
$$(curl~\mathbf A)_r = \frac{1}{r\sin \theta} \frac{\partial (A_{\phi} \sin \theta)}{\theta} -\frac{1}{r\sin \theta} \frac{\partial A_{\theta}}{\partial \theta}$$ I really don't know what is $r$ and that $\sin \theta$ which appearing in the first term above, nevertheless, it is zero as $A_{\phi}$ is zero and even our $A_\theta$ is independent of $\theta$, therefore, whole term above is zero. So, we have $(curl~\mathbf A)_r = 0$.
We have $$(curl~\mathbf A)_{\theta} = \frac{1}{r\sin \theta} \frac{\partial A_r}{\partial \phi} - \frac{1}{r} \frac{\partial ( r A_{\phi} )}{\partial r}$$ I want to repeat that I don't know if those $r$ and $\sin \theta$ are part of my vector field or not, nonetheless, both terms will be zero because $A_r$ and $A_{\phi}$ are zero. Therefore, $(curl~\mathbf A)_{\theta} = 0$.
The last component, $$(curl~\mathbf A)_{\phi}=\frac{1}{r} \frac{\partial (rA_{\theta})}{\partial r} - \frac{1}{r} \frac{\partial A_r}{\partial \theta}$$ I'm just assuming that $r$ which appears in the formula above is same as the one which appears in my vector field. $$(curl~\mathbf A)_{\phi}= \frac{\mu_0 ~n~I}{2r} \frac{\partial r^2}{\partial r}$$ $$ (curl~\mathbf A)_{\phi} = \mu_0~n~I $$ Now, I want to know if I'm correct.
How can convert the above result into cartesian system? Well, I have something like this (if we call curl of $\mathbf A$ as $\mathbf B$ ) $$ \mathbf B( r, \theta, \phi) = \left( 0, 0 , \mu_0 ~n~I \right)$$ we don't have $\phi$ as an angle and all three $x, ~y, ~z$ involve either $sine$ or $cosine$ of $\phi$ and multiplication by $r$ as $$ x=r\sin\phi \cos\theta\\ \hspace{10px} y=r\sin\phi \sin\theta \\ z =r\cos\phi$$ so, in that sense all the cartesian components are zero because $r$ is zero.
Please guide me through it.