TITLE: How to compute a Jacobian using polar coordinates?
QUESTION [7 upvotes]: Consider the transformation $F$ of $\mathbb R^2\setminus\{(0,0)\}$ onto itself defined as
$$
F(x, y):=\left( \frac{x}{x^2+y^2}, \frac{y}{x^2+y^2}\right).$$
Its Jacobian matrix is 
$$\tag{1}
\begin{bmatrix} \frac{y^2-x^2}{(x^2+y^2)^2} & -\frac{2xy}{(x^2+y^2)^2} \\ -\frac{2xy}{(x^2+y^2)^2} & \frac{x^2-y^2}{(x^2+y^2)^2} \end{bmatrix},\quad \text{and its determinant equals}\ \frac{-1}{(x^2+y^2)^2}.$$
The following alternative computation is wrong at (!) and (!!), and I cannot see why. 

Let $\phi\colon (0, \infty)\times (-\pi, \pi)\to \mathbb R^2$ be the map $$\phi(r, \theta) =(r\cos \theta, r\sin \theta).$$ Let moreover $$\tag{2}\tilde{F}:=\phi^{-1}\circ F\circ \phi;$$ then, by an easy direct computation, $$\tilde{F}(r, \theta)=\left( \frac1r, \theta\right).$$The Jacobian matrix of $\tilde{F}$ is, thus, $$\tag{!}\begin{bmatrix} \frac{-1}{r^2} & 0 \\ 0 & 1\end{bmatrix} , \quad \text{and its determinant equals }\ \frac{-1}{r^2}.$$On the other hand, by (2) and by the chain rule, the Jacobian determinants of $F$ and $\tilde{F}$ are equal. We conclude that the Jacobian determinant of $F$ is $$\tag{!!} \frac{-1}{r^2}=\frac{-1}{x^2+y^2}.$$

The result (!!) is off by a factor of $r^{-2}$ from the correct one, which is given in (1). Equation (!) must also be wrong. Indeed, computing the Jacobian matrix from (2) using the chain rule, and using that 
$$
D\phi = \begin{bmatrix} \cos \theta & \sin \theta \\ 
-r\sin \theta & r\cos \theta\end{bmatrix}$$ 
and that 
$$\tag{!!!}
D(\phi^{-1})= \begin{bmatrix} \frac{x}{\sqrt{x^2+y^2}} &  \frac{y}{\sqrt{x^2+y^2}} \\ -\frac{y}{x^2+y^2} & \frac{x}{x^2+y^2}\end{bmatrix},$$
I obtain the result
$$
\begin{bmatrix} \frac{x}{\sqrt{x^2+y^2}} &  \frac{y}{\sqrt{x^2+y^2}} \\ -\frac{y}{x^2+y^2} & \frac{x}{x^2+y^2}\end{bmatrix} \begin{bmatrix} \frac{y^2-x^2}{(x^2+y^2)^2} & -\frac{2xy}{(x^2+y^2)^2} \\ -\frac{2xy}{(x^2+y^2)^2} & \frac{x^2-y^2}{(x^2+y^2)^2} \end{bmatrix}\begin{bmatrix} \cos\theta & -r\sin\theta \\ \sin \theta & r\cos \theta\end{bmatrix} = \begin{bmatrix} -\frac1{r^2} & 0 \\ 0 & \frac{1}{r^2}\end{bmatrix},$$
which is different from the matrix in (!), and which gives the correct determinant of $-1/r^4$, as it should be.

Can you help me spot the mistake?


SOLUTION (added at a later time). As answerers pointed out, there is a mistake in (!!!). The correct matrix to be used is 
$$ D(\phi^{-1})|_{F\circ \phi(r, \theta)} 
= \begin{bmatrix} \frac{\frac{x}{x^2 + y^2}}{\sqrt{\left(\frac{x}{x^2 + y^2} \right)^2+\left( \frac{y}{x^2 + y^2}\right)^2}} &  \frac{\frac{y}{x^2 + y^2}}{\sqrt{\left(\frac{x}{x^2 + y^2} \right)^2+\left( \frac{y}{x^2 + y^2}\right)^2}}  \\ -\frac{\frac{y}{x^2 + y^2}}{\left(\frac{x}{x^2 + y^2} \right)^2+\left( \frac{y}{x^2 + y^2}\right)^2}  & \frac{\frac{x}{x^2 + y^2}}{\left(\frac{x}{x^2 + y^2} \right)^2+\left( \frac{y}{x^2 + y^2}\right)^2}\end{bmatrix}  = \begin{bmatrix}\cos\theta & \sin \theta \\ - r\sin \theta & r\cos\theta \end{bmatrix}.$$
Had I used this matrix, I would have found the correct result for the Jacobian matrix of $\tilde{F}$, which is the equation marked (!). Thus, (!) is actually correct.
My fundamental misunderstanding was the assumption that, because of (2), the Jacobian determinant should be invariant for coordinate changes. This is not true; what follows from (2) is only that 
$$
\det D\tilde{F}|_{(r, \theta)}= \det D\phi^{-1}|_{F\circ\phi(r, \theta)}\det D\phi|_{(r, \theta)} \det DF|_{\phi(r, \theta)}.
$$ 
The first two factors in the right-hand side need not cancel, as I erroneously thought.

REPLY [5 votes]: The Jacobians of the two functions aren't equal by the chain rule. 
In actual fact, $D(\phi(\frac{1}{r}, \cos\theta)) × D\tilde{F}(r, \theta)= DF \times D(\phi(r, \theta))$