You will write three functions that show the Fundamental Theorem of Calculus on the computer. The first finds an area by adding thin strips. The second uses an antiderivative. The third finds the slope of the area function and compares it with the function itself.
The idea. The area under from to is close to the sum of the strips . The theorem says it equals for an antiderivative . It also says that the slope of the area function at is .
Your tasks.
area(f, a, b). Cut into N equal strips and add f(middle) * width for each strip.ftc(F, a, b). Return F(b) - F(a).slope_of_area(f, a, x). Return the slope of area(f, a, x) at x, from two nearby points x - D and x + D.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…