Posted by **Anonymous** on Sunday, January 13, 2013 at 2:31am.

A standard problem in mathematics is to measure the area under a curve (or to integrate the function defining the curve). A simple way to do this is to approximate the area with a series of rectangles (whose areas are easy to compute).

For example, we could split the range into two parts, then fit a rectangle whose height is the value of the function at the start of the range to the left half, and fit a rectangle whose height is the value of the function at the middle of the range to the right half. If we decide this is not a sufficiently accurate estimate of the area under the curve, we could split each part in half and repeat the process.

Here is a function that estimates the area under a curve defined by a function f, between points a and b:

def integrate(f, a, b, parts):

spacing = float(b-a)/parts

current = 0

for i in range(parts):

current += spacing * f(a+ i*spacing)

return current

Your job is to fill in the following function definition:

def successiveApproxIntegrate(f, a, b, epsilon):

# Your Code Here

To do so, use successive refinement to find the area under a curve to within a specific level of accuracy. Complete the function definition so that the procedure successiveApproxIntegrate returns an estimate of the area under the curve f. Your final estimate, using N parts, must be less than epsilon away from the estimate using N/2 parts.

## Answer This Question

## Related Questions

- CALC - area under a curve - You have an unknown function that is monotone ...
- Math: Need Answer to study for a quizz. Help ASAP - Estimate the area under the ...
- calculus(Lab) - Well, first graph the graph of f(x)=-1/10x^2 + 3 2. We are going...
- Math - Estimate the are under the curve f(x)=x^2-4x+5 on [1,3]. Darw the graph ...
- Maths 2U - how do you find the horizontal and vertical assymptotes of the curve ...
- cal - Approximate the area under the curve and above the x-axis using n ...
- math - Estimate the area under the curve f(x) = 16 – x^2 from x = 0 to x = 3 by ...
- Math help - We have no ideal on how to start this problem, we have look for it ...
- Math help - We have no ideal on how to start this problem, we have look for it ...
- Calculus - Find the area cut off by x+y=3 from xy=2. I have proceeded as under: ...

More Related Questions