Finding an orthonormal basis of a span over a set of polynomials?

I am attempting a homework problem, find the orthonormal basis of $V = span \{ 1, x ,x^2 + 1 \}$ over the defined inner product $\langle f, g \rangle = \int_0^1 f(x)g(x)x^2 dx$.

I know for this problem I will need to use the Gram-Schmidt process, though I am not sure how I can start to "pull" some vector $a_1$ from $V$ to start the process.

From how I understand the definition of span then

$$V = \{ a*1 + b*x + c*(x^2 + 1): a, b, c \in \Re \}$$

After searching around it seems the way to proceed is then to set $a,b,c$ to either $\{ (1, 0, 0), (0, 1, 0), (0, 0, 1) \}$ to select $1, x ,x^2 + 1$. And this is where I start to not follow the logic. It makes sense that when $a,b,c$ are set to one of the values you obtain either $a_1 = 1, a_2 = x, a_3 = x^2 + 1$ (which by the definition of $V$ above is correct, $a_n$ does lie in the span) when doing the Gram-Schmidt process, but it's as if $a,b,c$ magically disappear from the problem all together and I don't necessarily see how.

Though, following through similar problems I continued with the first two iterations of Gram-Schmidt

Iteration 1: $a,b,c = (1, 0, 0), a_1 = 1$ $$u_1(x) = a_1 = 1$$ $$e_1(x) = \frac{u_1(x)}{\| u_1(x) \|} = \frac{1}{\|1\|} = \frac{1}{\sqrt{\langle 1, 1 \rangle }} = \frac{x}{\sqrt{\int_0^1 1 * 1 * x^2 dx}} = \frac{1}{\sqrt{\frac{1}{3}}} = \sqrt{3}$$

Iteration 2: $a,b,c = (0, 1, 0), a_2 = x$ $$u_2(x) = a_2 - \langle a_2, e_1(x) \rangle e_1(x) = x - \langle x, e_1(x) \rangle e_1(x)$$ $$= x - \left( \int_0^1 x * \sqrt{3} * x^2 dx \right) * \sqrt{3} = x - \frac{\sqrt 3}{4}$$ $$e_2(x) = \frac{u_2(x)}{\| u_2(x) \|} = \frac{x - \frac{\sqrt 3}{4}}{\| x - \frac{\sqrt 3}{4} \|} = \frac{x - \frac{\sqrt 3}{4}}{\sqrt{ \langle x - \frac{\sqrt 3}{4}, x - \frac{\sqrt 3}{4} \rangle}}$$ $$= \frac{x - \frac{\sqrt 3}{4}}{\sqrt{\int_0^1 \left(x - \frac{\sqrt 3}{4}\right) * \left(x - \frac{\sqrt 3}{4}\right) * x^2 dx}} = \frac{x - \frac{\sqrt 3}{4}}{\sqrt{\frac{21}{80} - \frac{\sqrt 3}{8}}}$$

But this just seems to result in such "messy" numbers and equations that it doesn't seem to be right, based on the observations that homework problems usually result in nice looking numbers and equations.

Am I on the right path, or am I just completely misunderstanding how $V$ is found?

EDIT: If this is the right track (minus some math errors above), I still do not understand by what logic the choices of $a,b,c$ are made to produce the $a_n$ for the Gram-Schmidt process. Is it that I only need to select 3 orthonormal basis vectors of $\Re^3$? In all reality any $a,b,c$ could be chosen to produce an $a_n$ (given the definition of $V$ presented). But by choosing and orthonormal basis as the selections of $a,b,c$ do we assure ourselves that the $a_n$ will be orthogonal?

Does this mean that I make the selection, in order, $\{ (0, 1, 0), (1, 0, 0), (0, 0, 1) \}$? This produces a bit of a cleaner result as far as the values of $e_n$ are concerned.

Iteration 1: $a,b,c = (0, 1, 0), a_2 = x$ $$u_1(x) = a_1 = x$$ $$e_1(x) = \frac{u_1(x)}{\| u_1(x) \|} = \frac{x}{\|x\|} = \frac{x}{\sqrt{\langle x, x \rangle }} = \frac{x}{\sqrt{\int_0^1 x * x * x^2 dx}} = \frac{x}{\sqrt{\frac{1}{53}}} = \sqrt{5}$$

Iteration 2: $a,b,c = (1, 0, 0), a_2 = 1$ $$u_2(x) = a_2 - \langle a_2, e_1(x) \rangle e_1(x) = 1 - \langle 1, e_1(x) \rangle e_1(x)$$ $$= 1 - \left( \int_0^1 1 * \sqrt{5} * x^2 dx \right) * \sqrt{5} = 1 - \frac{\sqrt 5}{3} * \sqrt{5} = \frac{-2}{3}$$

$$e_2(x) = \frac{u_2(x)}{\| u_2(x) \|} = \frac{\frac{-2}{3}}{\| \frac{-2}{3} \|} = \frac{\frac{-2}{3}}{\sqrt{ \langle \frac{-2}{3},\frac{-2}{3} \rangle}}$$ $$= \frac{\frac{-2}{3}}{\sqrt{\int_0^1 \frac{-2}{3} * \frac{-2}{3} * x^2 dx}} = \frac{ \frac{-2}{3} }{ \sqrt{ \frac{4}{27}} } = -\sqrt{3}$$

• Just apply Gram Schmidt to the three polynomials that span $V$. – copper.hat Jan 28 '18 at 1:03

You are doing OK. Except that you have small math mistakes. Go back to $u_2$, on the second line. Notice that you have $\sqrt{3}$ twice, so $u_2(x)=x-1/4$
• I guess does my understanding of how $V$ is formed make sense? I think I am much to weak on the final step of producing some $a_n$ from $V$ to say that I fully understand the problem and the solution track I presented. – KDecker Jan 28 '18 at 1:26
• Also, I don't know if I understand the logic as to when one should/can stop "pulling" vectors from $V$ to create the orthonormal set? Is it that for the 3 choices of $a,b,c$ of $\{ (1, 0, 0), (0, 1, 0), (0, 0, 1) \}$ then I have properly spanned $\Re^3$? Could I switch the ordering, say, $\{ (0, 1, 0), (1, 0, 0), (0, 0, 1) \}$? – KDecker Jan 28 '18 at 3:06