Minimizing the $L^2$ error when approximating with trigonometric polynomials

945 Views Asked by At

I want to find approximations ${\rm g}_{n}\left(x\right) \in T_{n}$ of $\,\,{\rm f}\left(x\right)$, so that the error $$ \left\vert\left\vert\,{\rm f} - {\rm g}_{n}\,\right\vert\right\vert^{2} = \int_{0}^{2\pi} \left[{\rm f}\left(x\right) - {\rm g}_{n}\left(x\right)\right]^{2}\,{\rm d}x $$ is minimal.

How to do that?

Here are my $f(x)$ functions:

a) $f(x) = x$,

b) $f(x) = (x-\pi)^2$

c) $f(x) =e^x$

d) $f(x) = \left\{ \begin{array}{l l l} 1, & 0 \leq x \leq \pi, \\ 0, & \pi < x \leq 2 \pi. \end{array} \right.$

Thank you very much guys =)

PS: $T_n$ is the vector space of the trigonometric polynomials with size $\leq n$

1

There are 1 best solutions below

5
On BEST ANSWER

Of all the $n^{th}$ degree trigonometric polynomials, the $n^{th}$ partial sum of the Fourier series of $f$ best approximates $f$. To put it mathematically,

$\|f-s_n\| \leq \|f-p\| \, \, \, \ s_n, p \in T_n$

So just find the Fourier coefficients if the given functions in $[0, 2\pi]$ and you have your answer.

http://en.wikipedia.org/wiki/Fourier_series#Least_squares_property

$$ s_n = a_0 + \sum\limits_{k=1}^n a_k\cos kx + b_k \sin kx \\ a_0 = \frac{1}{2\pi}\int\limits_0^{2\pi}f \ \mathrm{d}x \\ a_k = \frac{1}{\pi}\int\limits_0^{2\pi}f\cos kx \ \mathrm{d}x \\ b_k = \frac{1}{\pi}\int\limits_0^{2\pi}f \sin kx \ \mathrm{d}x $$