Suppose that you have polar coordinates in terms of the cartesian coordinates:
$$ r^2 = x^2 + y^2 \tag{1}$$
$$ \theta = \tan^{-1} \frac{y}{x}$$
The Jacobian is given as:
$$ \begin{bmatrix} \frac{\partial r}{\partial x} & \frac{\partial r}{\partial y} \\ \frac{\partial \theta}{\partial x} & \frac{\partial \theta}{\partial y} \end{bmatrix}$$
Now here is my question, in almost every textbook and video I see we take the positive square root branch in $(1)$:
$$ r = \sqrt{x^2 +y^2}$$
But really there is an ambiguity here because one could have taken the negative square root and calculate the Jacobian. For each definition, we get a jacobian. How do we choose the correct jacobian for the transformation?
What we have for sure, even for negative $r$ and $\theta$ outside of a standard range, is $x=r\cos\theta$ and $y=r\sin\theta$.
Then $r^{2}=x^{2}+y^{2}$ is certainly true. We can hold $y$ constant and implicitly differentiate with respect to $x$, to get $2r\dfrac{\partial r}{\partial x}=2x$. That means that (if $r\ne0$), we have $\dfrac{\partial r}{\partial x}=x/r=\cos\theta$, whether $r$ is positive or negative. Similarly, we can hold $x$ constant to find that $\dfrac{\partial r}{\partial y}=y/r=\sin\theta$.
Analogously, if $x\ne0$, $\dfrac{y}{x}=\tan\theta$ is true, so we can hold $y$ constant and differentiate with respect to $x$ to find $-\dfrac{y}{x^{2}}=\dfrac{\partial\theta}{\partial x}\sec^{2}\theta$ so $\dfrac{\partial\theta}{\partial x}=-\dfrac{y}{r^{2}}=-\dfrac{\sin\theta}{r}$. And similarly we can hold $x$ constant and differentiate with respect to $y$ to find $\dfrac{1}{x}=\dfrac{\partial\theta}{\partial y}\sec^{2}\theta$ and $\dfrac{\partial\theta}{\partial y}=\dfrac{\cos\theta}{r}$.
These answers check out, since $\begin{bmatrix}\cos\theta & \sin\theta\\ -\dfrac{\sin\theta}{r} & \dfrac{\cos\theta}{r} \end{bmatrix}^{-1}=\begin{bmatrix}\cos\theta & -r\sin\theta\\ \sin\theta & r\cos\theta \end{bmatrix}=\begin{bmatrix}\dfrac{\partial x}{\partial r} & \dfrac{\partial x}{\partial\theta}\\ \dfrac{\partial y}{\partial r} & \dfrac{\partial y}{\partial\theta} \end{bmatrix}$.
The derivation of the Jacobian above assumed that $x\ne0$ (which implies $r\ne0$). But we could get the same results by assuming $y\ne0$ and working with $\dfrac{x}{y}=\cot\theta$ instead, so it's still right even if $x=0$, as long as we don't have $\left(x,y\right)=\left(0,0\right)$, which is kind of a bad point for polar coordinates (as alluded to in Hans Lundmark's comment).