= Solution
{c}
The best approximation in the $L^2$ norm is the <orthogonal projection> onto $\operatorname{span}\{\phi_0,\phi_1\}$. Therefore
$$
p_1=\frac{(x^k,\phi_0)}{\|\phi_0\|_2^2}\phi_0
+\frac{(x^k,\phi_1)}{\|\phi_1\|_2^2}\phi_1.
$$
Using $\int_0^1x^k\,dx=1/(k+1)$,
$$
(x^k,\phi_1)=\frac1{k+2}-\frac1{2(k+1)}
=\frac{k}{2(k+1)(k+2)}.
$$
It follows that
$$
\boxed{p_1(x)=\frac{2(1-k)+6kx}{(k+1)(k+2)}.}
$$
The error is orthogonal to every linear polynomial, so the Pythagorean identity proves optimality and uniqueness. At $k=0$, this gives $p_1=1$; at $k=1$, it gives $p_1=x$. Both are exact because the target itself then belongs to $P_1$.
Back to article page