Evaluating curl of $\hat{\textbf{r}}$ in cartesian coordinates I am reading book about Classical Mechanics, which states that a spherically symmetric central force is always conservative, and I want to prove it. Spherical symmetry of a function $f$ means that in spherical coordinates the partial derivatives wrt the polar and azimuthal angles are zero:
$$\frac{\partial f}{\partial \phi}=\frac{\partial f}{\partial \theta}=0$$
(I am using the mathematician's convention that $\phi$ is the polar and $\theta$ is the azimuth.)
A central force is just a force of the form $\textbf{F}=f(\textbf{r})\hat{\textbf{r}}$, where $\textbf{r}$ is the position. Thus, a spherically symmetric central force is of the form $\textbf{F}=f(r)\hat{\textbf{r}}$. The task to show this to be conservative, which is the same as showing that the curl vanishes (a result of Stokes' theorem). So the task is:
$\nabla\times f(r)\hat{\textbf{r}}=0$
Now, I can easily evaluate this curl in spherical coordinates without a problem, but I do want to evaluate this in cartesian coordinates just to see that it works, despite the fact that it's probably a bad idea. Anyway, $\hat{\textbf{r}}$ in cartesian coordinates is
$$\hat{\textbf{r}}=\sin(\phi)\cos(\theta)\hat{\textbf{x}}+\sin(\phi)\sin(\theta)\hat{\textbf{y}}+\cos(\phi)\hat{\textbf{z}}$$
For simplicity, I ignore the $f(r)$ factor. The curl is
$$\nabla\times \hat{\textbf{r}}=
\begin{bmatrix}
\frac{\partial \cos(\phi)}{\partial y}-\frac{\partial \sin(\phi)\sin(\theta)}{\partial z}\\
\frac{\partial \sin(\phi)\cos(\theta)}{\partial z}-\frac{\partial \cos(\phi)}{\partial x}\\
\frac{\partial \sin(\phi)\sin(\theta)}{\partial x}-\frac{\partial \sin(\phi)\cos(\theta)}{\partial y}
\end{bmatrix}$$
I thought that I could use the chain rule on $\frac{\partial\cos(\phi)}{\partial y}$ in a perhaps hand-wavy manner:
$$\frac{\partial\cos(\phi)}{\partial y}=\frac{\partial\cos(\phi)}{\partial \phi}\left(\frac{\partial \phi}{\partial y}\right)=\frac{\partial\cos(\phi)}{\partial \phi}\left(\frac{\partial y}{\partial \phi}\right)^{-1}$$
But I tried it on the $x$ coordinate:
$$\frac{\partial \cos(\phi)}{\partial y}-\frac{\partial \sin(\phi)\sin(\theta)}{\partial z}=$$
$$\frac{\partial\cos(\phi)}{\partial \phi}\left(\frac{\partial y}{\partial \phi}\right)^{-1}-\frac{\partial \sin(\phi)}{\partial \phi}\left(\frac{\partial z}{\partial \phi}\right)^{-1}\sin(\theta) -\frac{\partial \sin(\theta)}{\partial \theta}\left(\frac{\partial z}{\partial \theta}\right)^{-1}\sin(\phi)=$$
$$-\sin(\phi)\left(\frac{\partial y}{\partial \phi}\right)^{-1}-\cos(\phi)\left(\frac{\partial z}{\partial \phi}\right)^{-1}\sin(\theta) -\cos(\theta)\left(\frac{\partial z}{\partial \theta}\right)^{-1}\sin(\phi)= (*)$$
We know: $y=r\sin(\phi)\sin(\theta)$, $z=r\cos(\phi)$, so we obtain
$$\frac{\partial z}{\partial \phi}=-r\sin(\phi)\qquad \frac{\partial y}{\partial \phi}=r\cos(\phi)\sin(\theta)$$
$$(*)=-\sin(\phi)\left(r\cos(\phi)\sin(\theta)\right)^{-1}-\cos(\phi)\left(-r\sin(\phi)\right)^{-1}\sin(\theta) -\cos(\theta)\left(-r\sin(\phi)\right)^{-1}\sin(\phi)$$
$$=-\tan(\phi)/r\sin(\theta)+\sin(\theta)/r\tan(\phi) +\cos(\theta)/r$$
$$=\frac{\sin^{2}(\theta)+\cos(\theta)\sin(\theta)\tan(\phi)-\tan(\phi)\sin(\theta)}{r\sin(\theta)\tan(\phi)}$$
$$\neq 0$$
I suspect something went wrong during the application of the chain rule. So how would this curl be evaluated correctly? How does this generalize to the function $f(r)\hat{\textbf{r}}$?
 A: Your mistake is in assuming that $$\dfrac{\partial \phi}{\partial y}= \big(\dfrac{\partial y}{\partial \phi}\big)^{-1}$$
This is not true in general for the following reason:
$$\dfrac{\partial \phi}{\partial y}  \text{  means  } \dfrac{\partial \phi}{\partial y}\Big |_{x=\text{ fixed }, z=\text{ fixed }}$$
In more informal notation this would mean:
$$\dfrac{\partial \phi}{\partial y}  \text{  means  } \dfrac{\partial \phi}{\partial y}\Big |_{rsin\phi cos\theta=\text{ fixed }, rcos\phi=\text{ fixed }}$$
Crucially, when taking the derivative of $\phi$ with respect to $y$ you fix the other independent variables $x$ and $z$ and then take the limit. On the other hand, for
$$\dfrac{\partial y}{\partial \phi} \text{ means } \dfrac{\partial y}{\partial \phi}\Big|_{\theta =\text{ fixed }, r=\text{ fixed }}$$
Here you fix the variables $\theta$ and $r$ and take the limit.  you can see for yourself that taking the inverse of the above expression wouldn't reproduce what you have assumed. And in fact you can calculate it explicitly to confirm this.

However I'm not sure why you're bothering to use the chain rule when you could just write the unit position vector directly in cartesian coordinates:
$$\hat{r}=\dfrac{x\hat{x}+y\hat{y}+z\hat{z}}{(x^2+y^2+z^2)^{\frac{1}{2}}}$$
I'll leave this to you to take its curl since it should be straightforward.
