# Approximating function by trigonometric polynomial

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!

mfb
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.

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?