I am having trouble converting the complex version of a Fourier Series into a purely real one. The function has value 1 for $0\leq x< \pi$ and 0 for $\pi\leq x< 2\pi$. Calculating the
Calculating the complex Fourier coefficients yields $C_n =\frac{e^{-i n \pi} -1}{-i n\sqrt{2\pi}}$
After obtaining the summation for the complex Fourier series by multiplying the coefficients by $e^{inx}$, applying Euler's formula, and splitting up the sum for even and odd n I obtain the following:
$2\sum _{n = -\infty, odd}^\infty \frac{\sin nx - i\cos nx}{n\sqrt{2\pi}}$
Should I just take the real part of the expression above or is there something I forgot to do ? (Calculations should be correct as I checked all my integrals on a calculator.) Thanks!