Tutorials › Calculus II › Bounding Curvature for Trapezoidal Error

Quadrature and Error Bounds · Tutorial 355 of 998

Bounding Curvature for Trapezoidal Error

Find and verify a usable curvature bound, then turn it into a guaranteed error bound for a composite trapezoidal approximation.

Intermediate 10 min read

What You'll Learn

  • State the conditions needed to apply the composite trapezoidal error estimate.
  • Choose a constant that bounds the absolute second derivative throughout an interval.
  • Use interval inequalities to verify a bound rather than relying on endpoint values.
  • Apply the curvature bound to calculate a guaranteed trapezoidal error.
  • Recognize when a valid bound is unnecessarily large or incorrectly justified.

Why Curvature Bounds Matter

The composite trapezoidal rule estimates an integral using function values at equally spaced points. Its error estimate depends on how large the function’s second derivative can be over the whole interval. The challenge in using the estimate is therefore not just differentiating twice: it is finding a constant that is guaranteed to bound the absolute second derivative everywhere on the interval.

A bound does not need to be the smallest possible one. It does need to be valid throughout the interval. A valid but loose bound still gives a guarantee; a bound that fails at even one point does not.

Definition: If \(f\) has a continuous second derivative on \([a,b]\), a number \(M\ge 0\) is a curvature bound on \([a,b]\) when \(|f''(x)|\le M\) for every \(x\in[a,b]\).

The Error Estimate and Its Requirements

For the composite trapezoidal rule with \(n\) equal panels, let \(T_n\) denote the approximation to \(\int_a^b f(x)\,dx\). If \(f\) has a continuous second derivative on \([a,b]\), and \(|f''(x)|\le M\) throughout that interval, the composite trapezoidal error estimate is

$$ \left|\int_a^b f(x)\,dx-T_n\right| \le \frac{(b-a)^3}{12n^2}M. $$

Here \(n\) is a positive integer, and \(M\) is any valid curvature bound. If \(h=(b-a)/n\) is the panel width, the same estimate can be written as \(\frac{(b-a)h^2}{12}M\). The earlier material on the composite trapezoidal error bound establishes this estimate; the task here is to determine a suitable \(M\).

For a continuous function \(f''\) on a closed, bounded interval, \(|f''|\) attains a maximum there. Thus the smallest valid bound is \(M=\max_{a\le x\le b}|f''(x)|\). In practice, finding that exact maximum may take more work than needed. Any simpler upper bound that holds everywhere can be substituted into the estimate.

A Practical Method for Finding a Bound

Start by differentiating twice and then use information valid on the entire interval. Common tools include known ranges of elementary functions, monotonicity, denominator lower bounds, and the triangle inequality. If the interval crosses a point where the expression changes sign, split the interval into pieces or bound its absolute value directly.

1
Differentiate twice.
Write down \(f''(x)\) and identify the factors that can vary across the interval.
2
Take the absolute value.
Bound \(|f''(x)|\), not merely \(f''(x)\). A negative second derivative can have a large absolute value.
3
Use interval-wide inequalities.
Justify each bound for every \(x\in[a,b]\). Endpoint checks alone do not generally establish a maximum.
4
Substitute into the error estimate.
Use the panel count \(n\), interval length \(b-a\), and a bound \(M\) verified on the full interval.

Worked Example: Exponential Curvature on a Unit Interval

Worked Example: Exponential Curvature on a Unit Interval

Find a curvature bound for \(f(x)=e^x\) on \([0,1]\), then use it to bound the composite trapezoidal error with \(n=2\) panels.

Differentiate twice:

$$ f'(x)=e^x,\qquad f''(x)=e^x. $$

On \([0,1]\), \(e^x\) is positive and increasing. Its largest value on this interval is \(e^1=e\), so \(|f''(x)|=e^x\le e\) throughout. We can therefore take \(M=e\).

The interval length is \(b-a=1\), and \(n=2\). Substitution gives

$$ \left|\int_0^1 e^x\,dx-T_2\right| \le \frac{1^3}{12(2)^2}e =\frac{e}{48} \approx 0.056631. $$

As a check, the two-panel trapezoidal approximation has \(h=1/2\) and is

$$ T_2=\frac{h}{2}\left[f(0)+2f(1/2)+f(1)\right] =\frac14\left(1+2\sqrt e+e\right) \approx 1.753931. $$

The exact integral is \(\int_0^1e^x\,dx=e-1\approx1.718282\). Thus the actual absolute error is approximately \(1.753931-1.718282=0.035649\), which is less than the guaranteed bound \(0.056631\). The bound is conservative, as an error estimate may be.

Bounding a Rational Second Derivative

Rational expressions often require more care: a numerator may change sign, and the denominator may provide a useful lower bound. It is important to bound the absolute value of the whole expression, rather than treating a signed numerator as though it were always positive.

Worked Example: A Rational Function on \([0,1]\)

For \(f(x)=\frac{1}{1+x^2}\), find a valid curvature bound on \([0,1]\), then use it for \(n=3\) panels.

Differentiating,

$$ f'(x)=-\frac{2x}{(1+x^2)^2}, \qquad f''(x)=\frac{6x^2-2}{(1+x^2)^3}. $$

Set \(t=x^2\). Since \(0\le x\le1\), we have \(0\le t\le1\), and

$$ |f''(x)|=\frac{|6t-2|}{(1+t)^3}. $$

For \(0\le t\le 1/3\), the numerator’s absolute value is \(2-6t\), which is at most \(2\), while \((1+t)^3\ge1\). Hence \(|f''(x)|\le2\) on that part of the interval.

For \(1/3\le t\le1\), we have \(0\le6t-2\le4\) and \((1+t)^3\ge(4/3)^3=64/27\). Therefore,

$$ |f''(x)| \le \frac{4}{64/27} =\frac{27}{16} <2. $$

Together, these inequalities prove \(|f''(x)|\le2\) throughout \([0,1]\), so take \(M=2\). With \(b-a=1\) and \(n=3\),

$$ \left|\int_0^1 \frac{1}{1+x^2}\,dx-T_3\right| \le \frac{1^3}{12(3)^2}(2) =\frac{1}{54} \approx 0.018519. $$

As a numerical check, the trapezoidal estimate is

$$ T_3=\frac16\left[f(0)+2f(1/3)+2f(2/3)+f(1)\right] =\frac16\left(1+\frac{18}{10}+\frac{18}{13}+\frac12\right) =\frac{203}{260} \approx0.780769. $$

The exact integral is \(\arctan(1)-\arctan(0)=\pi/4\approx0.785398\). The absolute error is approximately \(0.004629\), below \(1/54\). The inequalities above, not the numerical check, establish that \(M=2\) is valid.

Using Standard Function Bounds

Sometimes a concise bound is more useful than a tight one. If the second derivative is a sum or product, standard inequalities can bound it without finding its exact maximum. For example, \(|\sin u|\le1\) and \(|\cos u|\le1\) for every real \(u\). The triangle inequality then gives \(|A+B|\le|A|+|B|\), allowing separate terms to be bounded and added.

Worked Example: A Trigonometric Composition

For \(f(x)=\sin(x^2)\) on \([0,1]\), find a curvature bound and use it with \(n=5\).

The chain rule gives

$$ f'(x)=2x\cos(x^2), \qquad f''(x)=2\cos(x^2)-4x^2\sin(x^2). $$

For \(0\le x\le1\), the trigonometric factors have absolute value at most \(1\), and \(x^2\le1\). Therefore,

$$ |f''(x)| \le 2|\cos(x^2)|+4x^2|\sin(x^2)| \le 2+4=6. $$

This proves that \(M=6\) is valid on the whole interval. Since \(b-a=1\) and \(n=5\),

$$ \left|\int_0^1\sin(x^2)\,dx-T_5\right| \le\frac{1^3}{12(5)^2}(6) =\frac{1}{50} =0.02. $$

The final substitution checks the bound’s value: \(6/(12\cdot25)=6/300=1/50\). This estimate does not require calculating the trapezoidal sum; it certifies the maximum possible error for that sum.

Common Pitfalls

Common mistake: Using the largest value of \(f''(x)\) rather than a bound for \(|f''(x)|\). For example, if \(f''(x)=-5\) throughout an interval, then \(f''(x)\le0\), but \(|f''(x)|=5\). Substituting \(M=0\) because the second derivative is negative would claim zero error, which is not justified. The correction is to bound the absolute value: here, \(M=5\).

Another tempting shortcut is to inspect only the interval endpoints. The largest absolute value can occur inside the interval, so endpoint values alone are insufficient unless an additional argument proves that they control the entire interval. A third pitfall is to substitute a valid bound for \(f''\) without taking its absolute value. The error estimate requires a nonnegative \(M\) satisfying \(|f''(x)|\le M\) at every point.

A bound can also be correct but unnecessarily large. In the trigonometric example, separate worst-case bounds on the sine and cosine terms may not occur at the same \(x\). That does not invalidate \(M=6\); it only means the estimate may be conservative. Tightening a bound is useful when practical, but proving that a bound holds everywhere comes first.

Check Your Understanding

For each question, pay attention to whether the proposed bound applies throughout the specified interval.

  1. What two conditions on \(f\) and \(M\) are needed to use the composite trapezoidal error estimate?
  2. If \(|f''(x)|\le7\) on \([2,5]\) and \(n=3\), what upper bound does the estimate give for the absolute error?
  3. Why does checking \(|f''|\) at only the endpoints not generally prove a curvature bound?
  4. If \(f''(x)\le0\) throughout an interval, does that alone imply \(M=0\)? Explain.
  5. For \(g(x)=\cos x\) on \([0,\pi]\), use a standard trigonometric inequality to give a valid curvature bound \(M\).