[Math] Orthogonal Projection on a Polynomial Space

inner-productslinear algebraorthogonal-polynomialsorthogonalityorthonormal

An inner product is defined on $P3$ such that $<f, g>$ $=$ $\int _{-1}^1\:f\left(t\right)g\left(t\right)dt$.

What is the orthogonal projection of $p(x)$ $=$ $x^3$ onto $P2$?

So I got that $f_1\left(x\right)=1,\:f_2\left(x\right)\:=\:x,\:f_3\left(x\right)\:=\:x^2$ form a basis of $P2$. I also got that $g_1\left(x\right)=f_1\left(x\right)=1$, $g_2\left(x\right)=f_2-\frac{<f_2,\:g_1>}{<g_1,\:g_1>}g_1$ and $g_3\left(x\right)=f_3-\frac{<f_3,\:g_1>}{<g_1,\:g_1>}g_1-\frac{<f_3,\:g_2>}{<g_2,\:g_2>}g_2$.

From this, I got that, $g_2\left(x\right)=x$ and $g_3\left(x\right)=x^2-\frac{1}{3}$.

I know that an orthonormal basis of $P2$ will have the form $\left\{\frac{g_1}{\left|g_1\right|},\:\frac{g_2}{\left|g_2\right|},\:\frac{g_3}{\left|g_3\right|}\right\}$, but I am quite confused on how to proceed further from this. I am not entirely sure how I would compute the norm and projection of the polynomials I have found and how I would proceed from this basis to find the required projection.

So if anyone can tell me if what I have done so far is correct or not, and how exactly I should proceed, I would greatly appreciate it!

Best Answer

The process looks good so far, as $g_1,g_2,$ and $g_3$ form an orthogonal basis on $P_2$. If you'd like an orthonormal basis, then these functions must be normalized. This means that we take

$$g_1(x)=\frac{1}{\sqrt 2},\;\;\;\;g_2(x)=\sqrt{\frac{3}{2}}x,\;\;\;\;g_3(x)=\sqrt{\frac{5}{2}}\frac{3x^2-1}{2}$$

The projection of a function $f$ onto this space is a function of the form $h=a_1g_1+a_2g_2+a_3g_3$ that minimizes the squared error between the two functions. We then seek to minimize

$$\langle f-h,f-h\rangle=\int_{-1}^1\left(f(x)-h(x)\right)^2dx$$

The mutual orthogonality makes this easy to compute (and I will leave it to you to check this), and we get

$$\langle f-h,f-h\rangle=\int_{-1}^1f(x)^2dx-2a_1\int_{-1}^1f(x)g_1(x)dx-2a_2\int_{-1}^1f(x)g_2(x)dx-2\int_{-1}^1f(x)g_3(x)dx$$

$$+a_1^2+a_2^2+a_3^2$$

In each term with an $a_i$, we complete the square to get

$$\langle f-h,f-h\rangle=\int_{-1}^1f(x)^2dx+\left(a_1-\int_{-1}^1f(x)g_1(x)dx\right)^2+\left(a_2-\int_{-1}^1f(x)g_2(x)dx\right)^2+\left(a_3-\int_{-1}^1f(x)g_3(x)dx\right)^2-\left(\int_{-1}^1f(x)g_1(x)dx\right)^2-\left(\int_{-1}^1f(x)g_2(x)dx\right)^2-\left(\int_{-1}^1f(x)g_3(x)dx\right)^2$$

This inner product is minimized when we take the quadratic terms with the $a_i$ to be $0$, since they are the sum of squares and are minimized when they are $0$. We then have

$$a_i=\int_{-1}^1f(x)g_i(x)dx=\langle f,g_i\rangle$$

for $i=1,2,3$. Thus, your projection of $f$ onto $P_2$ is

$$f\approx\langle f,g_1\rangle g_1+\langle f,g_2\rangle g_2+\langle f,g_3\rangle g_3$$

Sidenote: the functions $g_1,g_2,$ and $g_3$ are actually called the Legendre polynomials, and if you are ever interested in learning more about them, all it takes is a quick Google search to learn more.

Related Question