Inconsistent answers when implicitly differentiating polar identities Currently doing a problem where I need to find $\frac {\partial \theta}{\partial x}$.  However, for $\tan(\theta)= \dfrac yx$, $\frac {\partial\theta}{\partial x}$ is yielding $- \dfrac{\sin(\theta)}{r}$, while for $x= r \cos(\theta)$, $\dfrac {\partial\theta}{\partial x}$ is yielding $\dfrac 1{-r\sin(\theta)}$.  Why aren't these matching/where's my error?  From what I understand, these are both valid ways to convert from Cartesian to polar coordinates.  Work shown below.
$$\tan(\theta)=\frac yx \implies \sec^2(\theta)\dfrac {\partial \theta}{\partial x} = -\frac y{x^2}$$
$$\require{enclose}\implies \frac {\partial \theta}{\partial x} = -\frac {y}{x^2\sec^2(\theta)}=-\frac {y\cos^2(\theta)}{x^2}=-\frac {x\sin(\theta)\cos^2(\theta)}{r^2\cos^2(\theta)} = \enclose{box}{-\frac {\sin(\theta)}{r} = \frac {\partial \theta}{\partial x}}$$
$$x=r\cos(\theta) \implies \frac {\partial x}{\partial x} = 1 = -r\sin(\theta)\frac {\partial \theta}{\partial x} \implies \enclose{box}{\frac {\partial \theta}{\partial x} = -\frac 1{r\sin(\theta)}}$$
 A: Summary:  You can't treat partial derivatives like ordinary derivatives
Long answer:
$$
\frac{\partial \theta}{\partial x} = 
\frac{\partial}{\partial x} \tan^{-1}\left(\frac{y}{x}\right)
$$
Notice that only the independent variables (x and y) are present in $\tan^{-1}\left(\frac{y}{x}\right)$ on the right hand side, so you can go ahead and take partial derivatives, i.e. treat y as a constant in this case.
You have
$$
\frac{\partial \theta}{\partial x} = 
\dfrac{\frac{-y}{x^2}}{1+\frac{y^2}{x^2}} = \frac{-y}{x^2+y^2} = \frac{-\sin\theta}{r}
$$
ETA: If you consider $x=x(r,\theta)$,
$$
x=r\cos\theta \\
\frac{\partial x}{\partial \theta} = -r \sin \theta
$$
But, critically, $\dfrac{\partial \theta}{\partial x} \neq \dfrac{1}{\dfrac{\partial x}{\partial \theta}}$! So you can't conclude that $\dfrac{\partial \theta}{\partial x} = \dfrac{1}{-r \sin \theta}$. 
A: Figured out what I did wrong.  My implicit differentiation of $x= r \cos(\theta)$ was incorrect.
As user_of_math pointed out, $x= x(r, \theta)$.  In other words, x is dependent on not just $\theta$, but $r$ as well.  Thus, r cannot be treated as a constant. So the differentiation would be as follows.
$$x=r\cos(\theta) \implies \frac {\partial x}{\partial x} = 1 = \frac {\partial r}{\partial x} cos(\theta) - r sin\frac {\partial\theta}{\partial x}$$
Now we need $\frac {\partial r}{\partial x}$.  From $x^2 + y^2= r^2$,
$$\frac {\partial}{\partial x} [x^2 + y^2] = \frac {\partial}{\partial x} r^2 \implies 2x= 2r \frac {\partial r} {\partial x} \implies \frac {\partial r} {\partial x} = \frac {x}{r} = cos(\theta)$$
Plug $\frac {\partial x}{\partial r} in$, and one obtains
$$1= cos^2(\theta)- rsin(\theta) \frac {\partial\theta}{\partial x} \implies sin^2(\theta)= -rsin(\theta) \frac {\partial \theta}{\partial x} \implies $$
$$ \frac {\partial \theta}{\partial x}= \frac {-sin(\theta)}{r}$$.
