# Error calculation in trapezoidal rule

If we use the composite trapezoidal rule, then what is the least number of divisions $N$ for which the error of the integral $\int^1_0{e^{-x}}dx$ doesn't exceed $\frac{1}{12}\times10^{-2}$.

My guess is 11 or 5. Kindly tell me which of the answer is correct?

I obtained 11 as the answer by applying the formula

$$\Big|\frac{(b-a)^3}{12N^2}\times{(e^{-x})^{\prime\prime}_{x=\varepsilon}}\Big| \text{ = } {\frac{10^{-2}}{12}}$$ where $\varepsilon \in [0,1]$ is chosen so that it maximizes the value of $e^{-\varepsilon}$ (which I believe occurs at $\varepsilon = 0$).

Solving this equation, I get $N = 10$ (i.e. I must have atleast 11 equidistant divisions if I have to keep the error less than $\frac{10^{-2}}{12}$).

As far as 5 is concerned, I just used 5 equidistant intervals i.e $0,\frac{1}{5},\frac{2}{5},\frac{3}{5},\frac{4}{5},1$ and I applied them in the trapezoidal rule. Now here's the problem:- When calculated the answer at $N=5$, I got a value greater that the actual value of the integral. Is it possible? If yes, why?

Which of my answer is correct because I obtained 11 by a well-established formula and 5 was just an option I hit upon and am not really sure of 5's correctness.

Thanks

Note:- I am posting this question because everywhere else nobody is giving any reply at all. I don't know if this question belongs here. If it does, then kindly reply. If it doesn't,then feel free to erase or delete or whatever :)

• Cross posting at MATH.SE – Inquest Feb 19 '12 at 8:45
• @Nunoxic, thanks for the heads up. (Same to DavidZ, who pointed out the cross-posting on the Math.SE end.) – Geoff Oxberry Feb 19 '12 at 8:56
• andrewjames, welcome to SciComp! Our policy on cross-posting follows that of other Stack Exchange sites. It is permissible to cross-post if you tailor the same question (more or less) to different audiences. It is permissible to ask your question to be migrated to another site after some time, if you feel that your question is not getting answered satisfactorily (or at all) on the site where it is initially posted. – Geoff Oxberry Feb 19 '12 at 8:58
• However, it is generally considered abusive behavior to cross-post. Please delete one of the cross-posted questions. (Since your question is about numerical methods, it is probably a better fit here, but I'm biased; the choice is up to you.) – Geoff Oxberry Feb 19 '12 at 9:00
• "When calculated the answer at N=5, I got a value greater that the actual value of the integral. Is it possible? If yes, why?" This is not surprising, as the exponential decay function is concave up over that interval. The trapezoidal rule should overestimate the integral over that region. – Dan Feb 19 '12 at 9:10