Numerical Integration Methods
Compare Riemann, Trapezoidal, Simpson's, and Gaussian Quadrature — error convergence analysis
Configuration
Function f(x)
sin(πx)
exp(−x²)
√(1 − x²) [quarter circle]
x³ − 2x + 1
sin(5x)·exp(−x)
1/(1 + 25x²) [Runge]
Interval [a, b]
Number of Subintervals (n)
4
Displayed Method
Left Riemann
Right Riemann
Midpoint Riemann
Trapezoidal
Simpson's (1/3 Rule)
Gauss-Legendre (5-pt)
Compare all methods
Exact value
—
Convergence rates:
Riemann (left/right): O(h) — 1st order
Midpoint/Trapezoidal: O(h²) — 2nd order
Simpson's: O(h⁴) — 4th order
Gauss-Legendre (n pts): O(h²ⁿ) — exponential for smooth functions
Integration Visualization
Error vs. Number of Subintervals (log-log)