Numerical Integration: Simpson's Rule and Trapezoidal Rule, CALC 2 PS2 – Study Notes
offline

Difficulty: Intermediate | Prerequisites: Calc 1 (definite integrals, derivatives up to fourth order), basic arithmetic comfort with decimals.

Big Picture

Numerical integration is what you use when you cannot (or choose not to) find an antiderivative by hand. The trapezoidal rule and Simpson's rule approximate a definite integral by sampling the function at evenly spaced points, then combining those values with specific weights. The real power of this topic is the error bound: a formula that tells you, before you compute, how far off your approximation can possibly be. This is the part of Calc 2 where you learn to quantify precision, which is essential in any applied or engineering context.


TL;DR

Simpson's rule uses parabolic arcs through groups of three points to approximate an integral, with error bounded by E(n) = (b - a)⁵ M / (180n⁴), where M is the max of |f''''(x)|. The trapezoidal rule uses straight-line segments, with error bounded by E(n) = (b - a)³ M / (12n²), where M is the max of |f''(x)|. Both require n to be chosen carefully to hit a desired accuracy, and Simpson's rule converges much faster.


Key Terms

Simpson's rule

A numerical integration method that approximates the integrand with parabolas through consecutive groups of three points. It uses the weighted sum: (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + ... + 4f(xₙ₋₁) + f(xₙ)], where h = (b - a)/n and n must be even. Think of it as: fitting little parabolic arcs instead of flat-topped rectangles.

Trapezoidal rule

A numerical integration method that approximates the area under a curve using trapezoids. The formula is (h/2)[f(x₀) + 2f(x₁) + 2f(x₂) + ... + 2f(xₙ₋₁) + f(xₙ)]. In simple terms, connect the dots with straight lines and add up the trapezoid areas.

Error bound

An upper limit on how far the numerical approximation can be from the true value of the integral. It depends on the interval, the number of subintervals, and a derivative of the function. Think of it as a worst-case guarantee: the actual error is somewhere between zero and this number.

M (maximum derivative value)

For Simpson's rule, M = max|f''''(x)| on [a, b]. For the trapezoidal rule, M = max|f''(x)| on [a, b]. Finding M is a critical step: if you get M wrong, your error bound is wrong.


Core Content

How Simpson's Rule Works

Divide [a, b] into n equal subintervals (n must be even). Let h = (b - a)/n and the sample points be x₀, x₁, ..., xₙ. The approximation is:

Sₙ = (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + 2f(x₄) + ... + 4f(xₙ₋₁) + f(xₙ)]

The pattern of coefficients is: 1, 4, 2, 4, 2, ..., 4, 2, 4, 1.

How the Trapezoidal Rule Works

Same setup, but n need not be even. The approximation is:

Tₙ = (h/2)[f(x₀) + 2f(x₁) + 2f(x₂) + ... + 2f(xₙ₋₁) + f(xₙ)]

The pattern of coefficients is: 1, 2, 2, ..., 2, 1.

Worked Example: Simpson's Rule for ∫₀^{π/2} sin(x) dx with n = 4

The exact value is -cos(π/2) + cos(0) = 0 + 1 = 1.

With n = 4, h = (π/2)/4 = π/8 ≈ 0.3927. The sample points are x₀ = 0, x₁ = π/8, x₂ = π/4, x₃ = 3π/8, x₄ = π/2.

Compute the function values:

  • f(x₀) = sin(0) = 0

  • f(x₁) = sin(π/8) ≈ 0.3827

  • f(x₂) = sin(π/4) ≈ 0.7071

  • f(x₃) = sin(3π/8) ≈ 0.9239

  • f(x₄) = sin(π/2) = 1

S₄ = (π/24)[0 + 4(0.3827) + 2(0.7071) + 4(0.9239) + 1]

= (π/24)[0 + 1.5307 + 1.4142 + 3.6955 + 1]

= (π/24)(7.6404)

≈ 1.0001

The error is |1 - 1.0001| ≈ 0.0001. Simpson's rule is remarkably accurate here even with just 4 subintervals.

Finding M for the Error Bound

For Simpson's rule error, you need M = max|f''''(x)| on [a, b].

For f(x) = sin(x): f'(x) = cos(x), f''(x) = -sin(x), f'''(x) = -cos(x), f''''(x) = sin(x).

So |f''''(x)| = |sin(x)| on [0, π/2]. The maximum of |sin(x)| on this interval is 1 (at x = π/2). So M = 1.

For f(x) = 1/x: f'(x) = -x⁻², f''(x) = 2x⁻³, f'''(x) = -6x⁻⁴, f''''(x) = 24x⁻⁵.

So |f''''(x)| = 24/x⁵ on [1, 4]. This is decreasing, so the maximum is at x = 1: M = 24.

Computing the Error Bound E(n)

For ∫₀^{π/2} sin(x) dx with M = 1:

E(n) = (π/2)⁵ / (180n⁴) = π⁵ / (32 · 180 · n⁴) ≈ 0.0053/n⁴

  • E(4) = (π/2)⁵ / (180 · 256) ≈ 0.0000664

  • E(10) = (π/2)⁵ / (180 · 10000) ≈ 0.0000017

  • E(20) = (π/2)⁵ / (180 · 160000) ≈ 0.0000001

Finding n for a Target Accuracy

To get E(n) < 0.0001, solve (b - a)⁵ M / (180n⁴) < 0.0001 for n, then round up to the next even integer (Simpson's rule requires n to be even).

For the sin(x) problem: (π/2)⁵ / (180n⁴) < 0.0001 gives n⁴ > (π/2)⁵ / (180 · 0.0001) ≈ 53.0, so n > 2.70. The first even integer is n = 4.

For E(n) < 10⁻⁹: n⁴ > (π/2)⁵ / (180 · 10⁻⁹) ≈ 5.30 × 10⁷, so n > 85.3. The first even integer is n = 86.

Trapezoidal Rule Example (Problem 7)

Given data points: f(-0.5) = 7.870, f(-0.25) = 7.906, f(0) = 8.000, f(0.25) = 8.156, f(0.5) = 8.370, with n = 4 and h = 0.25.

T₄ = (0.25/2)[7.870 + 2(7.906) + 2(8.000) + 2(8.156) + 8.370]

= 0.125[7.870 + 15.812 + 16.000 + 16.312 + 8.370]

= 0.125 × 64.364 = 8.046

For the error bound, M = max|f''(x)| on [-0.5, 0.5]. Given f''(x) = e^{-x²}, which is maximised at x = 0 where e⁰ = 1. So M = 1.

E(4) = (0.5 - (-0.5))³ / (12 · 16) · 1 = 1/192 ≈ 0.005

The true value lies in [T₄ - E(4), T₄ + E(4)] = [8.041, 8.051].


Formulas

Simpson's rule:

Sₙ = (h/3)[f(x₀) + 4f(x₁) + 2f(x₂) + 4f(x₃) + ... + f(xₙ)], where h = (b - a)/n, n even

Simpson's rule error bound:

E(n) = (b - a)⁵ M / (180n⁴), where M = max|f''''(x)| on [a, b]

Trapezoidal rule:

Tₙ = (h/2)[f(x₀) + 2f(x₁) + 2f(x₂) + ... + 2f(xₙ₋₁) + f(xₙ)], where h = (b - a)/n

Trapezoidal rule error bound:

E(n) = (b - a)³ M / (12n²), where M = max|f''(x)| on [a, b]


Real-World Applications

Numerical integration is how engineers and scientists evaluate integrals that have no closed-form antiderivative, which is most real-world integrals. Simpson's rule is built into many scientific calculators and is the basis for more sophisticated quadrature methods used in finite element analysis, signal processing, and computational physics.


Common Misconceptions

  • Students forget that n must be even for Simpson's rule. If you solve for n and get an odd number, round up to the next even integer.

  • The error bound E(n) is a worst-case upper bound, not the actual error. The actual error is usually much smaller. Do not confuse the two.

  • When finding M, students sometimes evaluate the derivative at the endpoints only. M is the maximum of the absolute value of the derivative on the entire interval, which might occur at an interior point.

  • For the trapezoidal rule error bound, you need the second derivative. For Simpson's rule, the fourth derivative. Mixing these up gives a completely wrong bound.


Why It Matters / Exam Flags

⚠️ Expect a problem asking you to compute a Simpson's or trapezoidal approximation from given data points, find M, compute the error bound, and then determine the minimum n for a target accuracy. This is a multi-part problem that appears on nearly every Calc 2 exam.

⚠️ Finding M is where most students lose marks. Show your work: take the relevant derivative, find its absolute value, and determine where on the interval it is largest.

⚠️ When finding the first valid n, remember Simpson's rule requires n to be even. State this explicitly in your answer.


Quick Self-Test

  • True or false: Simpson's rule can be used with n = 5 subintervals. (Answer: False. n must be even for Simpson's rule.)

  • Fill in the blank: The Simpson's rule error bound depends on the _____ derivative of f. (Answer: fourth)

  • True or false: The actual error is always equal to the error bound E(n). (Answer: False. E(n) is an upper bound; the actual error is usually smaller.)

  • Fill in the blank: For the trapezoidal rule with n subintervals, the coefficient pattern is 1, 2, 2, ..., 2, _____. (Answer: 1)


Practice Q&A

Q: Using Simpson's rule with n = 4, approximate ∫₁⁴ (1/x) dx. The exact value is ln 4 ≈ 1.3863.

A: h = 3/4 = 0.75. Sample points: 1, 1.75, 2.5, 3.25, 4. Function values: 1, 0.5714, 0.4, 0.3077, 0.25. S₄ = (0.75/3)[1 + 4(0.5714) + 2(0.4) + 4(0.3077) + 0.25] = 0.25[1 + 2.2857 + 0.8 + 1.2308 + 0.25] = 0.25(5.5665) ≈ 1.3916.

Q: For f(x) = 1/x on [1, 4], find M for the Simpson's rule error bound.

A: f''''(x) = 24x⁻⁵ = 24/x⁵. This is positive and decreasing on [1, 4], so M = 24/1⁵ = 24.

Q: With M = 24 and [a, b] = [1, 4], compute E(4) for Simpson's rule.

A: E(4) = (4 - 1)⁵ · 24 / (180 · 4⁴) = 243 · 24 / (180 · 256) = 5832 / 46080 ≈ 0.1266.

Q: For the trapezoidal rule, if f''(x) = e^{-x²} and the interval is [-0.5, 0.5], what is M?

A: e^{-x²} is maximised when x² is minimised, i.e. at x = 0, where e⁰ = 1. So M = 1.


Connections to Other Topics

Numerical integration connects to Riemann sums from Calc 1 (the trapezoidal rule is a refinement of the midpoint/endpoint approach). It also leads into the study of Taylor series error bounds later in Calc 2, where a similar idea of bounding the remainder appears. In engineering courses, these methods underpin finite element analysis and numerical solutions to differential equations.


Related Terms / Search Tags

Simpson's rule, trapezoidal rule, numerical integration, error bound formula, fourth derivative, second derivative, approximate integral, n subintervals, Calc 2 numerical methods, NYU Calculus II PS2, Simpson's rule error, trapezoidal error bound, quadrature, composite Simpson's rule