In [1]:
def f(x):
  return 3*x**2 - 4*x + 5
In [2]:
f(3.0)
Out[2]:
20.0
In [3]:
h = 0.001
x = 3.0
(f(x + h) - f(x))/h
Out[3]:
14.00300000000243