Under the hood, scipy.integrate.odeint uses the scipy.integrate.odeint solver from the ODEPACK FORTRAN library . To deal with situations where the function you are trying to integrate is stiff , LSODA adaptively adapts between two different methods of calculating the integral - the Adams method , which is faster but unsuitable for hard systems, and BDF , which is slower but more resistant to stiffness.
The particular function you are trying to integrate is not hard, so LSODA will use Adams at every iteration. You can verify this by returning infodict ( ...,full_output=True ) and checking infodict['mused'] .
Since the Adams method does not use the Jacobian, your gradient function will never be called. However, if you give odeint tough function for integration, for example, the Van der Pol equation :
def vanderpol(y, t, mu=1000.): return [y[1], mu*(1. - y[0]**2)*y[1] - y[0]] def vanderpol_jac(y, t, mu=1000.): return [[0, 1], [-2*y[0]*y[1]*mu - 1, mu*(1 - y[0]**2)]] y0 = [2, 0] t = arange(0, 5000, 1) y,info = odeint(vanderpol, y0, t, Dfun=vanderpol_jac, full_output=True) print info['mused']
you should see that odeint switches to using BDF, and now the Jacobian function is called.
If you need more control over the solver, you should learn scipy.integrate.ode , which is a much more flexible object-oriented interface to several different integrators.