How do I intuitively understand the following result to find the probability density function $P_Y(y)$ given $P_X(x)$ after change of variables $y=f(x)$ or several variables. How to derive this from scratch?
$$P_Y(y)=\int{dx\delta(y-f(x))P_X(x)}$$ How to understand it's extension to a function $z=g(x_1,x_2...x_n)$ of several variables given their respective pdf.
$$P_Y(y)=\int{dx_1...dx_n\delta(z-f(x_1...x_n))P_{X_1}(x_1)...P_{X_n}(x_n)}$$