difference between a function value and the average value of the function over 0 to 2