Polynomial integrals of motion in dilaton gravity theories