Let $\phi(t):\mathbb{R} \rightarrow \mathbb{R}$ be a continuous $L$-periodic function such that $\int_0^L e^{i \phi(t)}dt= 0$, which is the complex numebr notation for saying that the curve obtained by integrating $(\cos\phi(t),\sin \phi(t))$ over $[0,L]$ is closed and $C^1$.
Let now consider a polynomial $p(t)$ such that $$ \forall n \in \mathbb{N}, \;\;\;\; \int_0^L e^{i \phi(t)} (p(t))^n dt= 0, $$ which is equivalent to $$ \forall n \in \mathbb{N}, \;\;\;\; \int_0^L \cos\phi(t) (p(t))^n dt=\int_0^L \sin\phi(t) (p(t))^n dt= 0. $$
Is there an elegant way to tell $p$ must be a constant?
What I could come up with till now is just a force brute approach, that looks at minima and maxima of $p$ on different domains depending on the behaviour of $\phi$, which also does not seem to work if zeros of $\cos\phi$ or $\sin\phi$ accumulate.
Note that by looking just at even powers we can assume $p$ is everywhere $\geq 0$ on $[0,L]$. Besides, since the constraints remain true if we multiply $p$ by a scalar, we can also assume $p > 1$ on a subset of measure aribitrarily close to $L$ (we cannot guarantee $p>1$ on neighborhoods of roots, which can be made arbitrarily small).
Thanks.