Hi,everyone,I got a problem here that I don't understand.Can anyone please help me?

The relation between three-dimentional cartesian coordinates $\displaystyle (X,Y,Z)$ and cylindrical coordinates $\displaystyle (\rho,\phi,z)$ is given by

$\displaystyle X=\rho cos\phi$

$\displaystyle Y=\rho sin\phi$

$\displaystyle Z=z$

Calculate the partial derivatives $\displaystyle \frac{\partial \rho}{\partial X}$, $\displaystyle \frac{\partial \phi}{\partial Y}$ and $\displaystyle \frac{\partial z}{\partial Z}$ in terms of $\displaystyle \rho$,$\displaystyle \phi$,$\displaystyle z$.

My current problem here is like a puzzle. I certainly can solve the question and find the answer. For example, I did find $\displaystyle \frac{\partial \rho}{\partial X}=cos\phi$.Same as solution

However, my problem occured when I want to calculate $\displaystyle \frac{\partial X}{\partial \rho}$,if I just use $\displaystyle X=\rho cos\phi$, I would get $\displaystyle cos\phi$ as well!

I think it is weird, because I thought $\displaystyle \frac{\partial X}{\partial \rho}$ supposed to equal to the reciprocal of $\displaystyle \frac{\partial \rho}{\partial X}$, which means it supposed to be $\displaystyle \frac{1}{cos \phi}$.

So pretty sure $\displaystyle \frac{\partial \rho}{\partial X}=cos\phi$ is the right answer(same as solution),but why the recipocal rule does not apply here? I'm so confused about this puzzle. Same as two other questions.