kill(all)$

van=facebook.com/LearningCalculus$

f(x):=(1+2*sin(x)-sin(x)^2)/((1+x)*cos(x)^4)$

width:%pi/4$

avgHeight(a,b):=(f(b)+f(a))/2$

is(width*avgHeight(0,%pi/4)<(%pi/2));

is( width/2*
    (
        avgHeight(0*width/2,1*width/2)+
        avgHeight(1*width/2,2*width/2)
    )
    <
    (%pi/2)
);

is( width/4*
    (
        avgHeight(0*width/4,1*width/4)+
        avgHeight(1*width/4,2*width/4)+
        avgHeight(2*width/4,3*width/4)+
        avgHeight(3*width/4,4*width/4)
    )
    <
    (%pi/2)
);

fpp(x):=''((fullratsimp(diff(f(x),x,2))));

float(fpp(0*width/4));
float(fpp(1*width/4));
float(fpp(2*width/4));
float(fpp(3*width/4));
float(fpp(4*width/4));