MTH 343 · 4.4 Composite quadrature rules
Split [a, b] into n subintervals of width h = (b − a)/n. The composite trapezoidal rule puts a line segment on each subinterval; the composite Simpson's rule puts a parabola on each pair of subintervals. Compare the errors of both rules, and find the n that guarantees a target error.
Type 0.00002, 2e-5 or 10^-6.
Enter a positive number for the target error, for example 0.00002 or 1e-6.
As in the exercise on slide 9: make the error bound of each rule smaller than the target and solve for n. The lab also finds the n the actual error needs, which is usually smaller: the error bound uses the largest value of |f″| or |f⁽⁴⁾| on all of [a, b]. This part uses the function and the interval chosen above, for both rules; the n and the rule chosen above do not matter here.
Both rules for n = 1, 2, 4, …, 1024 (each doubling halves h), and for your n. The ratio is the error for n/2 divided by the error for n. Click an n to select it.