Fourier Series/Exponential of x over Minus Pi to Pi

Theorem
Let $\map f x$ be the real function defined on $\R$ as:


 * $\map f x = \begin{cases}

e^x & : -\pi < x \le \pi \\ \map f {x + 2 \pi} & : \text{everywhere} \end{cases}$

Then its Fourier series can be expressed as:


 * $\displaystyle \map f x \sim \frac {\sinh \pi} \pi \paren {1 + 2 \sum_{n \mathop = 1}^\infty \frac {\paren {-1}^n} {1 + n^2} \paren {\cos n x - n \sin n x} }$

Proof
By definition of Fourier series:


 * $\displaystyle \map f x \sim \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty \paren {a_n \cos n x + b_n \sin n x}$

where for all $n \in \Z_{> 0}$:

Thus by definition of $f$:

For $n > 0$:

Now for the $\sin n x$ terms:

Finally: