x = r\sin\theta\cos\phi \\
y = r\sin\theta\sin\phi \\
z = r\cos\theta \\
\\
r = \sqrt{x^2 + y^2 + z^2} \\
\theta = \cos^{-1}\left(\frac{z}{\sqrt{x^2 + y^2 + z^2}}\right) \\
\phi = \tan^{-1}\left(\frac{y}{x}\right)
\\
\frac{\partial r}{\partial x} = \frac{1}{2\sqrt{x^2 + y^2 + z^2}} \times 2x = \frac{x}{r} = \sin\theta \cos\phi \\\\
\frac{\partial \theta}{\partial x} = \frac{-1}{\sin \theta} \times \frac{-z}{2(\sqrt{x^2 + y^2 + z^2})^3} \times 2x = \frac{zx}{r^3 \sin \theta} = \frac{(r\cos\theta)(r\sin\theta\cos\phi)}{r^3 \sin \theta} = \frac{1}{r} \cos \theta \cos \phi \\\\
\frac{\partial \phi}{\partial x} = \cos^2 \phi \times -\frac{y}{x^2} = -\cos^2 \phi \times \frac{r\sin\theta\sin\phi}{(r\sin\theta\cos\phi)^2} = -\frac{1}{r}\frac{\sin \phi}{\sin \theta} \\\\
\\
\frac{\partial f}{\partial x} = \frac{\partial f}{\partial r}\frac{\partial r}{\partial x} + \frac{\partial f}{\partial \theta}\frac{\partial \theta}{\partial x}+ \frac{\partial f}{\partial \phi}\frac{\partial \phi}{\partial x} = \frac{\partial f}{\partial r}\left(\sin\theta \cos\phi\right) + \frac{\partial f}{\partial \theta}\left(\frac{1}{r} \cos \theta \cos \phi\right)+ \frac{\partial f}{\partial \phi}\left(-\frac{1}{r}\frac{\sin \phi}{\sin \theta}\right)