c1[n_] := 1/2/Pi Integrate[Sign[x] Exp[-I n x], {x, -Pi, Pi}];
c2[n_] = Simplify[c1[n], Assumptions -> Element[n, Integers]];
c[n_] := If[n == 0, c1[0] = 0];
f5[x_] = Sum[c[k] Exp[I k x], {k, -10, 10}];
Plot[{f5[x], Sign[x]}, {x, -Pi, Pi}]
I am trying to plot the $Sign[x]$ function and the series: $\displaystyle\sum_{n=-\infty}^\infty \dfrac{i(-1)^n - i}{n\pi}e^{inx} $ (which should be the answer to the integral in the code) on the same graph, but I cannot seem to get it to work. It displays no error, just an empty graph.


If[n == 0, c1[0] = 0];does not make sense to me and it is the reason thatf5[x]contains unwantedNullsigns. – halirutan Jan 06 '14 at 00:54