2
$\begingroup$

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 :)

$\endgroup$
6
  • 1
    $\begingroup$ Cross posting at MATH.SE $\endgroup$
    – Inquest
    Commented Feb 19, 2012 at 8:45
  • $\begingroup$ @Nunoxic, thanks for the heads up. (Same to DavidZ, who pointed out the cross-posting on the Math.SE end.) $\endgroup$ Commented Feb 19, 2012 at 8:56
  • $\begingroup$ 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. $\endgroup$ Commented Feb 19, 2012 at 8:58
  • 1
    $\begingroup$ 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.) $\endgroup$ Commented Feb 19, 2012 at 9:00
  • 1
    $\begingroup$ "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. $\endgroup$
    – Dan
    Commented Feb 19, 2012 at 9:10

1 Answer 1

3
$\begingroup$

One easy way to check your answer is to calculate the integral with the trapezoidal rule and compare it to the definite integral in your problem statement, which you can calculate analytically.

Graphing the function and drawing in the appropriate trapezoids (for the trapezoidal rule) will also give you some intuition as to what conditions might produce a trapezoidal rule approximation that is larger than the true definite integral.

$\endgroup$
2
  • $\begingroup$ what I really want to ask i.e. why am I getting two correct answers:- one by using the actual formula and the other i.e N=5, is obtained by the more primitive formula which is used when we only use the error formula for the trapezoidal rule in which we don't really partition the interval of the integral which I don't think should be applicable in this case. $\endgroup$
    – user1011
    Commented Feb 19, 2012 at 14:29
  • 2
    $\begingroup$ @andrew, I think the community has helped you as far as they can for this type of question. From reading your question, I think you have a pretty good grasp of the material but are not confident in the answers. As von Neumann famously said, "In mathematics you don't understand things. You just get used to them." I would encourage you to explore this problem computationally with a tool like MATLAB, Octave, or Python. $\endgroup$ Commented Feb 19, 2012 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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