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}$: {{begin-eqn}} {{eqn | l = a_n       | r = \dfrac 1 \pi \int_{-\pi}^\pi \map f x \cos n x \rd x }} {{eqn | l = b_n       | r = \dfrac 1 \pi \int_{-\pi}^\pi \map f x \sin n x \rd x }} {{end-eqn}} Thus by definition of $f$: {{begin-eqn}} {{eqn | l = a_0       | r = \frac 1 \pi \int_{-\pi}^\pi \map f x \rd x       | c = Cosine of Zero is One }} {{eqn | r = \frac 1 \pi \int_{-\pi}^\pi e^x \rd x       | c = Definition of $f$ }} {{eqn | r = \frac 1 \pi \bigintlimits {e^x} {-\pi} \pi       | c = Primitive of Exponential Function }} {{eqn | r = \frac 1 \pi \paren {e^\pi - e^{-\pi} }       | c =  }} {{eqn | r = \frac 2 \pi \dfrac {\paren {e^\pi - e^{-\pi} } } 2       | c =  }} {{eqn | r = \frac 2 \pi \sinh \pi       | c = {{Defof|Hyperbolic Sine}} }} {{end-eqn}} {{qed|lemma}} For $n > 0$: {{begin-eqn}} {{eqn | l = a_n       | r = \dfrac 1 \pi \int_{-\pi}^\pi \map f x \cos n x \rd x       | c =  }} {{eqn | r = \dfrac 1 \pi \int_{-\pi}^\pi e^x \cos n x \rd x       | c = Definition of $f$ }} {{eqn | r = \frac 1 \pi \intlimits {\frac {e^x \paren {\cos n x + n \sin n x} } {1 + n^2} } {-\pi} \pi       | c = Primitive of $e^x \cos n x$ }} {{eqn | r = \frac 1 \pi \paren {\frac {e^\pi \paren {\cos n \pi + n \sin n \pi} } {1 + n^2} - \frac {e^{-\pi} \paren {\cos n \paren {-\pi} + n \sin n \paren {-\pi} } } {1 + n^2} }       | c =  }} {{eqn | r = \frac 1 \pi \paren {\frac {e^\pi \cos n \pi} {1 + n^2} - \frac {e^{-\pi} \cos n \paren {-\pi} } {1 + n^2} }       | c = Sine of Multiple of Pi }} {{eqn | r = \frac 1 \pi \paren {\frac {e^\pi \paren {-1}^n - e^{-\pi} \paren {-1}^n} {1 + n^2} }       | c = Cosine of Multiple of Pi }} {{eqn | r = \frac 2 \pi \frac {\paren {-1}^n} {1 + n^2} \frac {e^\pi - e^{-\pi} } 2       | c = manipulation }} {{eqn | r = \frac {2 \paren {-1}^n} {\paren {1 + n^2} \pi} \sinh \pi       | c = {{Defof|Hyperbolic Sine}} }} {{end-eqn}} {{qed|lemma}} Now for the $\sin n x$ terms: {{begin-eqn}} {{eqn | l = b_n       | r = \frac 1 \pi \int_{-\pi}^\pi \map f x \sin n x \rd x       | c =  }} {{eqn | r = \frac 1 \pi \int_{-\pi}^\pi e^x \sin n x \rd x       | c = Definition of $f$ }} {{eqn | r = \frac 1 \pi \intlimits {\frac {e^x \paren {\sin n x - n \cos n x} } {1 + n^2} } {-\pi} \pi       | c = Primitive of $e^x \sin n x$ }} {{eqn | r = \frac 1 \pi \paren {\frac {e^\pi \paren {\sin n \pi - n \cos n \pi} } {1 + n^2} - \frac {e^{-\pi} \paren {\sin n \paren {-\pi} - n \cos n \paren {-\pi} } } {1 + n^2} }       | c =  }} {{eqn | r = \frac 1 \pi \paren {\frac {-e^\pi n \cos n \pi} {1 + n^2} - \frac {-e^{-\pi} n \cos n \paren {-\pi} } {1 + n^2} }       | c = Sine of Multiple of Pi }} {{eqn | r = -\frac 1 \pi \paren {\frac {e^\pi n \paren {-1}^n - e^{-\pi} n \paren {-1}^n} {1 + n^2} }       | c = Cosine of Multiple of Pi }} {{eqn | r = -\frac {2 n} \pi \frac {\paren {-1}^n} {1 + n^2} \frac {e^\pi - e^{-\pi} } 2       | c = manipulation }} {{eqn | r = -\frac {2 n \paren {-1}^n} {\paren {1 + n^2} \pi} \sinh \pi       | c = {{Defof|Hyperbolic Sine}} }} {{end-eqn}} {{qed|lemma}} Finally: {{begin-eqn}} {{eqn | l = \map f x       | o = \sim       | r = \frac {a_0} 2 + \sum_{n \mathop = 1}^\infty \paren {a_n \cos n x + b_n \sin n x}       | c =  }} {{eqn | r = \frac 1 2 \frac 2 \pi \sinh \pi + \sum_{n \mathop = 1}^\infty \paren {\frac {2 \paren {-1}^n} {\paren {1 + n^2} \pi} \sinh \pi \cos n x - \frac {2 n \paren {-1}^n} {\paren {1 + n^2} \pi} \sinh \pi \sin n x}       | c = substituting for $a_0$, $a_n$ and $b_n$ from above }} {{eqn | r = \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} }       | c = simplifying }} {{end-eqn}} {{qed}}