# Math Help - Orthogonalization of polynomial

1. ## Orthogonalization of polynomial

Hi guys.
I have the following base for $\mathbb{R}_2[x]$: $\left \{ 1,x,x^2 \right \}$
I want to orthogonalize this base with respect to the inner product:
$=\int_{0}^{1}p(x)q(x)dx$

somthing doesn't add up, and I suspect that I have made some calculation error, even though I checked several times.

so let's say the new orthogonal base will be $\left \{ \tilde{v}_1, \tilde{v}_2, \tilde{v}_3 \right \}$
I first set $\tilde{v}_1=v_1=1$.
then:
$\tilde{v}_2=v_2-\frac{v_2\cdot v_1}{v_1\cdot v_1}v_1=x-\frac{1}{2}$ (I checked it - it is correct, since it's orthogonal to $v_1$, which is 1)

but when I try to find $\tilde{v}_3$, I get:

$\tilde{v}_3=v_3-\frac{v_3\cdot v_1}{v_1\cdot v_1}v_1-\frac{v_3\cdot v_2}{v_2\cdot v_2}v_2$

$\tilde{v}_3=x^2-\frac{\int_{0}^{1}x^2}{\int_{0}^{1}1}1-\frac{\int_{0}^{1}x^3}{\int_{0}^{1}x^2}x$

$\tilde{v}_3=x^2-\frac{1}{3}-\frac{3}{4}x$

so this is what I get, but $\tilde{v}_3$ is NOT orthogonal to neither $\tilde{v}_1$ or $\tilde{v}_2$!

any help would be greatly appreciated!

2. ## Re: Orthogonalization of polynomial

In your expression for $\tilde{v}_{3},$ the $v_{1}$ and $v_{2}$ (wherever they appear), on the RHS should be $\tilde{v}_{1}$ and $\tilde{v}_{2}$ shouldn't they ?

(You got lucky with $\tilde{v}_2},$ because $\tilde{v}_{1} = v_{1}.)$

3. ## Re: Orthogonalization of polynomial

Hi BobP, and thanks for the help.

I don't see why does it matter if I take $v_1$, $v_2$ or $\tilde{v}_1$, $\tilde{v}_2$.
both $v_1$, $v_2$ and $\tilde{v}_1$, $\tilde{v}_2$ spans the same vector space, so if a vector is orthogonal to $v_1$, $v_2$, it will be orthogonal to $\tilde{v}_1$, $\tilde{v}_2$ as well.
nevertheless, I tried to take $\tilde{v}_1,\tilde{v}_2$ instead, and this is what I get:

$\tilde{v}_3=v_3-\frac{v_3\cdot \tilde{v}_1}{\tilde{v}_1\cdot \tilde{v}_1}\tilde{v}_1-\frac{v_3\cdot \tilde{v}_2}{\tilde{v}_2\cdot \tilde{v}_2}\tilde{v}_2$

$\tilde{v}_3=v_3-\frac{1}{3}-\frac{\int_{0}^{1}x_2(x-\frac{1}{2})}{\int_{0}^{1}(x-\frac{1}{2})^2}(x-\frac{1}{2})$

$\tilde{v}_3=x^2+\frac{1}{5}x-\frac{7}{30}$

which is still not orthogonal to $v_1$/ $\tilde{v}_1$/ $v_2$/ $\tilde{v}_2$

4. ## Re: Orthogonalization of polynomial

The formula that you have for $\tilde{v}_{3}$ comes from the assumption that $\tilde{v}_{3}=v_{1}+\alpha \tilde{v}_{1}+\beta\tilde{v}_{2}.$
To calculate the coefficient $\beta$ (for example) you take the inner product of this equation with $\tilde{v}_{2}.$
That gets you
$(\tilde{v}_{3},\tilde{v}_{2})=(v_{1},\tilde{v}_{2} )+\alpha(\tilde{v}_{1},\tilde{v}_{2})+\beta(\tilde {v}_{2},\tilde{v}_{2}),$
from which
$\beta=-\frac{(v_{1},\tilde{v}_{2})}{(\tilde{v}_{2},\tilde {v}_{2})}.$
That doesn't happen if you use $v_{1} \text{ and } v_{2}$ rather than $\tilde{v}_{1} \text{ and } \tilde{v}_{2},$ since $v_{1} \text{ and } v_{2}$ are not orthogonal.

For the last bit, check your integration.
I get
$\tilde{v}_{3}= x^{2}-x+1/6.$

5. ## Re: Orthogonalization of polynomial

Great! Thank you so much.

6. ## Re: Orthogonalization of polynomial

Actually, I made a mistake !

I should have put $\tilde{v}_{3}=v_{3}+\dots .$

That changes the next two lines. You get the drift though ?

7. ## Re: Orthogonalization of polynomial

yeah, I'll get it from here. thanks.