Error Analysis in Numerical Integration: Learn It 2

Error Bounds for the Midpoint and Trapezoidal Rules

In practice, you won’t always know the exact value of an integral you’re approximating. That’s why we need error bounds—formulas that tell you the maximum possible error in your approximation without knowing the true answer.

error bounds for the midpoint and trapezoidal rules

Let [latex]f(x)[/latex] be continuous on [latex][a,b][/latex] with a second derivative [latex]f''(x)[/latex]. If [latex]M[/latex] is the maximum value of [latex]|f''(x)|[/latex] on [latex][a,b][/latex], then:

  • Midpoint Rule Error: [latex]\text{Error in } M_n \leq \frac{M(b-a)^3}{24n^2}[/latex]
  • Trapezoidal Rule Error: [latex]\text{Error in } T_n \leq \frac{M(b-a)^3}{12n^2}[/latex]

where [latex]n[/latex] is the number of subintervals.

You can use these formulas to determine how many subintervals you need to guarantee your error stays below a certain threshold. This involves solving inequalities.

Rules for Solving Inequalities
[latex]\\[/latex]
The process of solving an inequality is similar to solving an equation by isolating the variable. There are several rules to keep in mind when solving these inequalities.

  1. Adding or subtracting the same number to both sides of an inequality yields an equivalent statement.
  2. Multiplying or dividing the same positive number to both sides of an inequality yields an equivalent statement.
  3. Multiplying or dividing a negative number to both sides of an inequality reverses the direction of the inequality.
  4. If [latex]x^n \le a \: \text{and}\:x\ge0[/latex]  then [latex]x \le \sqrt[n] {a}[/latex]
These error bound formulas reveal several important patterns.

  • The error decreases as [latex]n^2[/latex], so doubling the number of subintervals reduces the error by a factor of 4
  • The trapezoidal rule has twice the error bound of the midpoint rule (notice the 12 vs 24 in the denominators)
  • Larger intervals [latex](b-a)[/latex] and functions with larger second derivatives lead to bigger errors

What value of [latex]n[/latex] should be used to guarantee that an estimate of [latex]{\displaystyle\int }_{0}^{1}{e}^{{x}^{2}}dx[/latex] is accurate to within 0.01 if we use the midpoint rule?

Watch the following video to see the worked solution to the example above.

You can view the transcript for “3.6.3” here (opens in new window).