$ \def\dee{\mathop{\mathrm{d}\!}} \def\Jac#1{\mathop{\mathbf{J}_{#1}}} $
I'm confused about how to use the change of variable formula to describe the density of a pushforward measure. My question boils down to: which of the two formulae, (1) and (2) below, is the correct one?
Let $X$ be a real-valued random variable with density $\rho_X$ wrt the Lebesgue measure and let $Y=f(X)$ be another random variable, where $f$ is a deterministic invertible transformation. What is the probability density function of $Y$? [Just to be clear, the connection with the push-forward is: Denote by $P_X$ the law of $X$. Then the law of $Y$ is $P_Y = P_X \circ f^{-1} = {({P_X})}_\sharp f$, the push-forward of $P_X$ by $f$.]
For any measurable set $E$ of outcomes for $Y$, the probability measure of that set is
$$ \begin{align} P_Y(E) = P_X(f^{-1}(E)) &= \int_{f^{-1}(E)} \rho_X(x) \dee x\\ &= \int_{E} \rho_X(f^{-1}(y)) \left|\frac{\dee}{\dee y}f^{-1}(y)\right|\dee y \end{align} $$
(using the change of variables formula for integration by substitution) so the density of $Y$ is
$$ \rho_Y(y) = \rho_X(f^{-1}(y)) \left|\frac{\dee}{\dee y}f^{-1}(y)\right| $$
The derivative in this expression generalizes to the Jacobian determinant in multivariate case (when $f$ is a diffeomorphism, I gather), giving the following formula for the density (see, e.g. this math.SE answer)
$$ \tag{1} \rho_Y(y) = \rho_X(f^{-1}(y)) \left|\det\Jac{f^{-1}}(y)\right| $$
However, a few sources (for example, Betancourt's notes see section 4.2, and some implementations, like here)* give a similar expression but with the reciprocal of the Jacobian determinant, as
$$ \tag{2} \rho_Y(y) = \rho_X(f^{-1}(y)) \frac1{\left|\det\Jac{f^{-1}}(y)\right|} $$
It can't be the case that (1) and (2) both hold in general! Is (2) just a typo, or have I misunderstood the notation they use?
I know that $(\frac{\dee}{\dee x}{f}(x))^{-1}=\frac{\dee}{\dee y}{f^{-1}}(y)$ (by the inverse function theorem). This generalizes to $(\Jac{f}(x))^{-1}=\Jac{f^{-1}}(y)$. So, I think the correct version of (2) would be ($2^\star$):
$$ \tag{2$^\star$} \rho_Y(y) = \rho_X(f^{-1}(y)) \frac1{\left|\det\Jac{f}(x)\right|}\\ = \rho_X(x) \frac1{\left|\det\Jac{f}(x)\right|} $$
or, in the simpler one-dimensional case,
$$ \displaystyle \rho_Y(y) = \rho_X(f^{-1}(y)) \frac1{\left|\frac{\dee}{\dee x}{f}(x)\right|} \\ = \rho_X(x) \frac1{\left|\frac{\dee}{\dee x}{f}(x)\right|} $$
But I don't know why you would write it that way (since you want an expression where $y$ is the variable, not $x$), instead of the way in $(1)$.
Have I just made a silly mistake reading the notations? Is $(2)$ somehow correct?
*EDIT: I think I may be interpreting Betancourt's notation wrong. I now think any sources for $(2)$ are either based on a misunderstanding or a typo.