## Partial derivative in spherical coordinates

I am facing some problem about derivatives in spherical coordinates

in spherical coordinates:
x=r sinθ cos$\phi$
y=r sinθ sin$\phi$
z=r cosθ

and
r=$\sqrt{x^{2}+y^{2}+z^{2}}$
θ=tan$^{-1}$$\frac{\sqrt{x^{2}+y{2}}}{z}$
$\phi$=tan$^{-1}$$\frac{y}{x}$

$\frac{\partial x}{\partial r}$=sinθ cos$\phi$
then $\frac{\partial r}{\partial x}$=$\frac{1}{sinθ cos \phi }$

but if i calculate directly from r:
$\frac{\partial r}{\partial x} = \frac{x}{\sqrt{x^{2}+y^{2}+z^{2}}}$
substitute:
=$\frac{r sinθ cos \phi }{r}$
= sinθ cos$\phi$

Why do the results are different? what i did wrong?

not this case is the second case? but why the inverse still not true?
 PhysOrg.com science news on PhysOrg.com >> 'Whodunnit' of Irish potato famine solved>> The mammoth's lament: Study shows how cosmic impact sparked devastating climate change>> Curiosity Mars rover drills second rock target
 Recognitions: Science Advisor ∂r/∂x is defined for constant x and y. ∂x/∂r is defined for constant θ and φ. There is no reason that they should be reciprocal.

Recognitions:
Gold Member
Staff Emeritus
 Quote by mathman ∂r/∂x is defined for constant x and y.
You mean "for constant y and z" don't you?

 ∂x/∂r is defined for constant θ and φ. There is no reason that they should be reciprocal.

Recognitions: