Does there exist a polynomial Hamiltonian function $H$ on some $\mathbb{R}^{2n}$ such that 


1. Any polynomial function $P$ such that $\{P,H\}=0$ is of the form $p(H)$ for some polynomial $p$ in one variable;
2. There exists a smooth function $F$ such that $\{F,H\}=0$, and yet $F$ is *not* of the form $f(H)$ for any smooth function $f$ in one variable?


I am looking for an example of such a phenomenon, or a proof that it cannot occur. A non-Hamiltonian example -- that is, of a polynomial vector field such that the smooth completion of the algebra of its polynomial integrals is strictly smaller than the algebra of its smooth integrals -- would also be helpful. Any references to the literature will be much appreciated, of course.


Thanks in advance!



Non-polynomial integrals of motion for polynomial dynamical systems
Here is a tentative Hamiltonian answer having 2 degrees of freedom. 
Take $H = (1/2)(1 + a x^2 + bxy + cy^2) (p\_x ^2 + p\_y ^2)$.
for essentially any parameters $a, b, c$ for which  

$ax^2 + bxy + cy^2$ is positive definite ($a x^2 + bxy + c y^2) > \epsilon (x^2 + y^2)$)
but NOT a multiple of $x^2 + y^2$. This $H$ is the Hamiltonian for geodesic flow
on the plane with metric $ds^2 = (dx^2 + dy^2)/((1 + a x^2 + bxy + cy^2)$.
Comparing the arclength $ds$ with $dr/\sqrt{1 + \epsilon r^2}$
seems to show that the metric is complete. Now we can play the 
 `scattering integrability' trick
which I learned from E. Gutkin. This trick yields
2 new integrals $F, G$ as the`scattering data'' for the
resulting geodesics. What I mean is that any
 geodesic will be asymptotic to a
straight line in the xy plane, and the asymptotic direction $(F, G)$ of this
line is an integral. The hard part is to show this asymptotic direction, is a smooth function of $x, y, p\_x, p\_y$. I wager
that unless $a x^2 + bxy + cy^2$ is a square (like $x^2$)
or a multiple of $x^2 + y^2$, these scattering integrals are not polynomials.
They might not even be analytic..


