You will write three functions that find a derivative by computer, using the definition with a very small . The checker uses and .
The idea. The slope of the secant through and is . For a very small it is almost the derivative. The tangent at is with and .
Your tasks.
secant_slope(f, a, h). Return the slope of the secant through and .derivative_at(f, a). Use secant_slope with h = 0.000001.tangent_line(f, a). Return the pair (m, c) of the tangent line y = m * x + c.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…