What are the Fourier series of $f(x)$ where $x \in [-\pi, \pi]$ defined by
$$f(n) = \begin{cases} 1, & \text{if $x \in$ [0,$\pi$)} \\ 0, & \text{if $x \in$ [$-\pi$,0)} \\ \end{cases} $$
And what are the complex Fourier series?
My result is
$$ \frac{\sqrt{2}}{2} + 2\sum_{n=0}^\infty \frac{\sin((2n+1)x)}{(2k+1)\pi}$$
and for the complex Fourier series
$$ \frac{\sqrt{2}}{2} + \sum_{n=-\infty}^\infty \frac{-ie^{inx}}{n\pi}$$