Let $x = r \cos \theta$ and $y = r \sin \theta$, where $r > 0$. Therefore, $$r^2 = x^2 + y^2$$ which implies $$2r \frac{\partial r}{\partial x} = 2x,$$ and so $$\frac{\partial r}{\partial x} = \frac{x}{r} = \cos \theta.$$
But $x = r \cos \theta$ implies $\frac{\partial x}{\partial r} = \cos \theta$.
Thus we see that in general, $$\frac{\partial x}{\partial r} \neq \frac{1}{(\frac{\partial r}{\partial x})}$$.
Is there any calculation mistake ? When is the relation $$\frac{\partial x}{\partial r} = \frac{1}{(\frac{\partial r}{\partial x})}$$ valid?
Any help would be greatly appreciated. Thanks in advance !
Partial derivatives are only well-defined once you specify what is held constant. For example, your first result is $(\frac{\partial r}{\partial x})_y=\frac{x}{r}$, where the subscript denotes holding $y$ constant. The next result you mention is $(\frac{\partial x}{\partial r})_\theta=\frac{x}{r}$. Because a constant $\theta$ is a different convention for defining partial derivatives, you can't multiply them in the obvious way. I discuss a similar but more complicated example of this phenomenon here.