Consider the inner product space $C[0,1]$ with inner product $$\langle f,g\rangle =\int_0^1f(x)g(x)\,dx$$ Let $S$ be the subspace spanned by $1$ and $2x-1$
Find the best least squares approximation of $\sqrt x$ by a function from the subspace $S$.
My attempt at a solution.
$$\langle x,2x-1\rangle \implies \text{orthogonality}$$ $$\|1\|=1 \quad \|2x-1\|=\sqrt\frac{11}{6}$$
Having found an orthonormal basis for S we find the closest approximation $p$ of $x$ as follows: $$p=\sum_ic_iu_i \quad c_i=\langle x,u_i\rangle$$ where $u_i$ are the vectors in the orthonormal basis.
So $p=\frac{3}{2} + \frac{-42}{11}(2x-1)$
Is this last bit correct?
$\|f\|= \sqrt{ \langle f , f \rangle }$.
Let $v_1(x) =1, v_2(x) = 2x-1$. Then $\|v_1\| = 1, \|v_2\| = {1 \over \sqrt{3}}$.
Let $u_1 = v_1, u_2 = {\sqrt{3}} v_1$.
Let $f(x) = \sqrt{x}$. Then the closest least squares approximation is $\phi = \langle u_1 , f \rangle u_1 +\langle u_2 , f \rangle u_2$, or explicitly, $\phi(x) = {2 \over 3} + {2 \over 5 }(2x-1)$.