# Gram-Schmidt process in function subspace

I have a function space $\mathcal {F}([-1,1],\mathbb R)$ and the subspace $\mathcal{P_2}:=$ $(x\mapsto a_o+a_1x+a_2x^2| a_0,a_1,a_2 \in \mathbb R )$ for all polynomials with degree $\le2$. In this subspace the dot product and norm are defined as follows:

$<p,q>=\int_{-1}^{1}p(x)q(x)dx$

$||p||=\sqrt{<p,p>}$

I have four polynomials $p_1,...,p_4$

$p_1(x)=4x+3$

$p_2(x)=x^2+2x-1$

$p_3(x)=x^2-1$

$p_4(x)=11x^2+2$

I have to show that $p_1,p_2,p_3$ are linearly independant and I have to create an Orthonormal basis $q_1,q_2,q_3$

1) The first step is "trivial". They are linearly independant.

2) I want to use Gram-Schmidt to create an orthonormal basis.

$q_1=\frac{p_1}{||p_1||};$

$q_2'=p_2-<q_1,p_2> \cdot q_1 \Rightarrow q_2=\frac{q_2'}{||q_2'||}$

$q_3'=p_3-<q_1,p_3>\cdot q_1-<q_2,p_3>\cdot q_2 \Rightarrow q_3=\frac{q_3'}{||q_3'||}$

$\vec{p_1}=\begin{pmatrix}0\\4\\3\end{pmatrix}; ||\vec{p_1}||=\sqrt{0^2+4^2+3^2}=5 \Rightarrow \color{red}{\vec{q_1}=\frac{1}{5}\begin{pmatrix}0\\4\\3\end{pmatrix}}$

$\vec{q_2'}=\begin{pmatrix}1\\2\\-1\end{pmatrix}-(\int_{-1}^{1}(\frac{4}{5}x+\frac{3}{5})(x^2+2x-1)dx)\begin{pmatrix}0\\\frac{4}{5}\\\frac{3}{5}\end{pmatrix}=\begin{pmatrix}1\\2\\-1\end{pmatrix}-(\frac{4}{15})\begin{pmatrix}0\\\frac{4}{5}\\\frac{3}{5}\end{pmatrix}=\begin{pmatrix}1\\\frac{134}{75}\\\frac{-29}{25}\end{pmatrix}$

As you can see, the numbers are getting extremely ugly. The next step is even worse. Am I doing something wrong?

Thanks

• Just that the numbers "get ugly" is no reason to believe it is wrong. Why not check if what you have so far is indeed orthonormal? – quid Dec 13 '14 at 13:36
• @quid If I am correct then the dot product of two orthogonal vectors should be 0. I am getting $\frac{11}{15}$ though. – qmd Dec 13 '14 at 13:41
• Yes two vectors are called orthogonal if their dot-product is 0. – quid Dec 13 '14 at 13:47
• Yeah. Since I am getting $\frac{11}{5}$ they are not orthogonal. I can't really see where I have made a mistake though. – qmd Dec 13 '14 at 13:52
• I just need to find a basis for $p_1, p_2, p_3$ Edit: I get it now. Just like you and Lee said, I used the wrong definition of the dot product. Thank you very much for your help. – qmd Dec 13 '14 at 14:03

Because there is a mistake on $\vec{p_{1}}$.
$\vec{p_{1}}=\frac{\vec{q_{1}}}{||\vec{q_{1}}||} = \frac{\vec{q_{1}}}{\sqrt{<\vec{q_{1}},\vec{q_{1}}>}}$
$<\vec{q_{1}},\vec{q_{1}}>=∫^{1}_{-1}(4x+3)(4x+3)dx$