[Math] Orthonormalize the set of functions {1,x}

inner-productslinear algebraorthogonal-polynomials

I'm having trouble while doing this exercise, it says:

In the vector space of the continuous functions in [0,1] with the inner product :
$$\langle f,g \rangle = \int_{0}^{1}f(x)g(x)dx$$
a) Orthonormalize the set of functions $\left\{1,x\right\}$

So I assumed $B$ as a base of the vector space $ \prod^{1} $ (the canonical base) $B = \left\{(1,0),(0,1)\right\} $ and applied Gram-Schmidt method to orthonormalize the functions.

The first one it's already normalized for that inner product $\vec{u_{1}} = \frac{\vec{v_{1}}}{\|\vec{v_{1}}\|} = (1,0)$

So, for the second one $\vec{u_{2}} = \frac{\vec{v_{2}}-\langle \vec{v_{2}},\vec{u_{1}}\rangle \vec{u_{1}}}{\|\vec{v_{2}}-\langle \vec{v_{2}},\vec{u_{1}}\rangle \vec{u_{1}}\|} = \frac{(0,1)-\left(\frac{1}{2},0\right)}{\|\left(-\frac{1}{2},1\right)\|}=(-6,12)$

But then $\|\vec{u_{2}}\|=\sqrt{\langle \vec{u_{2}},\vec{u_{2}}\rangle} = \sqrt{12} \neq 1 $ ; so $\vec{u_{2}}$ is not normal.

I don't know whether I'm all wrong assuming the base or doing it wrong with the Gram-Schmidt method, but I've been stuck for more than an hour with this :$.

Best Answer

You don't need to use the standard basis, you already have a basis of $\{1,x\}$ for the space you're interested in, namely $Span(\{1,x\})$. Use Gram-Schmidt on those vectors directly.

As you point out $\langle 1,1\rangle=1$ already, so you have one orthonormal basis element already. For the other one, take $x-\frac{\langle x,1\rangle}{\langle 1,1\rangle}1=x-\langle x,1\rangle=x-\int_0^1xdx=x-0.5x^2|_0^1=x-\frac{1}{2}$.

Now $x-\frac{1}{2}$ is orthogonal to $1$, and you need to normalize it to make it length $1$. We calculate $\langle x-0.5,x-0.5\rangle=\int_0^1 (x-0.5)^2dx=\int_0^1x^2-x+0.25dx=\frac{1}{3}x^3-\frac{1}{2}x^2+0.25x|_0^1=\frac{1}{3}-\frac{1}{2}+\frac{1}{4}=\frac{1}{12}$.

Putting it all together, $\{1,x\sqrt{12}-\sqrt{3}\}$ is an orthonormal basis for the desired space.