Trapezoid, Simpson, and Gauss–Legendre — and their convergence orders.
Implement three numerical integration rules and measure their accuracy against a known integral. You will watch the error shrink at different rates and confirm each rule’s order.
Trapezoidal ruleSimpson’s ruleGauss–Legendre quadratureOrder of accuracy
Milestones
0/4
Integrate e^x on [0,1] (exact e−1 ≈ 1.71828). Use n=100 panels; print the result.