hamiltonian and derivative as arguments
hamiltoninan is generic function