Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
The area under from 0 to is exactly 2. Find the smallest number of trapezoids for which the area is correct to within 0.001. Use np.trapezoid, and test in a loop.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Plan. For each , make the edges, find the trapezoid area, and stop at the first for which the error is below 0.001.
Check. The error of the trapezoid rule is about (from the lesson: 0.104 for , so ). The error is below 0.001 when , so , and the smallest whole number is 41.
Answer: trapezoids.
Log in to join the discussion.
Loading…