Trapezoidal Rule for Numerical Integration

Numerical Methods

Source inspiration: (Mathew 2000-2019).

Animations

Each animation below shows the trapezoidal rule diagram building up panel by panel over \([0, 2]\) for \(y = e^{-x}\sin(8x^{2/3})+1\). Each frame adds one new trapezoid; the running sum is annotated in the upper center. The trapezoidal rule averages the left and right Riemann sums — its error is \(O(h^2)\) per panel.

Julia source scripts that generated these animations are linked under each case.

Case 1 — Trapezoidal Rule, \(y = e^{-x}\sin(8x^{2/3})+1\), \(n=10\)

Behavior: Each panel connects \(f(x_i)\) to \(f(x_{i+1})\) with a straight line (trapezoid). The error for a smooth function is proportional to \(h^2 f''(\xi)\), which is \(O(h^2)\) — second-order accuracy.

Julia source

Trapezoidal Rule animation: 10 trapezoids build one-by-one over [0,2]; slanted tops connect consecutive function values; running sum annotated each frame

Derivation Notes (Planned)

Short derivations will be added to explain the core equations and assumptions.

Worked Example (Planned)

A compact numerical example with intermediate steps will be included.

Implementation Notes (Planned)

Implementation details, numerical stability notes, and practical pitfalls will be added.

Legacy Animation Inventory (Stub)

Animation Portals

  1. Trapezoidal Rule (ok)
  • Animation item links found: 1

Animation Items

  1. Trapezoidal Rule (ok)
  • Main animated GIF count: 1
  • http://localhost:8000/a2001/Animations/Quadrature/Trapezoidal/Trapezoidalaa.gif

References

Mathew, John H. 2000-2019. Numerical Analysis - Numerical Methods Modules. https://web.archive.org/web/20190808102217/http://mathfaculty.fullerton.edu/mathews/n2003/NumericalUndergradMod.html.