My book says the following:
If $X$ and $Y$ are continuous random variables with joint density $f(x, y)$, and if $g$ is any function of the two variables $X$ and $Y$, then:
$$E(g(X,Y)) = \int_{-\infty}^\infty\int_{-\infty}^\infty g(x,y)f(x,y)dydx$$
My question is: is $E(g(X,Y)) = \int_{-\infty}^\infty\int_{-\infty}^\infty g(x,y)f(x,y)dxdy$ equivalent to the above? I think it is, but I just want to make sure and if it is, I would appreciate an explanation the reason. Is it cause with double integrals it doesn't matter whether you integrate with respect to $y$ or $x$ first due to fubini's theorem?
Thank You!