Calculate variance of continuous random variable