Expectation of a Function of a random variable