Fourier series of $f$ in the interval $[-\pi, \pi]$ and evaluation of a series

I have the function $$f(x) :=\begin{cases}1,& \frac{\pi}{2}< x < \pi \\0, &-\frac{\pi}{2}< x < \frac{\pi}{2} \\-1, &-\pi < x < -\frac{\pi}{2}\end{cases}$$

and I compute $a_0, a_n$ and $b_n$, $$a_0=a_n=0,\quad\text{and}\quad b_n = \frac{1}{\pi}\left(\frac{2}{k}\cos\big(\frac{\pi k}{2}\big) - \frac{2}{k}\cos(\pi k)\right)$$

Now I have a problem with the calculation of the next sum: $$\sum_{n=1}^{\infty}\frac{(-1)^n}{(2n-1)}$$

I do not know how to compute this sum with $a_0,a_n$ and $b_n$. Thank you for your help!

• Hint: What's the taylor series for $\arctan(x)$? – Alex R. Jul 5 '17 at 20:42
• arctan(x) = x - (1/3)x^3 + (1/5)x^5 - (1/7)x^7...? – J.Doe Jul 5 '17 at 20:49
• And what if $x=1$? – Alex R. Jul 5 '17 at 20:57
• Solution is arctan(1). Thank you :) – J.Doe Jul 5 '17 at 21:26
