Problem:
Does $L^2([0,1])$ equipped with the inner product $$\langle f,g \rangle = \int_0^1 \overline{f(x)}g(x) \, dx$$ have an orthonormal basis of the form $\left\{f_n(x):=\sum\limits_{k=0}^n a_k x^{2k} \mid n \ge 0\right\}$?
Attempt:
I worked this out by hand and then checked with Mathematica. I think that no such basis exists. However, in my proof I showed that the orthonormal system need not even be complete.
Did I make a mistake somewhere?
Here is the Mathematica code:
u[n_, x_] := Sum[(a[k]+I*b[k])*x^(2*k), {k,0,n}]
f[m_, n_] := Integrate[ComplexExpand[Conjugate[u[m,x]]*u[n,x]], {x,0,1}]
Solve[{f[0,0]==1, f[0,1]==0, f[1,0]==0, f[1,1]==1}, {a[0],b[0],a[1],b[1]}]
In the code above I expanded each coefficient $a_k$ into its real and imaginary parts, and then solved the set of equations
$$\langle f_0,f_0 \rangle = 1, \langle f_0,f_1 \rangle = 0, \langle f_1,f_0 \rangle = 0, \langle f_1,f_1 \rangle = 1$$
but got an empty solution set.
The functions $1$, $x^2$, $x^4,\ldots,x^{2n},\ldots$ are linearly independent, so the Gram-Schmidt process does yield an orthonormal sequence with $f_n(x)=\sum_{i=0}^n a_{n,i}x^{2i}$, and the $a_{n.i}$ real. Is this system complete?
The system is complete iff the polynomials in $x^2$ are dense in $L^2[0,1]$. By the Stone-Weierstrass theorem, continuous functions on $[0,1]$ can be uniformly approximated by polynomials in $x^2$, and so also approximated in $L^2[0,1]$ by polynomials in $x^2$. As the continuous functions are dense in $L^2[0,1]$ then so are the polynomials in $x^2$. The orthonormal sequence is complete.