Let p be a polynomial of degree at most 4 such that $p(-1)=p(1)=0$ and $p(0)=1$. If $p(x)\leq 1$ for $x\in [-1,1]$ find the greatest value of $\int_{-1}^{1}p(x)dx$
My Attempt: Using the given information I was able to obtain a 4 degree polynomial as $f(x)=ax^4+bx^3-(a+1)x^2-bx+1$.
Thus $$\int_{-1}^1p(x)dx=2\int_{0}^{1}\left(ax^4-(a+1)x^2+1\right)dx=\frac{4}{3}-\frac{4a}{15}$$
Answer given is $\frac{8}{5}$.
I have not been able to apply the information that $p(x)\leq 1$ for $x\in [-1,1]$
How to use it
Since $f(0) = 1$, if $f$ does not exceed $1$ then $0$ must be a local maximum. Therefore $f'(0) = 0$ and $f''(0) \le 0$. This implies $b=0$ and $a \ge -1$. By your calculation, the integral is maximised with $a$ as negative as possible. Therefore $a=-1$.