0
$\begingroup$

I am trying to derive Truncation Error $=\frac{(b-a)h^2}{12} \max{|f''(z)|}$ for Trapezoidal rule of integration by using Taylor's Remainder term

My Approach:
In trapezoidal rule of integration, we divide the interval of integration $[a,b]$ into $n$ equal length sub-intervals and then approximate the function as first degree polynomial to connect the intermediate points.
Let $f(x)$ be the given function, then the Taylor series of $f(x)$ is given by:$$f(x)=f(\alpha)+ (x-\alpha)f'(\alpha) + \frac{(x-\alpha)^2}{2!}f''(\alpha) + \frac{(x-\alpha)^3}{3!}f''(\alpha) + \dots$$ We know:$$\text{Taylor's Remainder Term}: R_{n+1}(x;c)=\frac{(x-c)^{n+1}}{(n+1)!}f^{n+1}(z)$$ where $z$ is a point between $c$ and $x$
So, here
$(n+1)=2$ , $x \in [a,b]$, $c=(x-h)$and $z\in(x-h,x)$ ,where $h= \frac{b-a}{n}$ $$\implies R_2(x,x-h)=\frac{(x-(x-h))^{2}}{(2)!}f''(z)$$ $$=\frac{(h)^{2}}{2}f''(z) \dots (i)$$ so, the largest possible error $=\max|R_2(x,x-h)|$ $$=\frac{(h)^{2}}{2} \max|f''(z)| \dots(ii)$$ But Truncation Error $=\frac{(b-a)h^2}{12} \max{|f''(z)|}$,
so did i missed anything?? please help anyone...

$\endgroup$
  • 1
    $\begingroup$ Where is your $\int$? You are estimating the truncation error of an integral yet no integral appears here. $\endgroup$ – xbh Dec 15 '18 at 5:32
  • $\begingroup$ Using the Taylor's approximation is messy. An easier way is to apply integration by parts to estimate the local error $E_n = \frac{h}{2}[f(x_n) + f(x_{n+1})] - \int_{x_n}^{x_{n+1}} f(x) \, dx$ $\endgroup$ – RRL Dec 15 '18 at 5:38
2
$\begingroup$

You need to first obtain a local approximation over a subinterval.

The error in approximating the integral on a subinterval $[x_n, x_{n+1}]$ with $h = x_{n+1} - x_n$ using the trapezoidal formula is

$$E_n = \frac{h}{2}[f(x_n) + f(x_{n+1})] - \int_{x_n}^{x_{n+1}} f(x) \, dx.$$

Integration by parts shows this to be

$$E_n = \int_{x_n}^{x_{n+1}}(x-c)f'(x) \, dx,$$

where $c = (x_{n+1}+x_n)/2$ is the midpoint.

To see this, note that

$$x_{n+1} - c = c - x_n = \frac{x_{n+1} - x_n}{2} = \frac{h}{2},$$

and with $u = (x-c)$ and $dv = f'(x)dx$, integration by parts yields

$$\int_{x_n}^{x_{n+1}}(x-c)f'(x) \, dx = (x-c)f(x)|_{x_n}^{x_{n+1}} - \int_{x_n}^{x_{n+1}} f(x) \, dx = E_n.$$

If the second derivative is bounded with $\max |f''(x)| = M$, then we can demonstrate $O(h^3)$ local accuracy. Another integration by parts yields

$$E_n = \frac1{2} \int_{x_n}^{x_{n+1}} [(h/2)^2 - (x-c)^2]f''(x) \, dx.$$

Using the bound for $f''$ and integrating we obtain the local error bound

$$|E_n| \leqslant \frac{M}{12}h^3$$

Summing over $m$ subintervals where $mh = b-a$ we get the global error bound

$$ |GE| \leqslant \frac{Mmh^3}{12}= \frac{(b-a)h^2}{12}M$$

$\endgroup$
  • 1
    $\begingroup$ @Suresh: You're welcome. You can start by looking at this and I'll see if I can find a better reference or derive it for you. $\endgroup$ – RRL Dec 15 '18 at 6:32
  • 1
    $\begingroup$ I do however think this is the "best" approach and is worth learning. $\endgroup$ – RRL Dec 15 '18 at 6:33
  • 1
    $\begingroup$ That is correct. Now you can write the first term as $-cf(x)|_{x_n}^{x_{n+1}} = -c\int_{x_n}^{x_{n+1}} f'(x) \, dx$ and you will get $E_n=\int_{x_n}^{x_{n+1}} (x-c)f'(x) \, dx$. $\endgroup$ – RRL Dec 15 '18 at 13:14
  • 1
    $\begingroup$ +1: Not a criticism of the above, but I would like to see an error analysis that makes the error 'obvious'. The integration by parts twice certainly yields the desired result, but personally I find the (textbook) derivation a bit opaque in terms of intuition. $\endgroup$ – copper.hat Dec 15 '18 at 20:23
  • 1
    $\begingroup$ @copper.hat: Thank you. I agree. I had a more transparent way in mind showing $\mathcal{O}(h^3)$ local error but could get the coefficient $1/12$. Not sure if that is important to OP. $\endgroup$ – RRL Dec 15 '18 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.