The area under a parabola is one-third the area of the rectangle that contains it.

Suggested by our text, p. 272: “From calculus we know that the area under a parabola is one-third the area of the rectangle that contains it.” (See the picture on p. 271.)

Clear[a,b,c,x0,x1,x2]
f[x_]:=a*x^2+b*x+c
mends=Simplify[(f[x1]-f[x0])/(x1-x0)]
middle=x/.Solve[f'[x]==mends,x]
middle=middle[[1]]

Suppose we’re on the interval [x0,x1]. The box will be of width (w=x1-x0),  and of height the difference in f between the two lines: the secant line joining the ends, and the midpoint tangent line:

ys[x_]:=f[x0]+mends*(x-x0)
ym[x_]:=f[middle]+f'[middle](x-middle)
Simplify[Integrate[ys[x]-f[x],{x,x0,x1}]]
Integrate[f[x]-ym[x],{x,x0,x1}]

a=1
b=2
c=3
x0=0
x1=2
Plot[{f[x],ys[x],ym[x]},{x,x0,x1}]
Simplify[Integrate[ys[x]-f[x],{x,x0,x1}]]
Integrate[f[x]-ym[x],{x,x0,x1}]