chapt 1.11 clp_2 for UBC math 101 for MATH 101 A

Lesson

Understanding Error Bounds

In the previous lesson, we learned how to approximate integrals using the Midpoint, Trapezoidal, and Simpson's Rules. But how accurate are these approximations? Error bounds tell us the worst-case error — the maximum amount our approximation could be off.

This is incredibly useful: instead of computing the exact integral (which might be impossible), we can guarantee our approximation is within a certain tolerance.


The Error Bound Formulas

For Midpoint and Trapezoidal Rules

If $|f''(x)| \leq M$ for all $x$ in $[a, b]$, then:

Midpoint Rule Error: $$|E_M| \leq \frac{M(b-a)^3}{24n^2}$$

Trapezoidal Rule Error: $$|E_T| \leq \frac{M(b-a)^3}{12n^2}$$

For Simpson's Rule

If $|f^{(4)}(x)| \leq L$ for all $x$ in $[a, b]$, then:

Simpson's Rule Error: $$|E_S| \leq \frac{L(b-a)^5}{180n^4}$$


Key Observations

  1. Midpoint is twice as accurate as Trapezoidal (24 vs 12 in denominator)
  2. Simpson's error decreases much faster as $n$ increases ($n^4$ vs $n^2$)
  3. You need the second derivative for Midpoint/Trapezoidal, but the fourth derivative for Simpson's

Finding M: The Maximum of |f''(x)|

To use the error bounds, you first need to find $M$ — an upper bound for $|f''(x)|$ on $[a, b]$.

Strategy:

  1. Compute $f''(x)$
  2. Find where $|f''(x)|$ is largest on $[a, b]$
  3. This might be at a critical point or at an endpoint

Example 1: Finding M for a Polynomial

Problem: Find $M$ such that $|f''(x)| \leq M$ on $[0, 2]$ for $f(x) = x^3$.

$$f(x) = x^3$$ $$f'(x) = 3x^2$$ $$f''(x) = 6x$$

On $[0, 2]$: $f''(x) = 6x$ ranges from $f''(0) = 0$ to $f''(2) = 12$.

So $|f''(x)| \leq 12$ on $[0, 2]$.

$$\boxed{M = 12}$$


Example 2: Finding M for an Exponential

Problem: Find $M$ such that $|f''(x)| \leq M$ on $[0, 1]$ for $f(x) = e^x$.

$$f(x) = e^x$$ $$f'(x) = e^x$$ $$f''(x) = e^x$$

Since $e^x$ is increasing, its maximum on $[0, 1]$ is at $x = 1$:

$$|f''(x)| \leq e^1 = e \approx 2.718$$

$$\boxed{M = e}$$


Example 3: Computing the Error Bound

Problem: Use $n = 4$ subintervals with the Trapezoidal Rule to approximate $\displaystyle\int_0^1 e^x \, dx$. Find the error bound.

From Example 2, we know $M = e$ for $f(x) = e^x$ on $[0, 1]$.

Using the Trapezoidal error bound:

$$|E_T| \leq \frac{M(b-a)^3}{12n^2}$$

$$= \frac{e(1-0)^3}{12(4)^2} = \frac{e}{12 \cdot 16} = \frac{e}{192}$$

$$\approx \frac{2.718}{192} \approx 0.0142$$

$$\boxed{|E_T| \leq \frac{e}{192} \approx 0.0142}$$

This means the Trapezoidal approximation is guaranteed to be within 0.0142 of the true value.


Example 4: Comparing Midpoint vs Trapezoidal Error

Problem: For $\displaystyle\int_0^1 e^x \, dx$ with $n = 4$, compare the error bounds for Midpoint and Trapezoidal rules.

We have $M = e$, $a = 0$, $b = 1$, $n = 4$.

Trapezoidal: $$|E_T| \leq \frac{e(1)^3}{12(16)} = \frac{e}{192} \approx 0.0142$$

Midpoint: $$|E_M| \leq \frac{e(1)^3}{24(16)} = \frac{e}{384} \approx 0.0071$$

$$\boxed{\text{Midpoint error bound is half of Trapezoidal: } 0.0071 \text{ vs } 0.0142}$$


Finding L: The Maximum of |f⁽⁴⁾(x)|

For Simpson's Rule, you need the fourth derivative.


Example 5: Finding L for Simpson's Rule

Problem: Find $L$ such that $|f^{(4)}(x)| \leq L$ on $[0, 1]$ for $f(x) = e^x$.

For $f(x) = e^x$, all derivatives are $e^x$:

$$f^{(4)}(x) = e^x$$

Maximum on $[0, 1]$ is at $x = 1$: $|f^{(4)}(x)| \leq e$.

$$\boxed{L = e}$$


Example 6: Simpson's Rule Error Bound

Problem: Find the error bound for Simpson's Rule with $n = 4$ for $\displaystyle\int_0^1 e^x \, dx$.

We have $L = e$, $a = 0$, $b = 1$, $n = 4$.

$$|E_S| \leq \frac{L(b-a)^5}{180n^4}$$

$$= \frac{e(1)^5}{180(4)^4} = \frac{e}{180 \cdot 256} = \frac{e}{46080}$$

$$\approx \frac{2.718}{46080} \approx 0.000059$$

$$\boxed{|E_S| \leq \frac{e}{46080} \approx 0.00006}$$

Compare: With the same $n = 4$:

  • Trapezoidal error bound: ~0.0142
  • Midpoint error bound: ~0.0071
  • Simpson's error bound: ~0.00006

Simpson's is about 240 times more accurate!


Reverse Problem: Finding n for a Given Accuracy

Sometimes you need to find how many subintervals guarantee a certain accuracy.


Example 7: Finding n for Trapezoidal Rule

Problem: How many subintervals are needed so the Trapezoidal Rule approximates $\displaystyle\int_0^1 e^x \, dx$ with error less than $0.0001$?

We need $|E_T| \leq 0.0001$.

$$\frac{M(b-a)^3}{12n^2} \leq 0.0001$$

$$\frac{e(1)^3}{12n^2} \leq 0.0001$$

$$\frac{e}{12n^2} \leq 0.0001$$

$$n^2 \geq \frac{e}{12 \cdot 0.0001} = \frac{e}{0.0012}$$

$$n^2 \geq \frac{2.718}{0.0012} \approx 2265$$

$$n \geq \sqrt{2265} \approx 47.6$$

Since $n$ must be a whole number:

$$\boxed{n \geq 48}$$


Example 8: Finding n for Simpson's Rule

Problem: How many subintervals are needed so Simpson's Rule approximates $\displaystyle\int_0^1 e^x \, dx$ with error less than $0.0001$?

We need $|E_S| \leq 0.0001$.

$$\frac{L(b-a)^5}{180n^4} \leq 0.0001$$

$$\frac{e}{180n^4} \leq 0.0001$$

$$n^4 \geq \frac{e}{180 \cdot 0.0001} = \frac{e}{0.018}$$

$$n^4 \geq \frac{2.718}{0.018} \approx 151$$

$$n \geq \sqrt[4]{151} \approx 3.5$$

Since $n$ must be an even whole number for Simpson's Rule:

$$\boxed{n \geq 4}$$

Compare: For the same accuracy (0.0001):

  • Trapezoidal needs $n \geq 48$
  • Simpson's needs only $n \geq 4$

Example 9: Trigonometric Function

Problem: Find the error bound for the Midpoint Rule with $n = 6$ for $\displaystyle\int_0^{\pi} \sin x \, dx$.

Step 1: Find M

$$f(x) = \sin x$$ $$f'(x) = \cos x$$ $$f''(x) = -\sin x$$

So $|f''(x)| = |\sin x| \leq 1$ on any interval.

$$M = 1$$

Step 2: Apply the error bound

$$|E_M| \leq \frac{M(b-a)^3}{24n^2}$$

$$= \frac{1 \cdot \pi^3}{24 \cdot 36} = \frac{\pi^3}{864}$$

$$\approx \frac{31.006}{864} \approx 0.0359$$

$$\boxed{|E_M| \leq \frac{\pi^3}{864} \approx 0.036}$$


Example 10: Finding n for a Polynomial

Problem: How many subintervals does the Trapezoidal Rule need to approximate $\displaystyle\int_0^2 x^4 \, dx$ with error less than $0.01$?

Step 1: Find M

$$f(x) = x^4$$ $$f'(x) = 4x^3$$ $$f''(x) = 12x^2$$

On $[0, 2]$: maximum of $12x^2$ is at $x = 2$: $12(4) = 48$.

$$M = 48$$

Step 2: Solve for n

$$\frac{48(2)^3}{12n^2} \leq 0.01$$

$$\frac{48 \cdot 8}{12n^2} \leq 0.01$$

$$\frac{384}{12n^2} \leq 0.01$$

$$\frac{32}{n^2} \leq 0.01$$

$$n^2 \geq 3200$$

$$n \geq \sqrt{3200} \approx 56.6$$

$$\boxed{n \geq 57}$$


Quick Reference

Method Error Bound Derivative Needed
Midpoint $\dfrac{M(b-a)^3}{24n^2}$ $f''(x)$
Trapezoidal $\dfrac{M(b-a)^3}{12n^2}$ $f''(x)$
Simpson's $\dfrac{L(b-a)^5}{180n^4}$ $f^{(4)}(x)$

Common Mistakes and Misunderstandings

❌ Mistake: Using M instead of L for Simpson's Rule

Wrong: Using $|f''(x)| \leq M$ in Simpson's error formula.

Why it's wrong: Simpson's Rule error depends on the fourth derivative, not the second.

Correct: Find $L$ such that $|f^{(4)}(x)| \leq L$ for Simpson's Rule.


❌ Mistake: Forgetting to maximize over the interval

Wrong: Just plugging in $f''(a)$ or $f''(b)$ without checking which is larger.

Why it's wrong: $M$ must be an upper bound for $|f''(x)|$ on the entire interval. The maximum might be at an interior point.

Correct: Check endpoints AND any critical points of $f''(x)$ inside $[a, b]$.


❌ Mistake: Forgetting n must be even for Simpson's Rule

Wrong: Concluding $n \geq 3.5$, so $n = 4$ works.

Why it's wrong: While this happens to give an even answer, you must explicitly check. If you got $n \geq 3.1$, you'd need $n = 4$ (not $n = 3$).

Correct: After solving for $n$, round up to the next even integer for Simpson's Rule.


❌ Mistake: Confusing error bound with actual error

Wrong: "The error is exactly 0.0142."

Why it's wrong: The error bound is a worst-case guarantee. The actual error is usually smaller.

Correct: "The error is at most 0.0142" or "The error is bounded by 0.0142."

Formulas & Reference

Midpoint Rule Error Bound

$$|E_M| \leq \frac{M(b-a)^3}{24n^2}$$

Maximum error for the Midpoint Rule, where M is an upper bound for |f''(x)| on [a, b].

Variables:
$|E_M|$:
absolute error of midpoint approximation
$M$:
upper bound such that |f''(x)| ≤ M on [a, b]
$n$:
number of subintervals

Trapezoidal Rule Error Bound

$$|E_T| \leq \frac{M(b-a)^3}{12n^2}$$

Maximum error for the Trapezoidal Rule, where M is an upper bound for |f''(x)| on [a, b]. Note: denominator is 12 (vs 24 for Midpoint), so Trapezoidal has twice the error bound.

Variables:
$|E_T|$:
absolute error of trapezoidal approximation
$M$:
upper bound such that |f''(x)| ≤ M on [a, b]
$n$:
number of subintervals

Simpson's Rule Error Bound

$$|E_S| \leq \frac{L(b-a)^5}{180n^4}$$

Maximum error for Simpson's Rule, where L is an upper bound for |f⁽⁴⁾(x)| on [a, b]. Uses the fourth derivative and n⁴, making it much more accurate.

Variables:
$|E_S|$:
absolute error of Simpson's approximation
$L$:
upper bound such that |f⁽⁴⁾(x)| ≤ L on [a, b]
$n$:
number of subintervals (must be even)
Courses Using This Skill

This skill is taught in the following courses. Create an account to access practice exercises and full course materials.