Cases where Simpson’s rule has a greater error than Trapezoidal rule

calculusdefinite integralsintegrationreal-analysis

The error bound formulas for trapezoidal rule and simpson's rule say that:

$\begin{array}{l}{\text { Error Bound for the Trapezoid Rule: Suppose that }\left|f^{\prime \prime}(x)\right| \leq k \text { for some } k \in \mathbb{R} \text { where }} \\ {a \leq x \leq b . \text { Then }} \\ {\qquad\left|E_{T}\right| \leq k \frac{(b-a)^{3}}{12 n^{2}}} \\ {\text { Error Bound for Simpson's Rule: Suppose that }\left|f^{(4)}(x)\right| \leq k \text { for some } k \in \mathbb{R} \text { where }} \\ {a \leq x \leq b . \text { Then }} \\ {\qquad\left|E_{S}\right| \leq k \frac{(b-a)^{5}}{180 n^{4}}}\end{array}
$

Using these formulas, is it possible to find functions where Trapezoid Rule is more accurate than Simpson's rule? Maybe starting off with something like:

$k_T \frac{(b-a)^{3}}{12 n^{2}} \leq k_S \frac{(b-a)^{5}}{180 n^{4}}$

$k_T {15 n^{2}} \leq k_S {(b-a)^{2}}$

If we cant use this inequality. How can I identify functions where Trapezoidal rule is more accurate than Simpson's rule.

Best Answer

Note that "these formulas" give only an error estimate. The actual error may be much smaller.

In order to obtain an example where the formula for $E_S$ produces a larger error than the formula for $E_T$ consider the function $$f(x):=\sin(\omega x)\qquad(0\leq x\leq1)\ .$$ You then have $|f''(x)|\leq\omega^2$ and $|f^{(4)}(x)|\leq \omega^4$. This gives $$|E_T|\leq {\omega^2\over12 n^2},\qquad |E_S|\leq{\omega^4\over180 n^4}\ ,$$ so that the estimate for $E_S$ is worse than the estimate for $E_T$ as soon as $\omega^2\geq 15 n^2$.