Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Animation · Trapezoids

Block 2 · Watch, pause, and explain

San Diego State University

Join the two endpoint samples with a straight line and integrate that line. The film adds trapezoidal areas for exe^x on [0,1][0,1] and compares successive uniform refinements.

Before watching

The curve is convex. Predict whether its endpoint chord lies above or below the curve, and what that implies for the integral estimate.

Mathematical connection

Let I=∫aa+hf(x) dxI=\int_a^{a+h} f(x)\,dx be the exact integral over one panel of width hh. The trapezoid rule is

T=h2[f(a)+f(a+h)].T=\frac{h}{2}[f(a)+f(a+h)].

Taylor expansion of the endpoint value and integration of the same series give

T=hf(a)+h22f′(a)+h34f′′(a)+O(h4),T=hf(a)+\frac{h^2}{2}f'(a)+\frac{h^3}{4}f''(a)+O(h^4),
I=hf(a)+h22f′(a)+h36f′′(a)+O(h4).I=hf(a)+\frac{h^2}{2}f'(a)+\frac{h^3}{6}f''(a)+O(h^4).

Thus T−I=h312f′′(a)+O(h4)T-I=\frac{h^3}{12}f''(a)+O(h^4). The local error is O(h3)O(h^3) and the composite error over a fixed interval is O(h2)O(h^2) for a sufficiently smooth function. The straight-line model integrates constants and linear functions exactly.

Explain what you saw

Compare the actual errors after each halving of the panel width. Explain why a ratio near four is expected once the leading second-order composite error dominates. This ratio is an asymptotic prediction, not an unconditional guarantee.

Use the player controls to pause, replay, or view fullscreen. The animation has no narration; its labels and the explanation above carry the content.

Continue: Lecture 7 · Full reading · All animations