IB MATHEMATICS: ANALYSIS AND APPROACHES • CALCULUS

Numerical Integration — AHL 5.13 Numerical integration techniques (trapezoidal/Simpson) (HL enrichment-to-standard)

Approximate definite integrals when exact antiderivatives are impossible, using trapezoids and parabolas.

Historical Context & Motivation

Long before modern computers existed, mathematicians faced a fundamental challenge: many functions simply cannot be integrated using a neat formula. Imagine trying to find the exact area under a curve like f(x) = e−x² — there is no elementary antiderivative for this function, yet scientists and engineers desperately needed its area for applications in probability and statistics. The solution? Approximate the area by breaking the region into simple geometric shapes whose areas are easy to compute.

This idea of numerical integration — estimating definite integrals through approximation — stretches back thousands of years. Ancient Greek mathematicians used methods of exhaustion to estimate areas, and later thinkers refined these ideas into the structured techniques we use today: the trapezoidal rule and Simpson's rule.

~250 BCE
Archimedes' Method of Exhaustion
Archimedes approximated the area of a parabolic segment by inscribing triangles, laying the conceptual groundwork for numerical area estimation.
1670s
Newton & Leibniz Develop Calculus
The invention of calculus provided exact integration methods, but it quickly became clear that many integrals have no closed-form antiderivative.
1743
Thomas Simpson Publishes His Rule
Thomas Simpson formalized a quadratic approximation technique that uses parabolic arcs to achieve remarkably accurate area estimates — now called Simpson's rule.
1800s
Trapezoidal Rule Becomes Standard
As engineering and physics demanded rapid calculations, the trapezoidal rule became a workhorse for its simplicity, and error analysis helped mathematicians understand when each method is most appropriate.
1950s–Today
Computer-Age Numerical Methods
Modern computers apply these classical rules with millions of subintervals, making numerical integration an essential tool in science, finance, and engineering.

The central question these methods answer is straightforward: How can we accurately estimate the value of a definite integral when we cannot find — or choose not to find — an antiderivative? This is not just an academic exercise; it arises constantly in real-world modeling, from calculating distance traveled using speed data to estimating probabilities under bell curves.

Core Principles & Definitions

Before diving into formulas, let's establish the key ideas that underpin both the trapezoidal rule and Simpson's rule. Both methods share a common strategy: divide the interval [a, b] into smaller pieces, approximate the curve on each piece with a simple shape, and add up those areas.

1

Subintervals & Strip Width

We divide [a, b] into n equal subintervals, each of width h = (b − a) / n. The more subintervals we use, the better our approximation.
2

Ordinates (y-values)

At each boundary point x₀, x₁, x₂, …, xₙ we evaluate the function to get ordinates y₀, y₁, y₂, …, yₙ. These are the heights used in our approximation.
3

Trapezoidal Approximation

Each strip is approximated by a trapezoid — a shape with a straight line connecting consecutive function values. Simple, but it can miss curvature.
4

Parabolic Approximation (Simpson's)

Simpson's rule fits a parabola through every group of three consecutive points, capturing curvature far better than straight lines.
5

Even Number Requirement

The trapezoidal rule works with any number of subintervals, but Simpson's rule requires an even number of subintervals (n must be even) because it groups strips in pairs.
KEY TAKEAWAY
Think of numerical integration like estimating the area of an irregularly shaped swimming pool. The trapezoidal rule is like laying straight planks across the pool and measuring — it's quick but rough. Simpson's rule is like bending flexible rods into smooth curves across the pool — it follows the shape much more closely. Both work, but the curved approach (Simpson's) is usually more accurate for the same number of measurements.

Visual Explanation — Trapezoids Under a Curve

The curve f(x) (pink) is approximated by four trapezoids (cyan shading). Each trapezoid has a straight-line top connecting consecutive ordinates y₀ through y₄. The strip width h = (b − a)/4 is uniform. Notice the gap between the straight dashed lines and the actual curve — this error decreases as n increases.

In the diagram above, you can see that each trapezoid has two parallel vertical sides (the ordinates yi and yi+1) and a slanted top edge connecting them. The area of a single trapezoid is ½ × h × (yi + yi+1). When the curve is concave up, the trapezoids tend to overestimate the area; when the curve is concave down, they underestimate it. This systematic error is what motivates the more sophisticated Simpson's rule, which fits parabolas instead of straight lines.

Mathematical Framework

The Trapezoidal Rule

We partition the interval [a, b] into n equal subintervals, each of width h. The endpoints generate n + 1 ordinates. The trapezoidal rule sums the areas of all n trapezoids.

STRIP WIDTH
h = (b − a) / n
where a and b are the limits of integration and n is the number of subintervals.
TRAPEZOIDAL RULE
∫ₐᵇ f(x) dx ≈ (h/2)(y₀ + 2y₁ + 2y₂ + … + 2yₙ₋₁ + yₙ)
The first and last ordinates appear once; all interior ordinates are multiplied by 2. This is the IB formula booklet version.

Simpson's Rule

Simpson's rule takes things a step further by fitting a quadratic (parabolic) curve through each group of three consecutive points. Because a parabola can bend, it follows the actual curve much more faithfully than a straight line. The requirement is that n must be even, since the parabolas are fitted over pairs of subintervals.

SIMPSON'S RULE
∫ₐᵇ f(x) dx ≈ (h/3)(y₀ + 4y₁ + 2y₂ + 4y₃ + 2y₄ + … + 4yₙ₋₁ + yₙ)
The coefficients follow the pattern 1, 4, 2, 4, 2, …, 4, 1. The first and last ordinates have coefficient 1, odd-indexed ordinates get 4, and even-indexed interior ordinates get 2. The factor is h/3 rather than h/2.
📋 IB Exam Tip
Both formulas appear in the IB formula booklet. However, you must know when to apply each one and how to set up the table of x- and y-values. Pay close attention to whether the question specifies n (number of subintervals) or n + 1 (number of ordinates), and always double-check that n is even before using Simpson's rule.

Comparing Trapezoids and Parabolas

Let's visualize the fundamental difference between these two methods side by side. The trapezoidal rule connects consecutive points with straight lines, whereas Simpson's rule fits smooth parabolic arcs through groups of three points. This seemingly small change has a dramatic effect on accuracy.

Left: the trapezoidal rule uses straight-line segments (cyan), leaving visible gaps between the approximation and the true curve (pink). Right: Simpson's rule uses parabolic arcs (violet) that hug the curve much more closely, yielding a more accurate area estimate with the same five data points.
Key differences between the trapezoidal and Simpson's rules
FeatureTrapezoidal RuleSimpson's Rule
Shape usedStraight-line segments (linear)Parabolic arcs (quadratic)
Coefficient pattern1, 2, 2, …, 2, 11, 4, 2, 4, …, 4, 1
Multiplierh / 2h / 3
Requirement for nAny positive integerMust be even
Error orderO(h²) — proportional to h²O(h⁴) — proportional to h⁴ (much smaller)
Exact forLinear functionsPolynomials up to degree 3

The error order is particularly important. Saying the trapezoidal rule has error O(h²) means that if you halve the strip width (double the number of subintervals), the error decreases by roughly a factor of 4. For Simpson's rule with error O(h⁴), halving h reduces the error by roughly a factor of 16. This is why Simpson's rule achieves excellent accuracy even with relatively few subintervals.

Worked Example

Let's estimate ∫₁³ (1/x) dx using both rules with n = 4 subintervals. The exact answer is ln 3 − ln 1 = ln 3 ≈ 1.0986, so we can check our approximations.

Trapezoidal Rule for ∫₁³ (1/x) dx with n = 4
1
Step 1 — Calculate the strip width hh = (b − a) / n = (3 − 1) / 4 = 2 / 4 = 0.5
h = 0.5
2
Step 2 — Determine the x-values and compute ordinatesx₀ = 1.0, x₁ = 1.5, x₂ = 2.0, x₃ = 2.5, x₄ = 3.0. Now evaluate f(x) = 1/x at each point: y₀ = 1/1 = 1, y₁ = 1/1.5 = 0.6667, y₂ = 1/2 = 0.5, y₃ = 1/2.5 = 0.4, y₄ = 1/3 ≈ 0.3333.
Ordinates: 1, 0.6667, 0.5, 0.4, 0.3333
3
Step 3 — Apply the trapezoidal rule formulaT = (h/2)(y₀ + 2y₁ + 2y₂ + 2y₃ + y₄) = (0.5/2)(1 + 2(0.6667) + 2(0.5) + 2(0.4) + 0.3333) = 0.25 × (1 + 1.3334 + 1.0 + 0.8 + 0.3333) = 0.25 × 4.4667.
T ≈ 1.1167
4
Step 4 — Compare to exact valueThe exact value is ln 3 ≈ 1.0986. Our trapezoidal estimate of 1.1167 has an error of about 0.0181, which is roughly 1.6%.
Error ≈ 1.6% overestimate
Simpson's Rule for ∫₁³ (1/x) dx with n = 4
1
Step 1 — Verify n is even and use same hn = 4 is even ✓, so Simpson's rule can be applied. We already computed h = 0.5 and all five ordinates in the trapezoidal example.
h = 0.5, n = 4 ✓
2
Step 2 — Apply the coefficient pattern 1, 4, 2, 4, 1S = (h/3)(y₀ + 4y₁ + 2y₂ + 4y₃ + y₄) = (0.5/3)(1 + 4(0.6667) + 2(0.5) + 4(0.4) + 0.3333) = (0.1667)(1 + 2.6668 + 1.0 + 1.6 + 0.3333) = (0.1667)(6.6001).
S ≈ 1.1000
3
Step 3 — Compare to exact valueThe exact value is ln 3 ≈ 1.0986. Simpson's estimate of 1.1000 has an error of about 0.0014, which is roughly 0.13%. This is more than 10 times more accurate than the trapezoidal rule with the same number of subintervals!
Error ≈ 0.13% overestimate

Strengths, Limitations & When to Use Each

Both methods are powerful, but each has situations where it shines and situations where it struggles. Understanding these trade-offs is essential for making good choices on exams and in real applications.

Strengths, limitations, and exam relevance
ConsiderationTrapezoidal RuleSimpson's Rule
StrengthsWorks with any n; simple to apply; easy to remember (coefficient pattern 1, 2, 2, …, 2, 1)Much higher accuracy for the same n; exact for polynomials up to degree 3; coefficient pattern (1, 4, 2, …) is still manageable
LimitationsLarger error for curved functions; tends to overshoot on concave-up curves and undershoot on concave-down curvesRequires n to be even; slightly more complex arithmetic; coefficient errors can cascade in hand calculations
Best used whenData comes from experiments (odd number of points allowed); a quick rough estimate is neededHigh accuracy is required; the function is smooth; n can be chosen freely (pick an even number)
IB exam frequencyVery common in Paper 2; often with data in a tableCommon in HL papers; sometimes compared with the trapezoidal rule in the same question
KEY TAKEAWAY
If you're asked to choose a method and can pick n freely, almost always go with Simpson's rule because its error shrinks much faster as you add more subintervals. Think of it like upgrading from a ruler to a French curve — both measure a shape, but the flexible tool captures bends that the straight one misses.

Connection to Riemann Sums & Beyond

You may have already encountered Riemann sums — left-endpoint, right-endpoint, and midpoint approximations — which use rectangles to estimate area. The trapezoidal rule can be viewed as the average of the left and right Riemann sums, which is why it's generally more accurate than either one alone. Simpson's rule goes further by being equivalent to a weighted combination of the midpoint and trapezoidal estimates.

Hierarchy of numerical integration methods
MethodShapeError OrderIB Level
Left / Right Riemann SumRectangleO(h)SL & HL (conceptual)
Midpoint RuleRectangle (midpoint height)O(h²)Supplementary
Trapezoidal RuleTrapezoidO(h²)AHL 5.13
Simpson's RuleParabolic arcO(h⁴)AHL 5.13 (HL enrichment)
Gaussian QuadratureOptimal polynomial nodesO(h²ⁿ)University level

At university, you'll encounter even more powerful techniques such as Gaussian quadrature and adaptive methods that automatically concentrate subintervals where the function changes most rapidly. For now, mastering the trapezoidal and Simpson's rules gives you a solid foundation in the core idea: replace a hard integral with a sum of areas under simple shapes. This principle never changes, no matter how sophisticated the method becomes.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain why Simpson's rule requires an even number of subintervals, while the trapezoidal rule does not. What geometric feature of Simpson's rule creates this requirement?
PROBLEM 2BASIC CALCULATION
Use the trapezoidal rule with n = 4 to estimate ∫₀² x² dx. Compare your answer with the exact value.
PROBLEM 3INTERMEDIATE
Use Simpson's rule with n = 4 to estimate ∫₀² x² dx. How does the accuracy compare to the trapezoidal result from Problem 2?
PROBLEM 4APPLIED
A car's velocity (in m/s) is recorded every 2 seconds: t = 0, 2, 4, 6, 8 with velocities v = 0, 5, 12, 18, 20. Use Simpson's rule to estimate the total distance traveled over 8 seconds.
PROBLEM 5CRITICAL THINKING
A student applies the trapezoidal rule to ∫₀π sin x dx with n = 2 and gets an answer of approximately 1.5708. The exact value is 2. (a) Why does the trapezoidal rule underestimate here? (b) If the student doubles n to 4, would you expect the error to be reduced by a factor of approximately 2 or 4? Justify your answer.

Lesson Summary

Numerical integration allows us to estimate definite integrals when no elementary antiderivative exists — or when data comes from measurements rather than a formula. The trapezoidal rule divides [a, b] into n subintervals of width h = (b − a)/n and approximates the curve with straight-line segments, using the coefficient pattern 1, 2, 2, …, 2, 1 multiplied by h/2. It works for any n and has error of order O(h²).

Simpson's rule fits parabolic arcs through groups of three points, using the coefficient pattern 1, 4, 2, 4, …, 4, 1 multiplied by h/3. It requires n to be even and achieves error of order O(h⁴), making it significantly more accurate for smooth functions. Both methods build on the same fundamental idea — replace a complex curve with simple geometric shapes and sum their areas — and both are indispensable tools in applied mathematics, science, and engineering.

Varsity Tutors • IB Mathematics: Analysis and Approaches • Numerical Integration — AHL 5.13