Computational Physics, Python, Interpolation, Differentiation, Integration.
For example, we could improve Newton’s method to use the second derivative too! Scipy has this built in for us. fprime2=optimize.newton(lambda x:x**2+2*x+1,10,fprime=lambda x:2*x+2,fprime2=lambda x:2.,tol=10**(-16)) print(fprime2) Out: -0.9999999957639969 print(fprime2+1) print(newton1+1) Out: