Corrected trapezoidal method resources

2k Views Asked by At

I have been reading about the various numerical analysis methods for integrals, and I came across a mention of the "corrected trapezoidal rule", which I googled and found rather little about - mostly derivations of the error for this rule, which I don't really care about at the moment - I just want to learn about the rule itself!

The rule is, according to the mention, $$I(f) \approx CT_N = h\sum\limits_{i=1}\limits^{N-1}f_i + \frac{h}{2}\left(f_0+f_N\right)+\frac{h^2}{12}\left[f'(a) - f'(b)\right]$$

where $h$ is $(b-a)/N$ (what I've seen labelled elsewhere as $\Delta x$) and $N$ is the number of intervals.

Could you provide some good resources for learning about the corrected trapezoidal rule - preferably free, and even better if they are more applied-math-ish, and less theoretical. I don't need to know so much the derivation (though that might be interesting) but more how to use it. Even better would be if it had a section on using it cumulatively.

1

There are 1 best solutions below

0
On BEST ANSWER

I explain the origin of the corrected trapezoidal rule and how to apply it when you can not explictly compute the derivatives of $f$. A reference to a good text book is given at the end along with a new relevant question.


Let $f : [a,b] \rightarrow \mathbb{R}$ be a continuous function and let $T_h(f)$ denote the composite trapezoidal rule corresponding to the uniform stepsize $h$, i.e., $$T_h(f) = \sum_{j=0}^{n-1} \frac{h}{2} \Big [ f(x_j) + f(x_{j+1}) \Big ]$$ where $x_j = a + jh$ for $j=0,1,2,\dotsc,n$ and $nh = b-a$. Now, if $f$ is $2k+1$ times differentiable and $f^{(2k+1)}$ is continuous, then there exists real numbers $\alpha_j$ such that $$ I(f) - T_h(f) = \alpha_1 h^2 + \alpha_2 h^4 + \dots \alpha_k h^{2k} + O(h^{2k+1}), \quad h \rightarrow 0.$$ This is the celebrated Euler-Maclaurin formula. This error formula is an example of an asymptotic error expansion. It is the theoretical foundation of Richardson extrapolation. The primary error term, i.e., $\alpha_1h^2$ is dominant for sufficiently small values of $h$. It can be approximated using Richardson's error estimate $$E_h^{\text{est}} = \frac{T_h - T_{2h}}{3}.$$ In fact, we have $$ \alpha_1 h^2 = \frac{T_h - T_{2h}}{3} + O(h^4).$$ Exact formulas for $\alpha_j$ are known, but require knowlegde of the derivatives of $f$. In particular, we have $$ \alpha_1 = - \frac{1}{12} \Big[ f'(b) - f'(a) \Big].$$ This is the origin of the corrected trapezoidal rule. If $f'$ is available, then one computes $$ CT_h(f) = T_h(f) + \frac{1}{12} \Big[ f'(b) - f'(a) \Big] h^2.$$ By design, the corrected trapezoidal rule satisfies the asymptotic error expansion $$ I(f) - CT_h(f) = \alpha_2 h^4 + \dotsc + \alpha_k h^{2k} + O(h^{2k+1}), \quad h \rightarrow 0.$$ In particular, the primary error term is $O(h^4)$ rather than $O(h^2)$. If $f'$ is not explicitly available, then we must approximate $f'$. By Taylor's formula, we have $$ D_h(a) = \frac{-3 f(a) + 4 f(a+h) - f(a+2h)}{2h} = f'(a) + O(h^2)$$ and similarly $$ D_h(b) = \frac{f(b-2h) - 4f(b-h) + 3f(b)}{2h} = f'(b) + O(h^2).$$ Instead of $CT_h(f)$, we can compute an approximation, say $$ A_h(f) = T_h(f) + \frac{1}{12} \Big[ D_h(b) - D_h(a) \Big] h^2.$$ Like the corrected trapezoidal rule it will satisfy an asymptotic error expansion where the primary error term is $O(h^4)$.


In principle, the above takes care of your explicitly stated question, i.e., "How do I apply the corrected trapezoidal rule when I can not compute the derivatives explicitly". The textbook "Numerical Analysis" by Kincaid and Cheney is a a very good textbook which includes the Euler-Maclaurin formula. You will need a copy of the 2nd edition, as the proof was dropped from, say, the 6th edition. The proof requires integration by parts and the mean value theorem of integration.

However, what you really need is the answer to the following question: "How do I estimate the error when I integrate numerically using my favorite rule and how do I decide that the error estimates are reliable?" This would be a good new question. It would be critical to include a description of the properties of the function $f$. In particular, how many times can it be differentiated.