@djinnome If you already have an automatic differentiation package in mind, it should be able to differentiate through https://github.com/timothyrenner/RungeKutta.jl (very simple, just a 70 line implementation of rk4). I'm not sure about options for more fully featured solvers