I have been solving one problem and there is something unclear to me in the solutions.
Namely, let's consider a probability density $p_x(x)$ defined over a continuous variable $x$, and suppose that we make a nonlinear change of variable using $x = g(y)$, so that the density transforms according to (1.27). $$\begin{align} p_y(y) &= p_x(x) \left| \dfrac{dx}{dy} \right| \\ &= p_x(g(y)) |g'(y)| \tag{1.27} \end{align}$$
An example of this: Let's take a Gaussian distribution $p_x(x)$ over $x$ with mean $\mu = 6$ and standard deviation $\sigma = 1$. Next we draw a sample of $N = 50,000$ points from this distribution.
Now let's consider a non-linear change of variables from $x$ to $y$ gives by
$$x = g(y) = \ln(y) - \ln(1 - y) + 5 \tag{5}$$
The inverse of this function is given by
$$y = g^{-1}(x) = \dfrac{1}{1 + \exp(-x + 5)} \ \tag{6}$$
which is a logistic sigmoid function.
Now, in order to calculate $p_y(y)$ we can use the (1.27) defined above, by basically taking into account (5) and computing the Jacobian, i.e. $|g'(y)|$.
The unclear part: The author claims that we can confirm whether we did the non-linear transformation correctly by taking out sample of 50,000 values of $x$, evaluate the corresponding values of $y$ using (6) and plot this, and this would match the transformation given by 1.27.
So my question now: how did we avoid computing the Jacobian by using the inverse i.e (6) instead, and why don't we always do this instead, i.e. just compute the inverse, and not do a full transformation according to 1.27?
Thanks in advance!