Solution (source code)

= Solution

The best <polynomial> minimizes the weighted squared error among all polynomials of degree at most $n$:
$$
\boxed{\|u-p_n\|\leq\|u-q\|\quad\text{for every }q\in\Pi_n.}
$$
The given <inner product> is positive definite on continuous functions despite the weight vanishing at zero: a continuous nonzero function is nonzero on an interval containing nonzero points, so its weighted square integral is strictly positive.