Weighted linear projection of a quadratic monomial (source code)

= Weighted linear projection of a quadratic monomial
{title2=$p(x)=-3/10+6x/5$}

In the <weighted inner product> $\langle f,g\rangle=\int_0^1xf(x)g(x)\,dx$, the <best approximation> to $x^2$ in the span of $1,x$ is the displayed <polynomial>. The <normal equations> are $1/4-A/2-B/3=0$ and $1/5-A/3-B/4=0$. Their solution gives $A=-3/10$, $B=6/5$. The residual is orthogonal to that span, so the <Pythagorean theorem> proves minimality and uniqueness. Its squared <norm> is $1/600$. A weight vanishing at a single endpoint still gives a <positive-definite> inner product on continuous functions: a nonzero continuous function remains nonzero on an interval where the weight is positive.