# For univariate polynomial is non-negativity on an interval equivalent to having a nonnegative scalar product with non-negative polynomials

Let $\mathbb R_d[t]$ be the set of univariate polynomials in the variable $t$ of degree $d$, and $S$ be the set of elements of $\mathbb R_d[t]$ that are nonnegative on $[0, 1]$. Does the following equivalent hold for a polynomial $p \in \mathbb R_d[t]$?

$$p \in S \iff \int_0^1 p(t) q(t) \ge 0 \; \forall q \in S.$$

Here is a counter-example for $d=1$. In this simple case $S$ is just the set of linear combinations of $x$ and $1-x$ with nonnegative coefficients.
$$p(x)=3x-1$$
$$\int_0^1 p(x)x\ dx=\frac12$$
$$\int_0^1p(x)(1-x)\ dx=0$$
Then $\int_0^1pq\ge0\ \forall q\in S$, but $p\notin S$.
• Thanks! does this change if we require $q$ to be of degree 2d (or some other upperbound)? – maroxe Apr 2 '18 at 6:39
• With $q=(x-1)^2$ and $p=3x-1$, I find $\int pq=-1/12$. – Jean Duchon Apr 3 '18 at 9:23