Estimate the derivative f′(x) of a scalar function at a point with a centered finite difference and step h.
Implement solve(f, x, h=1e-5).
Returns. Return a float.
Example 1
Input:
solve(lambda t: t**2, 3.0)
Output:
6.0
Example 2
Input:
solve(lambda t: t**3, 2.0)
Output:
12.0
No results yet
Run your code to check it against the examples, or submit to run every test.