# Homework Help: Error in the Trapezium Rule

1. May 29, 2005

### retupmoc

Hi, in my numerical methods i missed my lecture and i am currently unable to obtain the solution of a problem from my lecturer. How many points should be used to compute the integral exp(-x^2) over the interval [0,1] with an error at most 5x10^-5? At the end of the previous lecture we where given a formula for the the error over the interval [b,a] I-T=-1/12(b-a)h^2f''(w) + O(h^2). Where f''(w) is the maximum second order derivative at a point w in the range. Any help would be appreciated.

Also how would i do the same calculation for Simpsons Rule?

Thanks

2. May 29, 2005

### OlderDan

This looks like a decent set of notes for both cases.

http://math.fullerton.edu/mathews/n2003/TrapezoidalRuleMod.html [Broken]

http://math.fullerton.edu/mathews/n2003/SimpsonsRuleMod.html [Broken]

I doubt the O(h^2) is correct. I suspect it should be higher order, or maybe the + is supposed to be =

Last edited by a moderator: May 2, 2017
3. May 29, 2005

### retupmoc

so id need to work out where 4x^2exp(-x^2) (i.e. the second derivitive) is maximum? Which would be x=0(?) and exp(-x^2)=1 and put this into the equation above to get the number of subintervals required?

4. May 29, 2005

### OlderDan

My guess is you need to look at the whole interval and see if the error is too big. If it is, you need to break it into sub-intervals and find the errors for each sub-interval and combine them. You need to do that until the number of intervals is large enough to reduce the error within limts.

Rather than a sequential approach, you might try a binary-cut technique. For example, if 20 is more than enough try 10, if that is too few go half way between and try 15, then move half way toward the previous numbers depending on if 15 is too few at least enough.

I have not looked carefully for an analytical approach to finding the number, but I think the formula you have applies interval by interval.