Let $P\_n$ be the set of degree $n$ polynomials that pass through $(0,1)$ and $(1,1)$ and are non-negative on the interval $[0,1]$ (but may be negative elsewhere).


Let $a\_n = \min\_{p\in P\_n} \int\_0^1 p(x)\,\mathrm{d}x$ and let $p\_n$ be the polynomial that attains this minimum.


Are $a\_n$ or $p\_n$ known sequences? Is there some clever way to rephrase this question in terms of linear algebra and a known basis of polynomials?



Non-negative polynomials on $[0,1]$ with small integral
Following Robert Israel's answer, we also scale everything to $[-1,1]$ (thus multiplying the result by 2). As he mentions, the optimal polynomial is always a square of some other polynomial, $p\_{2n}=p\_{2n+1}=q\_n^2$, and $q\_n$ is either even or odd (see Lemma below). So we are left to find the minimal $L\_2[-1,1]$-norm of an odd/even polynomial $q\_n$ such that $\deg q\_n\leq n$ and $q\_n(\pm1)=(\pm1)^n$. In other words (recall the division by 2 in the first line!), $a\_{2n}=a\_{2n+1}=d\_n^2/2$, where $d\_n$ is the distance from $0$ to the hyperplane defined by $q(1)=1$ in the space of all odd/even polynomials of degree at most $n$ with $L\_2[-1,1]$-norm.


Now, this hyperplane is the affine hull of the Legendre polynomials $ P\_i(x)=\frac1{2^ii!}\frac{d^i}{dx^i}(x^2-1)^i$, where $i$ has the same parity as $n$ (since we know that $ P\_i(1)=1$ and $P\_i(-1)=(-1)^i$). Next, by $\| P\_i\|^2=\frac{2}{2i+1}$, our distance is
$$
 \left(\sum\_{j\leq n/2}\| P\_{n-2j}\|^{-2}\right)^{-1/2}
 =\left(\sum\_{j\leq n/2}\frac{2(n-2j)+1}{2}\right)^{-1/2}=\sqrt{\frac4{(n+1)(n+2)}},
$$
attained at
$$
 q\_n(x)=\left(\sum\_{i\leq n/2}\frac{2}{2(n-2i)+1}\right)^{-1}
 \sum\_{i\leq n/2}\frac{2P\_{n-2i}(x)}{2(n-2i)+1}.
$$
Thus the answer for the initial question is $a\_{2n}=a\_{2n+1}=\frac2{(n+1)(n+2)}$ and $p\_{2n}=p\_{2n+1}=q\_n^2$.


**Lemma.** For every $n$, one of optimal polynomials on $[-1,1]$ is a square of an odd or even polynomial.


*Proof.* Let $r(x)$ be any polynomial.which is nonnegative on $[-1,1]$ with $r(\pm 1)=1$. We will replace it by some other polynomial which has the required form, has the same (or less) degree and the same values at $\pm 1$, is also nonnegative on $[-1,1]$, and is not worse in the integral sense. Due to the compactness argument, this yields the required result.


Firstly, replacing $r(x)$ by $\frac12(r(x)+r(-x))$, we may assume that $r$ is even (and thus has an even degree $2n$). Let $\pm c\_1,\dots,\pm c\_{n}$ be all complex roots of $r$ (regarding multiplicities); then
$$
 r(x)=\prod\_{j=1}^n\frac{x^2-c\_j^2}{1-c\_j^2},
$$
due to $r(\pm 1)=1$.


Now, for all $c\_j\notin[-1,1]$ we simultaneously perform the following procedure.


(a) If $c\_j$ is real, then we replace $\pm c\_j$ by $\pm x\_j=0$. Notice that 
$$
 \frac{|x^2-c\_j^2|}{|1-c\_j^2|}\geq 1\geq \frac{|x^2-0^2|}{|1-0^2|}.
$$
for all $x\in[-1,1]$.


(b) If $c\_j$ is non-real, then we choose $x\_j\in[-1,1]$ such that $\frac{|c\_j-1|}{|c\_j+1|}=\frac{|x\_j-1|}{|x\_j+1|}$. Notice that all complex $z$ with $\frac{|c\_j-z|}{|x\_j-z|}=\frac{|c\_j-1|}{|x\_j-1|}$ form a circle passing through $-1$ and $1$, and the segment $[-1,1]$ is inside this circle. Therefore, for every $x\in[-1,1]$ we have
$$
 \frac{|c\_j-x|}{|x\_j-x|}\geq\frac{|c\_j-1|}{|x\_j-1|},
$$
thus
$$
 \frac{|x^2-c\_j^2|}{|1-c\_j^2|}
 =\frac{|c\_j-x|}{|c\_j-1|}\cdot\frac{|c\_j+x|}{|c\_j+1|}
 \geq \frac{|x\_j-x|}{|x\_j-1|}\cdot\frac{|x\_j+x|}{|x\_j+1|}
 =\frac{|x^2-x\_j^2|}{|1-x\_j^2|}.
$$
So, we replace $\pm c\_j$ and $\pm\bar c\_j$ by $\pm x\_j$ and $\pm x\_j$ (or simply $\pm c\_j$ by $\pm x\_j$ if $c\_j$ is purely imaginary).


After this procedure has been applied, we obtain a new polynomial whose roots are in $[-1,1]$ and have even multiplicities, and its values at $\pm1$ are equal to $1$. So it is a square of some polynomial which is even/odd (since the roots are still split into pairs of opposite numbers). On the other hand, its values at every $x\in[-1,1]$ do not exceed the values of $r$ at the same points, as was showed above. So the obtained polynomial is not worse in the integral sense, as required. The lemma is proved.


