# Calculate the orthogonal projection of a function onto a Hilbert Space

Let the Hilbert space $H = L_2[0,\infty[$ with the standard inner product $$\langle f,g\rangle:=\int_{0}^\infty \overline {f(x)} g(x)dx.$$ be given. Let $f_n \in L_2[0,\infty[ \to \mathbb{R}$ be given by $$f_n(x) = x^n e^{\frac {-x}{2}}.$$ Define $H_n = span\{f_0,\ f_1,\ \dots, f_n\}$.

Denote by $p_n$ the orthogonal projection of $f_n$ onto $H_{n-1}^{\bot}$ for $n\ge 1$ and set $p_0 = f_0$.

Show that $p_0,\ p_1, \dots, p_n$ is an orthogonal basis for $H_n$ and calculate $p_1$, $p_2$ and $p_3$.

Not sure what to do for this, any help would be appreciated!

• H$_n$ = span{f$_0$, f$_1$, ..., f$_n$}, may I ask where the formatting issues are? – emseon Jan 20 '15 at 9:38
• @daw Hopefully I've fixed it up now, I'm still quite new to the LaTeX formatting, although I'm not seeing the weird symbol between n and $ge$ – emseon Jan 20 '15 at 10:06
• Edited the post, please look at the differences to get familiar with Latex. – daw Jan 20 '15 at 10:46
• $f_n$ does not appear to be in $L_2[0, \infty)$... do you want $f_n(x) = x^n e^{-x/2}$ perhaps? Also: $f_n$ is in $H_{n+1}$ by your definition, so $p_n = f_n$, which is probably not what you wanted. – mollyerin Jan 20 '15 at 11:00
• Yes, because $f_n$ is already in $H_{n+1}$, so projecting it there doesn't do anything. You probably want to project onto $H_{n-1}^{\perp}$ or something like that. – mollyerin Jan 20 '15 at 12:00

If $P_{n}$ is the orthogonal projection onto $H_{n-1}^{\perp}$, then $P_{n}f_{n}$ is orthogonal to $H_{n-1}$, and is in $H_{n}$. Another way to obtain $P_{n}f_{n}$ is as the unique $P_{n}f_{n} = f_{n}-\sum_{k=0}^{n-1}a_{n,k}f_{k}$ such that $$(f_{n}-\sum_{k=0}^{n-1}a_{n,k}f_{k},f_{j})=0,\;\;\; 0 \le j \le n-1.$$ This is a system of $n$ equations in $n$ unknowns. You may recognize $f_n$ as the non-normalized vector obtained in the Gram-Schmidt process. To find explicit expressions, it helps to know that $$(f_n,f_m)=(x^{n}e^{-x/2},x^{m}e^{-x/2}) = \int_{0}^{\infty}x^{n+m}e^{-x}dx = (n+m)!.$$
Starting with $p_0 = f_0$, then the first element for Gram-Schmidt is $$u_0 = \frac{1}{(p_0,p_0)^{1/2}}p_{0}=p_{0}$$ Then, $$p_{1} = f_{1}-(f_1,u_0))u_0 = f_1-(1!)p_0 = (x-1)e^{-x},\\ u_{1} = \frac{1}{(p_1,p_1)^{1/2}}p_{1}=\frac{1}{(2!-2(1!)+1!)^{1/2}}(x-1)e^{-x}=p_1$$ And, \begin{align} p_{2} & = f_{2}-(f_2,u_1)u_1-(f_2,u_0)u_0 \\ & = f_{2}-(x^{2}e^{-x/2},(x-1)e^{-x/2})(x-1)e^{-x/2}-(x^{2}e^{-x/2},e^{-x/2})e^{-x/2} \\ & = \{x^{2}-(3!-2!)(x-1)-(2!)\}e^{-x/2} \\ & = \{x^{2}-4x+2\}e^{-x/2} \end{align} You can check that $(p_2,p_1)=0$ because it involves an integral of $$(x^{2}-4x+2)(x-1)e^{-x}=(x^{3}-5x^{2}+6x-2)e^{-x}$$ which gives $(3!)-5(2!)+6(1!)-2(0!)=6-10+6-2=0$. Likewise $(p_2,p_0)=0$ because $(2!)-4(1!)+2(0!)=0$. Finally, $$u_2 = \frac{1}{(p_2,p_2)^{1/2}}p_2 \\ p_3 = f_3 - (f_3,u_2)u_2 - (f_3,u_1)u_1 - (f_3,u_0)u_0.$$