# Fourier Series/Exponential of x over Minus Pi to Pi

## Theorem

Let $f \left({x}\right)$ be the real function defined on $\R$ as:

$f \left({x}\right) = \begin{cases} e^x & : -\pi < x \le \pi \\ f \left({x + 2 \pi}\right) & : \text{everywhere} \end{cases}$

Then its Fourier series can be expressed as:

$\displaystyle f \left({x}\right) \sim \frac {\sinh \pi} \pi \left({1 + 2 \sum_{n \mathop = 1}^\infty \frac {\left({-1}\right)^n} {1 + n^2} \left({\cos n x - n \sin n x}\right)}\right)$

## Proof

By definition of Fourier series:

$\displaystyle f \left({x}\right) \sim \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty \left({a_n \cos n x + b_n \sin n x}\right)$

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

 $\displaystyle a_n$ $=$ $\displaystyle \dfrac 1 \pi \int_{-\pi}^\pi f \left({x}\right) \cos n x \rd x$ $\quad$ $\quad$ $\displaystyle b_n$ $=$ $\displaystyle \dfrac 1 \pi \int_{-\pi}^\pi f \left({x}\right) \sin n x \rd x$ $\quad$ $\quad$

Thus by definition of $f$:

 $\displaystyle a_0$ $=$ $\displaystyle \frac 1 \pi \int_{-\pi}^\pi f \left({x}\right) \rd x$ $\quad$ Cosine of Zero is One $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \int_{-\pi}^\pi e^x \rd x$ $\quad$ Definition of $f$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \big[{e^x}\big]_{-\pi}^\pi$ $\quad$ Primitive of Exponential Function $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left({e^\pi - e^{-\pi} }\right)$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \dfrac {\left({e^\pi - e^{-\pi} }\right) } 2$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \sinh \pi$ $\quad$ Definition of Hyperbolic Sine $\quad$

$\Box$

For $n > 0$:

 $\displaystyle a_n$ $=$ $\displaystyle \dfrac 1 \pi \int_{-\pi}^\pi f \left({x}\right) \cos n x \rd x$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \dfrac 1 \pi \int_{-\pi}^\pi e^x \cos n x \rd x$ $\quad$ Definition of $f$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left[{\frac {e^x \left({\cos n x + n \sin n x}\right)} {1 + n^2} }\right]_{-\pi}^\pi$ $\quad$ Primitive of $e^x \cos n x$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left({\frac {e^\pi \left({\cos n \pi + n \sin n \pi}\right)} {1 + n^2} - \frac {e^{-\pi} \left({\cos n \left({-\pi}\right) + n \sin n \left({-\pi}\right)}\right)} {1 + n^2} }\right)$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left({\frac {e^\pi \cos n \pi} {1 + n^2} - \frac {e^{-\pi} \cos n \left({-\pi}\right)} {1 + n^2} }\right)$ $\quad$ Sine of Multiple of Pi $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left({\frac {e^\pi \left({-1}\right)^n - e^{-\pi} \left({-1}\right)^n} {1 + n^2} }\right)$ $\quad$ Cosine of Multiple of Pi $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 2 \pi \frac {\left({-1}\right)^n} {1 + n^2} \frac {e^\pi - e^{-\pi} } 2$ $\quad$ manipulation $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {2 \left({-1}\right)^n} {\left({1 + n^2}\right) \pi} \sinh \pi$ $\quad$ Definition of Hyperbolic Sine $\quad$

$\Box$

Now for the $\sin n x$ terms:

 $\displaystyle b_n$ $=$ $\displaystyle \frac 1 \pi \int_{-\pi}^\pi f \left({x}\right) \sin n x \rd x$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \int_{-\pi}^\pi e^x \sin n x \rd x$ $\quad$ Definition of $f$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left[{\frac {e^x \left({\sin n x - n \cos n x}\right)} {1 + n^2} }\right]_{-\pi}^\pi$ $\quad$ Primitive of $e^x \sin n x$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left({\frac {e^\pi \left({\sin n \pi - n \cos n \pi}\right)} {1 + n^2} - \frac {e^{-\pi} \left({\sin n \left({-\pi}\right) - n \cos n \left({-\pi}\right)}\right)} {1 + n^2} }\right)$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 \pi \left({\frac {-e^\pi n \cos n \pi} {1 + n^2} - \frac {-e^{-\pi} n \cos n \left({-\pi}\right)} {1 + n^2} }\right)$ $\quad$ Sine of Multiple of Pi $\quad$ $\displaystyle$ $=$ $\displaystyle -\frac 1 \pi \left({\frac {e^\pi n \left({-1}\right)^n - e^{-\pi} n \left({-1}\right)^n} {1 + n^2} }\right)$ $\quad$ Cosine of Multiple of Pi $\quad$ $\displaystyle$ $=$ $\displaystyle -\frac {2 n} \pi \frac {\left({-1}\right)^n} {1 + n^2} \frac {e^\pi - e^{-\pi} } 2$ $\quad$ manipulation $\quad$ $\displaystyle$ $=$ $\displaystyle -\frac {2 n \left({-1}\right)^n} {\left({1 + n^2}\right) \pi} \sinh \pi$ $\quad$ Definition of Hyperbolic Sine $\quad$

$\Box$

Finally:

 $\displaystyle f \left({x}\right)$ $\sim$ $\displaystyle \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty \left({a_n \cos n x + b_n \sin n x}\right)$ $\quad$ $\quad$ $\displaystyle$ $=$ $\displaystyle \frac 1 2 \frac 2 \pi \sinh \pi + \sum_{n \mathop = 1}^\infty \left({\frac {2 \left({-1}\right)^n} {\left({1 + n^2}\right) \pi} \sinh \pi \cos n x - \frac {2 n \left({-1}\right)^n} {\left({1 + n^2}\right) \pi} \sinh \pi \sin n x}\right)$ $\quad$ substituting for $a_0$, $a_n$ and $b_n$ from above $\quad$ $\displaystyle$ $=$ $\displaystyle \frac {\sinh \pi} \pi \left({1 + 2 \sum_{n \mathop = 1}^\infty \frac {\left({-1}\right)^n} {1 + n^2} \left({\cos n x - n \sin n x}\right)}\right)$ $\quad$ simplifying $\quad$

$\blacksquare$