I sort of understand the principle of the Fourier series, but when I watch the wiki page I don't understand how to get from:
${a_0 \over 2} + \sum_{n=1}^N[a_n cos({2\pi n x \over P}) + b_n sin({2\pi n x \over P})]$
to
$\sum_{n=-N}^N c_n e^{i{2\pi n x \over P}}$
To be clear what I don't understand is the transition from using the coefficients $a_n$ and $b_n$ to $c_n$. I am familiar with the Euler's formula. I noticed that the sum goes from -N to N in the second equation. In the article they write:
$\begin{align} a_n & = c_n + c_{-n} \\[12pt] b_n & = i(c_n - c_{-n}) \\[12pt] c_n & = \begin{cases} \frac{1}{2}(a_n - i b_n) & \text{for } n \ne 0, \\[12pt] \frac{1}{2}a_0 & \text{for }n = 0. \end{cases} \end{align}$
So to get an intuition I tried to take a simple example in which N = 4 for example. I assume if I was taking n=-1 and n=1 for example, summing the terms using the above relationships, etc. I would get back to $a_1 cos(...) + b_1 sin(...)$. But I didn't succeed. I realise it probably takes quite some time to show how to get from one to another, but I would be grateful if someone could show me or at least put me on the right track.
Thank you.