Solution (source code)

= Solution

Write $p_1(x)=a+bx$. It suffices to impose orthogonality of the error to the basis $1,x$ of $\Pi_1$. With the printed weight $x^{-1/2}$ and $f=x^{3/2}$, the <normal equations> are
$$
\begin{pmatrix}2&2/3\\2/3&2/5\end{pmatrix}
\begin{pmatrix}a\\b\end{pmatrix}
=\begin{pmatrix}1/2\\1/3\end{pmatrix}.
$$
Here, for example, $\langle f,1\rangle=\int_0^1x\,dx=1/2$ and $\langle f,x\rangle=\int_0^1x^2\,dx=1/3$. Solving gives $a=-1/16$, $b=15/16$. Therefore
$$
\boxed{p_1(x)=\frac{15x-1}{16}.}
$$
The two <normal equations> make the error <orthogonal> to every linear polynomial, and part (b) then proves optimality, rather than merely furnishing a candidate fit.