# Gram Schmidt process and polynomial basis inner product exercise

Let the vector space $$P_2$$ have the inner product:

$$\langle p,q\rangle=\int\limits_{-1}^{1}p(x)q(x)dx$$

Apply the Gram-Schmidt process to transform the standard $$S=\{1,x,x^2\}$$ into an orthonormal basis.

The book does not provide solution for this problem and I do not know how to solve it.

1-How can I transform the S basis into an orthonormal basis if I need at least three vectors since the dimension of the vector space in cause is 3?

2-Can someone provide me a solution?

• There are three vectors, $x \mapsto 1, x \mapsto x, x \mapsto x^2$. Jun 14, 2017 at 14:46

First, normalize first vector of the basis $\;v_1=1\;$:

$$\langle v_1,v_1\rangle=\langle 1,1\rangle:=\int_{-1}^11\cdot dx=2\implies \color{red}{u_1=\frac{v_1}{\left\|v_1\right\|}=\frac1{\sqrt2}}$$

Next, orthogonalize second vector wrt the first one:

$$w_2:=v_2-\langle v_2,u_1\rangle u_1=x-\left\langle x,\frac1{\sqrt2}\right\rangle \frac1{\sqrt2}=x-\frac12\int_{-1}^1x\,dx=x-\left.\frac14x^2\right|_{-1}^1=x$$

Now, orthonormalize that last vector:

$$\langle x,x\rangle=\int_{-1}^1x^2dx=\left.\frac13x^3\right|_{-1}^1=\frac23\implies\color{red}{u_2=\frac{w_2}{\left\|w_2\right\|}}=\sqrt\frac32\,x$$

Last step, and this you will do: orthogonalize third vector wrt the first two:

$$w_3:=x^2-\langle x^2,u_1\rangle u_1-\langle x^2,u_2\rangle u_2$$

and then take

$$\color{red}{u_3=\frac{w_3}{\left\|w_3\right\|}}$$

• Sorry for disturbing. But could you provide me the last step solution. I am getting $x^2-\frac{7}{6}$ after the orthogonolization. However $||w_3||=(-\frac{69}{105})^{\frac{1}{2}}$ which would have an imaginary root. What might I have done wrong? Jun 15, 2017 at 16:20
• $$w_3=x^2-\frac12\int_{-1}^1x^2dx-\overbrace{\frac32\int_{-1}^1x^3dx}^{=0}=x^2-\frac26=x^2-\frac13\implies$$$$\left\|w_3\right\|^2=\int_{-1}^1\left(x^2-\frac13\right)^2dx=\frac25+\frac29=\frac{28}{45}\implies u_3=\frac{w_3}{\left\|w_3\right\|}=\frac{3\sqrt5}{2\sqrt7}\left(x^2-\frac13\right)$$ Jun 15, 2017 at 19:53
• I think a (-4/3) is missing in the resolution of the integral, or i am wrong? Feb 13, 2018 at 22:23
• @ChanchoMuena What integral? Feb 14, 2018 at 7:28