Extremal arcs and extended Hamiltonian systems