Why does $\frac{\partial x}{\partial r} = \frac{\partial r}{\partial x}$ in this Jacobian matrix converting from Cartesian to polar coordinates? My question comes from Strang's Linear Algebra and its Applications 4e, problem 4.4.39 (p. 257):

I don't understand his claim that $\frac{\partial x}{\partial r} = \frac{\partial r}{\partial x}$. It follows from the conversion to polar coordinates that if $r = \frac{x}{\cos\theta}$, then $\frac{\partial r}{\partial x} = \frac{1}{\cos \theta} = \sec \theta$, right?
I can fake my way into the right answer by just inverting the second matrix in problem 37, but I don't think that's the point of the exercise.
 A: When you partially differentiate with respect to $x,y$ is kept constant, not $r,\theta$ since they are both function of $x,y$.
To find $\frac{\partial r}{\partial x}$ you need $r$ as a function of $x,y$, which will make the differentiation easier since $y$ will be held constant.$$r^2=x^2+y^2\implies2r\frac{\partial r}{\partial x}=2x$$giving $\frac{\partial r}{\partial x}=\frac xr=\cos\theta$.
When you partially differentiate with respect to $r,\theta$ is kept constant, not $x,y$ since they are both function of $r,\theta$.
To find $\frac{\partial x}{\partial r}$ you need $x$ as a function of $r,\theta$, which will make the differentiation easier since $\theta$ will be held constant.$$x=r\cos\theta\implies\frac{\partial x}{\partial r}=\cos\theta$$
A: $x =r\cos \theta$ and $r =\sqrt {x^{2}+y^{2}}$. Hence $\frac {\partial r}{\partial x}=\frac 1 2 (x^{2}+y^{2})^{-1/2} (2x)=\frac x {\sqrt {x^{2}+y^{2}}}=\frac {r\cos \theta} r=\cos \theta$. Also, $\frac {\partial x}{\partial r}=\cos \theta$ from the first equation above. Hence $\frac {\partial r}{\partial x}=\frac {\partial x}{\partial r}$.
A: You’ve made a fairly common mistake: when converting to polar coordinates, $\theta$ is also a dependent variable, i.e., it’s also a function of $x$ and $y$, so you can’t treat $\cos\theta$ as a constant when differentiating with respect to $x$. With that in mind, we can bash this derivative out directly: $$\begin{align} {\partial r\over\partial x} &= {\cos\theta + x\sin\theta{\partial\theta\over\partial x} \over \cos^2\theta} \\
&= \sec\theta\left(1+x\tan\theta{\partial\theta\over\partial x}\right) \\
&= \sec\theta\left(1-{xy\over x^2+y^2}\tan\theta\right) \\
&= \sec\theta\left(1-\cos\theta\sin\theta\tan\theta\right) \\
&= \sec\theta\left(1-\sin^2\theta\right) \\
&= \cos\theta. \end{align}$$ 
It’s much less work, though, to use the Inverse Function Theorem by inverting the Jacobian matrix, as in problem 39. That’s not “faking your way into the right answer.”
