# I Question about Fourier series

1. Sep 19, 2016

### Gianmarco

I'm wondering if anyone could give me the intuition behind Fourier series. In class we have approximated functions over the interval $[-\pi,\pi]$ using either $1, sin(nx), cos(nx)$ or $e^{inx}$.
An example of an even function approximated could be:
$f(x) = \frac {(1,f(x))}{||1||^{2}}*1 + \sum^{inf}_{n=1}\frac{(cos(nx), f(x))}{||cos(nx)||^{2}}*cos(nx)$
where I've indicated the scalar product as (. , .) and the norm as || . ||.
From what I've understood, whenever computing the approximation using sin(nx) or cos(nx) the index of the sum starts from 1 and goes to infinity. Whenever dealing with $e^{inx}$ the index starts from - infinity and goes to infinity.
I think that when we compute the series approximation, we calculate the orthogonal projection of our original function on the infinite number of axis' given by $1, sin(nx), cos(nx)$ or $e^{inx}$. Is this correct? And if it is, then why does the index start from 1 for sine and cosine whereas it's the whole integer set for the exponential base? Any help is much appreciated! :)

2. Sep 19, 2016

### stevendaryl

Staff Emeritus
If you know Euler's formula, you can relate sines, cosines and exponentials as follows:

$e^{i n \theta} = cos(n \theta) + i sin(n \theta)$

So you can rewrite a Fourier series:

$\sum_{n=-\infty}^{n=+\infty} c_n e^{i n \theta} = (\sum_{n= -\infty}^{+\infty} c_n cos(n \theta)) + i (\sum_{n=-\infty}^{+\infty} c_n sin(n \theta))$

But we know: $cos(n \theta) = cos(-n \theta)$, and $cos(0) = 1$, and $sin(n \theta) = - sin(n \theta)$ and $sin(0) = 0$. So we can rewrite this as follows:

$\sum_{n=-\infty}^{n=+\infty} c_n e^{i n \theta} = c_0 + (\sum_{n= 1}^{+\infty} (c_n + c_{-n}) cos(n \theta)) + i (\sum_{n=1}^{+\infty} (c_n - c_{-n}) sin(n \theta))$

So a fourier series (where the index ranges from $-\infty$ to $+\infty$ is equivalent to a constant, plus a cosine series starting with 1, plus a sine series starting with +1.

3. Sep 19, 2016

### mathman

$cos(nx)=\frac{e^{inx}+e{-inx}}{2},\ sin(nx)=\frac{e^{inx}-e^{-inx}}{2i}$. If the function is even (cos series), the exp terms with +n and -n have the same coefficient, so you don't need them both. Similarly if the function is odd (sin series) the exp terms have coefficients wth the same magnitude and opposite sign, so you don't need them both. Functions neither odd or even need either the full exp series or sin and cos series together.