Find the polynomial $f(x)$ which have the following property Find the polynomial $p(x)=x^2+px+q$ for which $\max\{\:|p(x)|\::\:x\in[-1,1]\:\}$ is minimal.
This is the 2nd exercise from a test I gave, and I didn't know how to resolve it. Any good explanations will be appreciated. Thanks!

Here's an informal argument that doesn't use calculus. Notice that $p(x)$ is congruent to $y = x^2$ (for example, simply complete the square). Now suppose that we chose our values for the coefficients $p,q$ carefully, and it resulted in producing the minimal value of $m$. Hence, we can think of the problem instead like this:

By changing the vertex of $y=x^2$, what is the minimal value of $m$ such that for all $x\in [-1,1], -m \le p(x) \le m$?

By symmetry, there are only two cases to consider (based on the location of the vertex).
Case 1: Suppose the vertex is at $(1,-m)$ and that the parabola extends to the top left and passes through the point $(-1,m)$. Using vertex form, we have $p(x)=(x-1)^2-m$ and plugging in the second point yields $m=(-1-1)^2-m \iff 2m=4 \iff m = 2$.
Case 2: Suppose that the vertex is at $(0, -m)$ and that the parabola extends to the top left and passes through the point $(-1,m)$. Using vertex form, we have $p(x)=x^2-m$ and plugging in the second point yields $m=(-1)^2-m \iff 2m = 1 \iff m = 1/2$.
Since $m=1/2$ is smaller, we conclude that $\boxed{p(x)=x^2-\dfrac{1}{2}}$ is the desired polynomial.
