wanna mathMath ain't scary (not anymore)
4-Tier Textbook Index • Vol → Mod → Ch → Lab

Engineering Mathematics Volumes I–VI

6 Volumes • 20 Modules • 85 ChaptersFull Matrix →
4-Tier Statistics Index • Vol S → Mod → Ch → Lab

Interactive Statistics (S.1–S.6)

6 Modules • 18 ChaptersStatistics Index →
CHAPTER 6.2.4 • 2DPublished Interactive Labs~30 min study

Trapezoidal, Simpson's & Gauss-Legendre Quadrature

Compare equispaced Newton-Cotes rules against optimal Gauss-Legendre nodes that integrate degree-(2n-1) polynomials exactly.

Engineering & Physical Application Context

Finite-element stiffness matrix assembly, robotic trajectory arc-length computation, and aerospace aerodynamic pressure integration.

Governing Mathematical Formulation
∫−11f(x) dx≈∑i=1nwi f(xi)\int_{-1}^{1} f(x)\,dx \approx \sum_{i=1}^{n} w_i\,f(x_i)
Volume VI • Module 6.21 Interactive Lab(s)

The Question You Should Ask

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?

In Simple Words & Math

Composite Trapezoidal connects equispaced points with straight chords (O(h2)O(h^2) error), whereas Simpson's 1/31/3 rule fits parabolic arcs across consecutive pairs of subintervals (requiring an even panel count nn), jumping cleanly to fourth-order O(h4)O(h^4) accuracy.

Freeing node positions from equal spacing lets nn-point Gauss–Legendre quadrature optimize both locations and weights simultaneously, achieving exact results for every polynomial up to degree 2n−12n - 1.

4-Step Pedagogical Chapter Rhythm • Geometric Intuition First
Ch. 6.2.4
STEP 1 • GEOMETRIC QUESTION

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²)?

STEP 2 • INTERACTIVE LAB EXPLORATION

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.

STEP 3 • SYMBOLIC FORMALIZATION
∫−11f(x) dx≈∑i=1nwi f(xi),Pn(xi)=0\int_{-1}^{1} f(x)\,dx \approx \sum_{i=1}^{n} w_i\,f(x_i), \qquad P_n(x_i) = 0
STEP 4 • EDGE CASES & NEXT BRIDGE

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.

Interactive Laboratories in Chapter 6.2.4
Initializing Interactive Laboratory
LOADING MODULE

Preparing interactive canvas & numerical solver…

wanna math drafting viewport

Newton–Cotes Error Cancellation & Legendre Orthogonality

1. SECOND-ORDER NEWTON–COTES
ETrap=−(b−a)12h2f′′(ξ)=O(h2)E_{\text{Trap}} = -\frac{(b-a)}{12}h^2 f''(\xi) = O(h^2)

Both Midpoint and Trapezoidal fit constant or linear segments, leaving quadratic curvature errors whose magnitude halves by 4× whenever step size hh is halved.

2. SIMPSON'S BONUS ORDER O(h⁴)
13T+23M=S  ⟹  ES=−(b−a)180h4f(4)(ξ)\frac{1}{3}T + \frac{2}{3}M = S \implies E_S = -\frac{(b-a)}{180}h^4 f^{(4)}(\xi)

Symmetric weighting cancels cubic error terms automatically, integrating degree-3 cubics exactly with parabolic arcs.

3. GAUSS–LEGENDRE DEGREE 2n−1
Pn(xi)=0  ⟹  ∫−11p2n−1(x) dx=∑i=1nwip2n−1(xi)P_n(x_i) = 0 \implies \int_{-1}^{1} p_{2n-1}(x)\,dx = \sum_{i=1}^n w_i p_{2n-1}(x_i)

Freeing node locations doubles polynomial exactness from n−1n-1 to 2n−12n-1, clustering points near ±1\pm 1 to tame endpoint oscillations.

Composite Newton–Cotes Quadrature • Ch. 6.2.4

Composite Trapezoidal Rule & Simpson's 1/3 Rule Formulas

Open Quadrature Formulas →
COMPOSITE TRAPEZOIDAL RULE (ANY n ≥ 1)
∫abf(x) dx≈h2[y0+2(y1+⋯+yn−1)+yn],h=b−an\int_a^b f(x)\,dx \approx \frac{h}{2}\bigl[y_0 + 2(y_1 + \cdots + y_{n-1}) + y_n\bigr], \quad h = \frac{b-a}{n}

Error scales as O(h2)O(h^2): halving step size hh reduces global error by a factor of 44.

COMPOSITE SIMPSON'S 1/3 RULE (EVEN n REQUIRED)
∫abf(x) dx≈h3[y0+4 ⁣ ⁣∑odd iyi+2 ⁣ ⁣∑even iyi+yn]\int_a^b f(x)\,dx \approx \frac{h}{3}\Bigl[y_0 + 4\!\!\sum_{\text{odd }i} y_i + 2\!\!\sum_{\text{even }i} y_i + y_n\Bigr]

Because every quadratic arc spans two subintervals, nn must be even. Symmetry cancels the cubic term, achieving O(h4)O(h^4) accuracy (16×16\times error drop when halving hh).

Chapter 6.2.4 Laboratory Specifications

1 Interactive Lab(s)
LAB 6.2.4.1Component: NumericalQuadratureLab

Midpoint, Trapezoidal, Simpson & Gauss-Legendre Error Lab

Compare piecewise linear, parabolic, and Legendre-node approximations and log-log error slope.

ESimpson=O(h4),EGauss=O(h2n)E_{\text{Simpson}} = O(h^4), \quad E_{\text{Gauss}} = O(h^{2n})