# Thread: Inner Product Orthogonal Question

1. ## Inner Product Orthogonal Question

Find the polynomial p(x) $\in P_3$ which minimizes the distance $\int\limits_{-1}^{1} (cos(\pi x) - p(x))^2 dx$

2. Originally Posted by flaming
Find the polynomial p(x) $\in P_3$ which minimizes the distance $\int\limits_{-1}^{1} (cos(\pi x) - p(x))^2 dx$
Presumably $P_3$ means the set of cubic polynomials?

Step 1 is to find an orthonormal basis $\{f_0(x),f_1(x),f_2(x),f_3(x)\}$ for $P_3$, with respect to the inner product given by $\langle f(x),g(x)\rangle = \int_{-1}^1f(x)g(x)\,dx$. You do this by starting with the natural basis $\{1,x,x^2,x^3\}$ and applying the Gram–Schmidt process.

After you have done that, the rest is easy, because p(x) will be given by the formula $p(x) = \sum_{j=0}^3\langle\cos(\pi x),f_j(x)\rangle f_j(x)$.