Error approximation for the Trapezoid/Midpoint rules

The maximum error bounds for the Trapezoid and Midpoint rules are given by the following formulae:

maxTrapError (n) = ((b - a)^3M)/(12n^2) and maxMidPtError (n) = ((b - a)^3M)/(24n^2), where M = Max_ (x∈[a, b]) f"(x) 

(Notice that these can not just be cut and pasted to define them; you must adapt them for Mathematica.)

Define two error functions (as above), maxTrapError[n] and maxMidPtError[n].  Make a table comparing these errors for different values of n (at least an order of magnitude) with the actual errors for the appropriate rules.

IF you have defined your error functions like I told you to above, you should be able to execute the following command (you may need to change the domain for n, if you used different values) to plot the two errors as a function of n:

Plot[{maxTrapError[n], maxMidPtError[n]}, {n, 100, 1000}, PlotStyle {Green, Blue}]

[Graphics:../HTMLFiles/index_57.gif]

⁃Graphics⁃

How does this graph compare with the similar graph for the Left/Right sum?


Created by Mathematica  (April 22, 2004)