You will write functions that estimate the left and right derivatives of a function at a point, and decide whether the function is differentiable there. The checker uses a smooth function, a corner and a join of two pieces.
The idea. The left derivative is the slope of the chord from a point just left of to . The right derivative is the slope of the chord from to a point just right of . A function is differentiable at when the two agree.
Your tasks.
left_derivative(f, a). Return (f(a) - f(a - H)) / H.right_derivative(f, a). Return (f(a + H) - f(a)) / H.is_differentiable(f, a). Return True when the two derivatives differ by less than 0.001.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…
With Standard, you also open 12 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.