As simplest polynomial interpolation, consider a linear approximation, i.e. the secant through the points \((a; f(a))\) and \((b; f(b))\). Then, to approximate the area under the curve, one calculates the area of the trapezoid with vertices \((a; 0)\), \((b; 0)\), \((b; f(b))\), \((a; f(a))\), which obviously is
| \begin{equation*} T(f)=(b-a)\frac{f(a)+f(b)}{2}\,. \end{equation*} | (6.3) |
If one splits the full interval \([a, b]\) into \(n\) subintervals of equal length, one can apply the trapezoidal rule for each of the subintervals, which significantly improves the approximation. To this end, we define
| \begin{equation*}\label{eq:h_n} \begin{split} h_n&=\frac{b-a}{n}, \\ x_0&=a, \ x_1=a+h_n, \ x_2=a+2h_n, \ \ldots, \ x_n=b. \end{split} \end{equation*} | (6.4) |
| \begin{equation*} |I(f)-T_n(f)|=n\,\frac{h_n^3}{12}|f''(\epsilon_n)|= \frac{1}{12}\,\frac{(b-a)^3}{n^2}|f''(\epsilon_n)|;\ \ \ \epsilon_n\in[a,b]. \end{equation*} | (6.6) |
It follows from Theorem 1 that doubling the number of sub intervals approximately quarters
the absolute error of the trapezoidal rule.
Example:
Consider the following analytically determined integral of
the function \(f(x)=\frac{1}{1+x}\):
| \begin{equation*} I(f)=\int\limits_0^1\frac{{\rm d}x}{1+x}=\left.\ln(1+x)\rule{0mm}{1.0em}\right|_0^1=\ln(2)-\ln(1)=\ln(2)\approx 0.69314718. \end{equation*} | (6.7) |
Applying the trapezoidal rule directly to this interval (\(a=0\), \(b=1\)) yields
| \begin{equation*} T_1(f)=(1-0)\frac{\frac{1}{1+0}+\frac{1}{1+1}}{2}=\frac{3}{4}=0.75. \end{equation*} | (6.8) |
This result has an absolute error of about \(\left|I(f)-T_1(f)\right|\approx0.057\) (relative error \(\approx 8\) %). To improve the approximation, we divide the interval \([a,b]\) into two subintervals, by which the error should roughly be reduced by a factor of \(1/4\):
![]() |
![]() |
![]() |
![]() |
© J. Carstensen (Comp. Math.)