# Numerical Method Sample Question via Truncation error Methods?

I have one multiple choice question:

Approximation of integration $\int_0^{0.1} e^{x^2}dx$ by using simple formula of following options has lower Truncation error:

Choice Part:

$a)$ rectangle method lower respect to trapezoidal

$b)$ trapezoidal lower respect to Simpson

$c)$ Midpoint lower respect to Simpson

$d)$ Midpoint lower respect to right or left rectangle

TA solved and say $(d)$ is the best option, Would you Please any expert describe it for me?

Edit:

The great user Ross Millikan answered it very well, but main challenge is if you ran into a new equation, how you should deduce which method is best? I means is there any calculation by hand that can deduce the best option? or this question has an answer In general?

• For this example, series is better than everything mentioned above. I have a feeling that they expect a response that does not look at the particular function and interval, but relies on generic information, Simpson is "usually" better than Trapezoidal or Midpoint. – André Nicolas Jul 26 '16 at 15:54
• A picture like the one drawn by Ross Millikan will do it for our particular choices. Things can get more complicated with periodic functions, for which for example TRAP can be better than SIMP. – André Nicolas Jul 26 '16 at 16:16
• For this particular example, one can use the Maclaurin series to compare the various "local" errors. They happen to be all of the same sign. There is nothing that I know that works in general. – André Nicolas Jul 26 '16 at 16:23
• (a) is false because the function is strictly increasing in our interval. Simpson is "generally" better than trapezoidal or midpoint, but not always. Technically it is better here because our function is increasing and concave up (convex). – André Nicolas Aug 1 '16 at 14:20
• In this particular question, d) is clearly true. So if one option only is to be chosen, there is no problem. You saw that a) is false, and b) and c) are "generally" false, so one can answer the question with a good deal of comfort about correctness. – André Nicolas Aug 1 '16 at 17:21

I will draw the areas considered for integrating $\int_0^2 2-\sqrt{4-x^2}dx$ because it is easier to draw. The left one is the left rectangle method because it uses the point at the left side of the interval. The second one is the right rectangle method because it uses the point at the right of the interval. The third is the trapezoid method. The midpoint method would use the point at the center of the interval to size its rectangle. The truncation error is the difference between the true integral, the area under the curve, and the area of the shapes shown. It should be obvious that in this case option d is correct.
Here is the spreadsheet I made. The left column is $x$, the right column is the function, and the graph is next. It doesn't look too different from the quarter circle.
• I don't think you can derive it in general. Imagine a function that goes from $(1,1)$ to $(2,2)$ but rises linearly to $(1.00001,2)$ then runs horizontal to $(2,2)$ The right rectangle will be much more accurate than the trapezoid. – Ross Millikan Jul 26 '16 at 16:49