1. Polynomial Approximations

The following is a worked example:

In the following, for example

$\displaystyle \frac{(g,p_0)}{(p_0,p_0)}p_0 = \frac{(-1)}{2}.1$

What I don't understand is that why they got $\displaystyle (g,p_0)=(-1)$.

Since $\displaystyle p_0 = 1$

And $\displaystyle (g,p_0) = \int^1_{-1} 1.g(x)dx$

But what do we need to substitute for $\displaystyle g$? Because this function is piece-wise, how do I know which one of the two functions I have to put into the formula?

2. Well, what are the definitions of $\displaystyle (g, p_0)$, $\displaystyle (g, p_1)$, etc.?

3. Originally Posted by HallsofIvy
Well, what are the definitions of $\displaystyle (g, p_0)$, $\displaystyle (g, p_1)$, etc.?
Those are inner products. Since $\displaystyle g$ and $\displaystyle p_0$ are continious functions on the given interval then their inner product is defined by

$\displaystyle (g,p_0)=\int^1_{-1}g(x)p_0 dx$

I belive that's the definition. The resulting polynomial we get in this problem is called "Legendre's polynomial", but unfortunently there is not much about it in my textbook.

4. For this:

$\displaystyle (g,p_0) = \int^1_{-1} 1.g(x)dx$

What should I substitute for "g(x)"? The g(x) is defined as a piece wise function. Do I need to substitute "-1" or "2x-1"? (apparently neither of them give the correct answer)