I wanted to ask if the order of integration matters in double integration when we are calculating expectations or joint probability etc. For example: fXY (x, y) = 8xy, 0 ≤ x ≤ 1, 0 ≤ y ≤ x and 0 otherwise
I had to compute the E(Y) and to do that I first found the marginal distribution of y which came out as 4y and then I found its expectation which was (4/3)x^3 I also tried finding the expectation directly using the distribution function integrating first w.r.t y and then w.r.t x and the answer came out 8/15
Which answer is correct? And why are both methods giving me different answers? Also, had I integrated w.r.t x first and then y, I'd have gotten the the same answer I did when I found the marginal pdf and then found the expectation.
So, does the order of integration matter?