Computational Physics, Python, Interpolation, Differentiation, Integration.
my_derivative(g,1,dx=1e-5) Out: 3.000000000097369 We matched the result exactly. Of course, that is just the default, derivative has many ways to improve. E.g. we can include more than just the difference of two points but include more points. derivative(g,1,dx=1e-5,order=7) Out: 3.0000000000075104