Find function that minimizes the distance from $f$ to $g$ with respect to the $L_2$-norm

Let H be the Hilbert space $L_2([-1,1])$ with the standard inner product: $$\langle f|g \rangle=\int_{-1}^1 \bar{f}(x)g(x)dx$$ and define the functions, $f_n$, $n=0,1,2,3,...,$ on $[-1,1]$ by $$f_n(x)=x^n$$ We have that $f_n$ belong to $H$. Now we let $g \in L_2([-1,1])$ be given by: $$g(x)=\begin{cases} 1, & \text{for }0\leq x \leq 1 \\ 0, & \text{for }-1 \leq x<0 \end{cases}$$ And now I have to argue that there is a function in $U=\operatorname{span}\{f_1,f_2,f_3\}$ that minimizes the distance to g with respect to the $L_2$-norm and explicit find this function.

I'm not sure how to do that? Can anyone help me? I have found an expression for the inner product $\langle f_n, f_m\rangle $ for for all values of n, m, and I have found a orthonormal basis for $U$. If these can be used to solve the problem...?


Solution 1:

There are a number of ways of approaching this problem, here is one. There are a number of details to be completed, this purpose is to illustrate the idea.

If you orthonormalise the $f_n$ using Gram Schmidt you get the following: (cf. the Legendre polynomials $P_n$).

$p_0(x) = {1 \over \sqrt{2}}$, $p_1(x) = \sqrt{3 \over 2} x$, $p_2(x) = \sqrt{5 \over 8} (3x^2-1)$, $p_3(x) = \sqrt{7 \over 8} (5 x^3-3x)$.

Let $\gamma_k = \langle p_k, g \rangle $ (the components of $g$ along $p_k$). Then \begin{eqnarray} \|g-\sum_k \alpha_k p_k \|^2 &=& \|g-\sum_k \gamma_k p_k+ \sum_k \gamma_k p_k -\sum_k \alpha_k p_k \|^2 \\ &=& \|g-\sum_k \gamma_k p_k+ \sum_k (\gamma_k - \alpha_k ) p_k \|^2 \\ &=& \|g-\sum_k \gamma_k p_k \|^2 + \| \sum_k (\gamma_k - \alpha_k) p_k \|^2 \\ &=& \|g-\sum_k \gamma_k p_k \|^2 + \sum_k |\gamma_k -\alpha_k|^2 \end{eqnarray} In particular, this shows that the closest member of $U$ to $g$ is given by $g^*=\sum_{k=1}^3 \gamma_k p_k$.

My computations give $g^*(x) = {1 \over 32} (45x-35x^3)$.