Numerical
Integration
Approximate definite integrals when analytic methods fall short: master the trapezoidal rule and Simpson's rule for the IB HL exam.
Why Numerical Integration?
Many integrals cannot be evaluated analytically. Functions like \( e^{-x^2} \), \( \frac{\sin x}{x} \), or data from experiments have no closed-form antiderivative. Numerical integration gives us concrete approximate values for \( \displaystyle\int_a^b f(x)\,dx \) by using finitely many sample points.
The Big Picture
Visualising Trapezoids
Each green strip is a trapezoid with parallel sides \( f(x_i) \) and \( f(x_{i+1}) \), and width \( h \). The area of each strip is \( \frac{h}{2}\bigl[f(x_i)+f(x_{i+1})\bigr] \).
The Trapezoidal Rule
Simpson's Rule
Parabolic Strips
Simpson's rule uses parabolic arcs (not straight lines) between consecutive triples. The coefficients 1, 4, 2, 4, 2, ..., 4, 1 arise from integrating each quadratic segment.
Trapezoidal vs Simpson's
| Trapezoidal | Simpson's | |
|---|---|---|
| Approximation shape | Straight line (degree 1) | Parabola (degree 2) |
| Coefficients | 1, 2, 2, ..., 2, 1 | 1, 4, 2, ..., 4, 1 |
| Divisor | \(\frac{h}{2}\) | \(\frac{h}{3}\) |
| \(n\) requirement | Any \(n \geq 1\) | \(n\) must be even |
| Error order | \(O(h^2)\) | \(O(h^4)\) |
| Exact for polynomials up to degree | 1 (linear) | 3 (cubic) |
Step-by-Step Method
Example 1: Trapezoidal Rule
Estimate \( \displaystyle\int_0^1 e^{-x^2}\,dx \) using the trapezoidal rule with \( n = 4 \).
| \( x_i \) | \( f(x_i) = e^{-x_i^2} \) | Coeff. |
|---|---|---|
| 0 | 1.0000 | 1 |
| 0.25 | 0.9394 | 2 |
| 0.50 | 0.7788 | 2 |
| 0.75 | 0.5698 | 2 |
| 1.00 | 0.3679 | 1 |
Example 2: Simpson's Rule
Use the same data (\( n=4 \)) to estimate \( \displaystyle\int_0^1 e^{-x^2}\,dx \) with Simpson's rule.
| \( x_i \) | \( f(x_i) \) | Coeff. |
|---|---|---|
| 0 | 1.0000 | 1 |
| 0.25 | 0.9394 | 4 |
| 0.50 | 0.7788 | 2 |
| 0.75 | 0.5698 | 4 |
| 1.00 | 0.3679 | 1 |
Example 3: Data Table
A scientist measures a rate function \( r(t) \) at equal intervals. Estimate \( \displaystyle\int_0^6 r(t)\,dt \) using both rules (\( n = 6 \), \( h = 1 \)).
| \( t \) | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| \( r(t) \) | 2 | 5 | 7 | 8 | 6 | 4 | 3 |
Over or Under-estimate?
Error Bounds
Common Mistakes
Question 1 of 5
Using the trapezoidal rule with \( n = 3 \) and \( h = 2 \), which expression approximates \( \displaystyle\int_0^6 f(x)\,dx \)?
Question 2 of 5
Simpson's rule requires that \( n \) (the number of sub-intervals) is:
Question 3 of 5
Given \( f(0)=1 \), \( f(1)=3 \), \( f(2)=2 \), what is the Simpson's rule estimate of \( \displaystyle\int_0^2 f(x)\,dx \) with \( n = 2 \)?
Question 4 of 5
If \( f \) is concave up on \([a,b]\), the trapezoidal rule will:
Question 5 of 5
Halving the step size \( h \) in Simpson's rule reduces the error by approximately a factor of: