# Partial derivative in spherical coordinates

1. Oct 12, 2011

### jonathanpun

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?

Last edited: Oct 12, 2011
2. Oct 12, 2011

### mathman

∂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.

3. Oct 12, 2011

### HallsofIvy

You mean "for constant y and z" don't you?

4. Oct 13, 2011

### mathman

Correct - my typo.