# Quadrature Error for Trapezoidal Rule

Question: If the trapezoidal rule is used to approximate the integral of the function $f$ over the interval $[a,b]$ with 201 evenly spaced dissection points, estimate the quadrature error for

$$\int_0^1log(1+x^2)dx$$

For this style of question would I use the formula

$$error \le \sum_{i=1}^{N} \frac{-1}{12}\left(\frac{b-a}{N}\right)^3 f''(c_i)$$

to find the error?

Where N is the number of equal length intervals, [a,b] is the full inteval, $c_i$ is the midpoint of each interval and $f$ is $log(1+x^2)$.

If this is the case, how do I find $c_i$?

## 1 Answer

Instead of adding up the estimates for the local errors, we can use the standard expression for the global error, which in general is $$-\frac{(b-a)^3}{12N^2}f''(c),$$ where $c$ is a number between $a$ and $b$. In our case, $a=0$ and $b=1$. The number $N$ of subintervals is $200$.

Now we need an estimate for $f''(c)$. The second derivative is, I think, $\dfrac{2(1-x^2)}{(1+x^2)^2}$. As $x$ increases, the numerator is decreasing, and the denominator is increasing. Thus $f''(x)$ is steadily decreasing. It is equal to $2$ at $x=0$, so $0\le f''(x)\lt 2$.

Remark: Or else use the local errors, and add them up. Since the second derivative is everywhere positive and $\lt 2$, the local error is always negative and $\lt \dfrac{1}{12}\cdot\dfrac{1}{(200)^3}\cdot 2$ in absolute value, so in absolute value the total error is $\le 200\cdot \dfrac{1}{12}\cdot\dfrac{1}{(200)^3}\cdot 2$.

Typically, the error estimates produced by this kind of calculation are unduly pessimistic. One can ordinarily get more useful information by comparing $T_{100}$ with $T_{200}$. The number $T_{100}$ is typically computed on the way to computing $T_{200}$, so it involves no additional cost.

• Thank you, the local and global errors were confusing me a bit but I think I get it now! – Nicky Oct 17 '12 at 19:08
• You can use the "local" errors version. The $N$ individual errors are bounded as given by your formmula, so their sum is $\le N$ times the maximum local error. For that maximum, maximimize the second derivative as I did. – André Nicolas Oct 17 '12 at 19:18
{"ft_lang_label":"__label__en","ft_lang_prob":0.79803437,"math_prob":0.99984634,"size":1175,"snap":"2019-13-2019-22","text_gpt3_token_len":357,"char_repetition_ratio":0.11016226,"word_repetition_ratio":0.0,"special_character_ratio":0.3370213,"punctuation_ratio":0.112,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999906,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-05-23T14:54:13Z\",\"WARC-Record-ID\":\"<urn:uuid:d8388154-f81f-49d9-bd59-370313ba45af>\",\"Content-Length\":\"129842\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:31582fb3-3c91-4025-b9d2-aaa921711c6a>\",\"WARC-Concurrent-To\":\"<urn:uuid:f51b44a3-6cfe-40fd-867b-f320affac03a>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/214953/quadrature-error-for-trapezoidal-rule\",\"WARC-Payload-Digest\":\"sha1:UIWYPOVFVBNGVD7B5WIRW55SEH53Y6XU\",\"WARC-Block-Digest\":\"sha1:LWQRIQ4MR43O7XOXLNGEGLEXET5SNK5B\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-22/CC-MAIN-2019-22_segments_1558232257259.71_warc_CC-MAIN-20190523143923-20190523165923-00222.warc.gz\"}"}