How to Use
Set up the integral:
- f(x): Choose function
- [a,b]: Integration bounds
- n: Subdivisions (even)
Weight Pattern
1, 4, 2, 4, 2, 4, ..., 2, 4, 1. Multiply each f(xᵢ) by its weight, sum, and multiply by h/3. The alternating 4-2 pattern comes from fitting parabolas through consecutive triplets.
Error Analysis
Error ≤ (b−a)⁵|f⁴(c)|/(180n⁴). Fourth-order convergence: doubling n reduces error by factor 16. Exact for cubic polynomials since f⁴=0.
Step-by-Step Instructions
- 1Select a function.
- 2Set bounds [a,b].
- 3Choose n (even).
- 4View weighted sum.
- 5Compare with exact.