How Many Points for Trapezium Rule to Compute exp(-x^2) with Specific Error?

  • Thread starter Thread starter retupmoc
  • Start date Start date
  • Tags Tags
    Error
AI Thread Summary
To compute the integral of exp(-x^2) over the interval [0,1] with an error of at most 5x10^-5 using the Trapezium Rule, the maximum second derivative needs to be determined, likely at x=0. The error formula provided suggests a relationship between the number of subintervals and the second derivative, which is 4x^2exp(-x^2). A binary-cut technique is recommended for efficiently finding the optimal number of intervals, adjusting based on whether the error is too large or acceptable. Additionally, a similar approach can be applied for Simpson's Rule, with careful consideration of the error in each subinterval. Understanding and applying these methods will help achieve the desired accuracy in numerical integration.
retupmoc
Messages
47
Reaction score
0
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
 
Physics news on Phys.org
retupmoc said:
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

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

http://math.fullerton.edu/mathews/n2003/TrapezoidalRuleMod.html

http://math.fullerton.edu/mathews/n2003/SimpsonsRuleMod.html

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:
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?
 
retupmoc said:
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?

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.
 
TL;DR Summary: I came across this question from a Sri Lankan A-level textbook. Question - An ice cube with a length of 10 cm is immersed in water at 0 °C. An observer observes the ice cube from the water, and it seems to be 7.75 cm long. If the refractive index of water is 4/3, find the height of the ice cube immersed in the water. I could not understand how the apparent height of the ice cube in the water depends on the height of the ice cube immersed in the water. Does anyone have an...
Kindly see the attached pdf. My attempt to solve it, is in it. I'm wondering if my solution is right. My idea is this: At any point of time, the ball may be assumed to be at an incline which is at an angle of θ(kindly see both the pics in the pdf file). The value of θ will continuously change and so will the value of friction. I'm not able to figure out, why my solution is wrong, if it is wrong .
Back
Top