Fourier Series/Minus Pi over 0 to Pi, x minus Pi over Pi to 2 Pi

Theorem
Let $\map f x$ be the real function defined on $\openint 0 {2 \pi}$ as:


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

-\pi & : 0 < x \le \pi \\ x - \pi & : \pi < x < 2 \pi \end{cases}$

Then its Fourier series can be expressed as:


 * $\map f x \sim \displaystyle -\frac \pi 4 + \sum_{n \mathop = 1}^\infty \paren {\frac {1 - \paren {-1}^n} {n^2 \pi} \cos n x + \frac {\paren {-1}^n - 1} 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:

For $n > 0$:

Now for the $\sin n x$ terms:

Finally: