Let $X_1, X_2$ be random variables and $h(x_1,x_2)$ be a transformation that is monotone in $x_1$ for each $x_2$ on the joint support. Let $h^{-1}$ denote the marginal inverse transformation such that $x_1=h^{-1}(u;x_2)$. Show that the density is of $U =h(X_1, X_2)$ is: $$g(u)=\int f(h^{-1}(u;x_2),x_2)\left|\frac{d}{du}h^{-1}(u;x_2)\right|dx_2 $$
Here is the proof:
$$\begin{align} g(u) &= \int g(u,x_2)dx_2\\ &=\int g(u|x_2)f(x_2) dx_2\\ &=\int f(h^{-1}(u;x_2)\vert x_2)\left|\frac{d}{du}h^{-1}(u;x_2)\right|f(x_2)dx_2\\ &=\int f(h^{-1}(u;x_2),x_2)\left|\frac{d}{du}h^{-1}(u;x_2)\right|dx_2 \end{align} $$ I would appreciate if someone can give a rundown of what is going on in each step so I can really understand what is going on here.