I was working with some statistics on Mathematica and the Expectation function made me curious. I tried to calculate the expected value of an expression containing multivariate distribution and it gave the result almost instantly.
On the other hand, trying to find the same by direct integration after applying the Law of iterated expectation took almost an hour.
I'm curious to know how Mathematica processes expectations so fast, no matter what distribution they are. Is there any computationally easier analytical method to calculate expectations that Mathematica exploits behind the scenes?