Midpoint, Trapezoidal, Simpson & Gauss-Legendre Error Lab
Compare piecewise linear, parabolic, and Legendre-node approximations and log-log error slope.
Compare equispaced Newton-Cotes rules against optimal Gauss-Legendre nodes that integrate degree-(2n-1) polynomials exactly.
Finite-element stiffness matrix assembly, robotic trajectory arc-length computation, and aerospace aerodynamic pressure integration.
When an antiderivative has no elementary formula, why do parabolic Simpson arcs beat flat trapezoids—and how can 3 Gauss–Legendre points integrate quintics exactly?
Composite Trapezoidal connects equispaced points with straight chords ( error), whereas Simpson's rule fits parabolic arcs across consecutive pairs of subintervals (requiring an even panel count ), jumping cleanly to fourth-order accuracy.
Freeing node positions from equal spacing lets -point Gauss–Legendre quadrature optimize both locations and weights simultaneously, achieving exact results for every polynomial up to degree .
Why can just n = 3 optimally placed Gauss–Legendre nodes integrate every degree-5 polynomial to machine precision, while equispaced Trapezoidal panels stall at O(h²)?
Switch among Midpoint, Trapezoidal, Simpson 1/3, and Gauss–Legendre rules across N ∈ [2, 16] while watching panel geometry and log₁₀|Error| vs. log₁₀ N slope.
Select Polynomial Degree 5 and slide N = 2 → 3 under Gauss–Legendre to witness an instantaneous plunge to 10⁻¹³! Next, carry Simpson's midpoint insight into ODE stepping.
Preparing interactive canvas & numerical solver…
wanna math drafting viewport
Both Midpoint and Trapezoidal fit constant or linear segments, leaving quadratic curvature errors whose magnitude halves by 4× whenever step size is halved.
Symmetric weighting cancels cubic error terms automatically, integrating degree-3 cubics exactly with parabolic arcs.
Freeing node locations doubles polynomial exactness from to , clustering points near to tame endpoint oscillations.
Error scales as : halving step size reduces global error by a factor of .
Because every quadratic arc spans two subintervals, must be even. Symmetry cancels the cubic term, achieving accuracy ( error drop when halving ).
Compare piecewise linear, parabolic, and Legendre-node approximations and log-log error slope.
Analytic C^∞ integrand: Simpson converges at O(h⁴) while Gauss–Legendre collapses exponentially.