In the literature, I have found two approaches for the transformation of random variables
$$p_{X}(x) =\int_{-\infty}^{\infty}p_{Y}(y)\delta\left(x-f(y)\right)~\mathrm{d}y$$
and
$$p_{X}(x)=p_{Y}(f^{-1}(x))\left|\frac{\mathrm{d}f^{-1}(x)}{\mathrm{d}y}\right|.$$
How do you manage to reconcile these two?
My feeble attempt
$$p_{X}(x) =\int_{-\infty}^{\infty}p_{Y}(y)\delta\left(x-f(y)\right)~\mathrm{d}y=\int_{-\infty}^{\infty}p_{Y}(y)\delta\left(y-f^{-1}(x)\right)~\mathrm{d}y=p_{Y}\left(f^{-1}(x)\right)$$
is missing a term. Sorry my foolish question and feeble attempt but it really bothers me.