# Approximating function by trigonometric polynomial

1. Feb 4, 2014

### ekkilop

Hi!

Say that we wish to approximate a function $f(x), \, x\in [0, 2\pi]$ by a trigonometric polynomial such that

$f(x) \approx \sum_{|n|\leq N} a_n e^{inx} \qquad (1)$

The best approximation theorem says that in a function space equipped with the inner product

$(f,g) = \frac{1}{2 \pi} \int_0^{2\pi} f \bar{g} dx$

the best possible approximation is the truncated Fourier series of the function, which follows from the orthonormality of the basis functions $\{ e^{inx} \}$. But what happens if we wish to consider a smaller interval, say $x \in [0, \pi/2]$, and a corresponding inner product

$(f,g) = \frac{2}{\pi} \int_0^{\pi/2} f \bar{g} dx$

but still use the functions $\{ e^{inx} \}$ (no longer orthonormal) in our approximation $(1)$? We could of course use the Fourier coefficients for all $n$ that are multiples of 4 and set the rest to zero to get the corresponding Fourier series, but this is no longer the best possible approximation. So my question is basically, what would the best approximation be in this case?

Thank you!

2. Feb 4, 2014

### Staff: Mentor

$$\frac{\partial (f,g)}{\partial a_n} = 0$$ for all $a_n$ is a natural result of an optimal solution. Analyzing this equation could give some interesting results.

3. Feb 5, 2014

### ekkilop

Yes, that was my original idea as well. If $g$ is the approximation in the RHS of $(1)$, then I reasoned that the optimal result should be when $(f-g) \perp f$. However, $(f-g, f)$ is a linear function in the coefficients $a_n$ so there are no extrema (I am assuming the coefficients are independent of x). Or perhaps I misunderstood something?

4. Feb 5, 2014

### Staff: Mentor

Ah, small fix:
I would expect that you want to minimize (f-g,f-g). As the inner product is linear in its arguments, (f-g,f-g) = (f,f) + (g,g) - (f,g) - (g,f) = (f,f) + (g,g) - 2 Re (f,g)
(f,f) is fixed, the other two parts depend on an and the expression should be minimal with respect to all an. The (g,g) part gives a nonlinearity with a proper minimum.