intermediate step to reverse integration of ode