logo

Trapezoidal Rule 📂Numerical Analysis

Trapezoidal Rule

Definition

20190611_151146.png

Let’s assume f:[a,b]Rf : [a,b] \to \mathbb{R} is integrable over [a,b][a,b] and [a,b][a,b] is divided into nodes at intervals of h:=ban\displaystyle h:= {{b-a} \over {n}}, like a=x0<<xn=ba = x_{0} < \cdots < x_{n} = b. The numerical integration operator In1I_{n}^{1}, defined as follows, is called the trapezoidal rule. In1(f):=k=1nh2(f(xk1)+f(xk)) I_{n}^{1} (f) := \displaystyle \sum_{k=1}^{n} {{h} \over {2}} \left( f(x_{k-1}) + f(x_{k} ) \right)

Theorem

Let’s say fC2[a,b]f \in C^2 [a,b]. The error E11E_{1}^{1} and the asymptotic error E~n1\tilde{E}_{n}^{1} of the trapezoidal rule can be summarized as follows:

  • [1]: E11(f)=112h3f(ξ)E_{1}^{1} (f) = - {{1} \over {12}} h^{3} f '' ( \xi )
  • [2]: E~n1(f)=h212[f(b)f(a)]\tilde{E}_{n}^{1} (f) = - {{ h^2 } \over {12}} [ f '(b) - f '(a) ]

Explanation

If we expand In1(f)I_{n}^{1} (f), it can be written as follows: In1(f)=h[12f(x0)+f(x1)++f(xn1)+12f(xn)] I_{n}^{1} (f) = h \left[ {{1} \over {2}} f(x_{0}) + f ( x_{1} ) + \cdots + f ( x_{n-1} ) + {{1} \over {2}} f(x_{n} ) \right] The trapezoidal rule is one of the simplest methods for calculating the numerical integration of a definite integral I(f)=abf(x)dx\displaystyle I (f) = \int_{a}^{b} f(x) dx. This method can be easily thought of even if one only knows about the method of finite sums.

Proof 1

[1]

Strategy: Since the trapezoid is a linear interpolation of the given function, we can use the properties of polynomial interpolation.


I11(f):=(ba2)[f(a)+f(b)] I_{1}^{1} (f) := \left( {{ b - a } \over { 2 }} \right) [ f(a) + f(b) ] This can be regarded as approximating the integral of the function by linearly interpolating ff over the interval [a,b][a,b] to I(f)I(f). Then, the error En1(f)E_{n}^{1} (f) between the actual I(f)I(f) and I11(f)I_{1}^{1} (f) for some ξ[a,b]\xi \in [a,b] is computed as follows.

Polynomial interpolation:

  • [4] Error with the actual function: For a function (n+1)(n+1) times differentiable over f:RRf : \mathbb{R} \to \mathbb{R} and for some ξH{x0,,xn}\xi \in \mathscr{H} \left\{ x_{0} , \cdots , x_{n} \right\}, the polynomial interpolation pnp_{n} of ff satisfies the following for some tRt \in \mathbb{R}: f(t)pn(t)=(tx0)(txn)(n+1)!f(n+1)(ξ) f(t) - p_{n} (t) = {{ (t - x_{0}) \cdots (t - x_{n}) } \over { (n+1)! }} f^{(n+1)} ( \xi )

E11(f):=I(f)I11(f)=ab[f(x)f(b)(xa)f(a)(xb)ba]dx=ab[f(x)p1(x)]dx=12f(ξ)ab(xa)(xb)dx=[12f(ξ)][16(ba)3]=112(ba)3f(ξ)=112h3f(ξ) \begin{align*} E_{1}^{1} (f) :=& I(f) - I_{1}^{1} (f) \\ =& \int_{a}^{b} \left[ f(x) - {{ f(b) ( x - a ) - f(a) (x - b) } \over { b - a }} \right] dx \\ =& \int_{a}^{b} \left[ f(x) - p_{1} (x) \right] dx \\ =& {{1} \over {2}} f '' ( \xi ) \int_{a}^{b} (x-a) (x-b) dx \\ =& \left[ {{1} \over {2}} f '' ( \xi ) \right] \left[ - {{1} \over {6}} (b-a)^{3} \right] \\ =& - {{1} \over {12}} (b-a)^{3} f '' ( \xi ) \\ =& - {{1} \over {12}} h^{3} f '' ( \xi ) \end{align*}

[2]

Strategy: If we derive the Riemann sums, what follows naturally deduces from the Fundamental Theorem of Calculus.


According to Theorem [1], the error between the actual I(f)I(f) and In1(f)I_{n}^{1} (f) for some ξk[xk1,xk]\xi_{k} \in [x_{k-1}, x_{k} ] is computed as follows: En1(f)=I(f)In1(f)=k=1n(h312f(ξk)) \begin{align*} \displaystyle E_{n}^{1} (f) =& I (f) - I_{n}^{1} (f) \\ =& \sum_{k=1}^{n} \left( - {{ h^3 } \over { 12 }} f '' ( \xi_{k} ) \right) \end{align*} Regarding this, limnEn1(f)h2=limn1h2k=1n(h312f(ξk))=112limnk=1nhf(ξk)=112abf(x)dx=112[f(b)f(a)] \begin{align*} \lim_{n \to \infty} {{ E_{n}^{1} (f) } \over { h^2 }} =& \lim_{n \to \infty} {{1} \over {h^2}} \sum_{k=1}^{n} \left( - {{ h^3 } \over { 12 }} f '' ( \xi_{k} ) \right) \\ =& - {{ 1 } \over { 12 }} \lim_{ n \to \infty} \sum_{k=1}^{n} h f '' ( \xi_{k} ) \\ =& - {{ 1 } \over { 12 }} \int_{a}^{b} f ''(x) dx \\ =& - {{ 1 } \over { 12 }} [ f '(b) - f '(a) ] \end{align*} Therefore, limnE~n(f)En(f)=1 \lim_{n \to \infty} {{\tilde{E}_{n} (f) } \over { E_{n} (f) }} = 1

En1(f)E~n1(f)=h212[f(b)f(a)] E_{n}^{1} (f) \approx \tilde{E}_{n}^{1} (f) = - {{ h^2 } \over { 12 }} [ f '(b) - f '(a) ]


  1. Atkinson. (1989). An Introduction to Numerical Analysis(2nd Edition): p253. ↩︎