/* 9-27-2023 mathematica expectation R(f') */ /* BCV */ fx = f0 + x f1 + x^2 f2 /2 + x^3 f3/6 + x^4 f4 /24 p0 = Integrate[ fx,{x,-h,0}] p1 = Integrate[ fx,{x,0,h}] ans = Expand[ (p1-p0)^2 / (h^3) ] /* UCV */ pA = Normal [ Series[ p1, {h,0,4} ] ] ans$ucv = n*pA*(1-pA) + (n*pA)^2 ucv = 2/((n-1)*h) - (n+1)*ans$ucv / (n^2 * (n-1) * h ) ucv$alt = 2/(n*h) - ans$ucv / (n^2 * h ) Expand[ ucv$alt ]