= Solution
For any $q$ in the <polynomial> trial space, $f-q=(f-p)+(p-q)$ and $p-q$ is in that same space. The assumed <orthogonality> therefore gives the Pythagorean identity
$$
\boxed{\|f-q\|^2=\|f-p\|^2+\|p-q\|^2\geq\|f-p\|^2.}
$$
Thus $p$ is the <best approximation>; equality is possible only when $q=p$ because the <inner product> is <positive-definite>.
Write the linear <polynomial> as $p=A+Bx$. <Orthogonality> of $x^2-p$ to $1$ and $x$ in the <weighted inner product> gives
$$
\frac14-\frac A2-\frac B3=0,\qquad
\frac15-\frac A3-\frac B4=0.
$$
Solving yields
$$
\boxed{p(x)=-\frac3{10}+\frac65x.}
$$
The weighted squared error is $\int_0^1x(x^2-6x/5+3/10)^2dx=1/600$, providing an additional exact check. The weight's zero value at one endpoint does not destroy positive definiteness on <continuous> functions: a nonzero <continuous> function is nonzero on an interval of positive weight.
Back to article page