UNIHIVE

Study Hub UNIPORT ENG 303

ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)

Numerical integration

The trapezoidal rule, Simpson's 1/3 and 3/8 rules, their errors, Romberg integration and Gaussian quadrature.

Our notes

1 min read

Why integrate numerically

Areas under measured curves (a river cross-section from depth soundings, work from a force-distance record), and integrals with no closed form (e^(−x²)).

Trapezoidal rule

Split [a, b] into n equal strips of width h:
T = (h/2)[f₀ + 2(f₁ + f₂ + ... + fₙ₋₁) + fₙ]. Error ∝ h² (second order).

Simpson's 1/3 rule

n must be even:
S = (h/3)[f₀ + 4(f₁ + f₃ + ...) + 2(f₂ + f₄ + ...) + fₙ]. Error ∝ h⁴ (fourth order), and it is exact for cubics.
Simpson's 3/8 rule: for three strips, (3h/8)[f₀ + 3f₁ + 3f₂ + f₃]; used when the number of strips is odd (combine with 1/3 rule on the rest).

Worked example

∫₁² (1/x) dx = ln 2 = 0.693147. With n = 4, h = 0.25: f values at 1, 1.25, 1.5, 1.75, 2 are 1, 0.8, 0.666667, 0.571429, 0.5.

  • Trapezoidal: 0.125 × [1 + 2(0.8 + 0.666667 + 0.571429) + 0.5] = 0.125 × 5.576191 = 0.697024 (error 0.003877).
  • Simpson's 1/3: (0.25/3) × [1 + 4(0.8 + 0.571429) + 2(0.666667) + 0.5] = 0.083333 × 8.319049 = 0.693254 (error 0.000107).

Simpson's rule is about 36 times more accurate here with the same five points.

Romberg integration

Apply Richardson extrapolation to trapezoidal results with h, h/2, h/4, ...: R = T(h/2) + [T(h/2) − T(h)]/3 removes the h² error, and repeating removes higher terms. (The first extrapolation equals Simpson's rule.)

Gaussian quadrature

Choose both the points and the weights to get the highest accuracy. Two-point Gauss-Legendre on [−1, 1]: ∫f ≈ f(−1/√3) + f(1/√3), exact for cubics with only two function evaluations. Change variables to use it on [a, b].

Practical notes

Uneven data spacing: use the trapezoidal rule strip by strip. Check convergence by halving h and comparing. Infinite ranges and singular integrands need special treatment.

Exams usually ask: apply the trapezoidal and Simpson rules to a function or table; state their error orders; explain why Simpson needs an even number of strips; do one Romberg step; use two-point Gauss quadrature.

Common mistake: using an odd number of strips with Simpson's 1/3 rule. Check that n is even, or use the 3/8 rule for one block.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All ENG 303 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.