= Solution
If the error is <orthogonal> to $\Pi_n$, then for any $q\in\Pi_n$,
$$
\|u-q\|^2=\|u-p_n\|^2+\|p_n-q\|^2\geq\|u-p_n\|^2,
$$
proving sufficiency. Conversely, if $p_n$ minimizes, perturb it to $p_n+tq$ for any real $t$. The squared error becomes
$$
\|u-p_n\|^2-2t(u-p_n,q)+t^2\|q\|^2.
$$
A minimum at $t=0$ forces the linear coefficient to vanish, proving necessity.
For existence, choose the <basis> $1,x,\ldots,x^n$. Its <Gram matrix> $G$ is positive definite because $c^TGc$ is the squared <norm> of the nonzero <polynomial> with coefficients $c$. Thus $G$ is invertible, and the normal equations $Gc=((u,x^j))_{j=0}^n$ have a solution, giving an <orthogonal> residual and therefore a minimizer. The Pythagorean identity shows any other minimizer differs by a <polynomial> of zero <norm>, so it is equal to the first. Hence the best <polynomial> exists and is unique.
Back to article page