1D Quadrature Playground

Every rule replaces f on each subinterval by a simple interpolant and integrates that exactly. Pick a rule to see the area it actually computes, then change the number of subintervals and read the slope of the error on the right. Try the cubic, the kink, and the fast oscillation.

 | 

What the rule integrates

Gray curve: true f(x). Shaded: the area the rule computes. Dots: where f is evaluated.

Error vs. cost

Log-log: |error| against the number of f evaluations. Slope = order of accuracy.