You will write three small functions. The first estimates the slope of a function at a point. The second tests whether a function is an antiderivative of another. The third finds the constant of integration from a point on the curve.
The idea. If is an antiderivative of , the slope of at every point equals there. The slope at is estimated from two nearby points: for a tiny number .
Your tasks.
slope(F, x). Return the estimate above, with h = H.is_antiderivative(F, f, points). Return True when the slope of F is within 0.0001 of f at every point in the list.constant_for(F, x0, y0). Return the number C so that F(x) + C passes through the point (x0, y0).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…