上QQ阅读APP看书,第一时间看更新
27. Trapezoid rule integration
In addition to the left, right, and middle Riemann sum variations, a fourth variation divides an area into trapezoids instead of rectangles, as shown in the following diagram:
Write a program that uses the trapezoid rule to approximate the area under a curve. Use your program to estimate the areas for the curves described in Problem 25. Monte Carlo integration.