= Solution
{c}
Write $\mathcal P_n$ for the <vector space> of <polynomials> of <polynomial degree> at most $n$, and put $p_n(x)=\sum_{j=0}^na_jx^j$. As the question calls the weighted integral an <inner product>, its finiteness is implicit; for example, a positive integrable weight $w$ suffices for all the <continuous functions> involved here.
For every $q\in\mathcal P_n$, differentiating the squared <weighted norm> $\|f-p_n-tq\|_w^2$ at its minimum $t=0$ gives the <orthogonality> equations
$$
\langle f-p_n,q\rangle_w=0.
$$
In particular, the requested <linear system> is
$$
\boxed{\sum_{j=0}^n a_j\int_{-1}^1w(x)x^{j+k}\,dx
=\int_{-1}^1w(x)f(x)x^k\,dx,\qquad k=0,\ldots,n.}
$$
Its <Gram matrix> $G_{kj}=\int_{-1}^1w(x)x^{k+j}\,dx$ is a <symmetric positive-definite matrix>: for any nonzero <vector> $a$,
$$
a^TGa=\int_{-1}^1w(x)\left(\sum_{j=0}^na_jx^j\right)^2dx>0.
$$
Indeed a nonzero <polynomial> is nonzero on some open interval, and the weight is positive. Therefore $G$ is an <invertible matrix>, proving uniqueness. Conversely, if these equations hold, the <Pythagorean theorem in an inner-product space> gives, for every $q\in\mathcal P_n$,
$$
\|f-(p_n+q)\|_w^2=\|f-p_n\|_w^2+\|q\|_w^2,
$$
so the solution really is the unique <best approximation>.
Back to article page