Basic 1
∫₀¹ x² dx; n = 4
Expected result: I₄ = 1/3
Calculation steps
- h = 1/4; f(x) = x²
- I₄ = (1/12)[0 + 4(1/16) + 2(1/4) + 4(9/16) + 1]
- I₄ = (1/12) · 4 = 1/3
- I₈ = I₄; |I₈ − I₄|/15 = 0
Source: Original exercise
Approximate definite integrals with parabolic interpolation, even subintervals, grid refinement and error estimates.
∫₀¹ x² dx; n = 4
Expected result: I₄ = 1/3
Source: Original exercise
∫₁² x³ dx; n = 2
Expected result: I₂ = 3.75
∫₂⁵ e⁻⁰·¹ˣ dx; n = 2
Expected result: I₂ ≈ 2.122006886
∫₀⁶ [cos(x) + xe⁻ˣ] dx; n = 6
Expected result: I₆ ≈ 0.6876458772
∫₀¹ x⁴ dx; n = 4
Expected result: I₄ = 0.200520833333; I = 0.2
Simpson is exact for cubics, not generally for quartics.
Source: Original exercise
For f ∈ C⁴[a,b] and even n, the error is bounded by (b−a)h⁴ max|f⁽⁴⁾|/180. Cubic polynomials are integrated exactly in exact arithmetic.