Let H be the Hilbert space L$^2$([0,1)], and let $S$ be the subspace of functions f $\in$ H satisfying $\int^1_0(1+x)f(x)dx=0$.
Find the element of $S$ closest to the function $g\in H$ defined by $g(x)=1$. Prove that it is the closest element.
I think what I need to do is find the orthogonal projection of $g$ onto $S$. I'm not exactly sure how I would go about doing that. Any help would be appreciated.