ExptoTrig[FourierSeries[Piecewise[{{-Pi,-2Pi<x<=0},{Pi,0<x<=2Pi}}],x,3]]
You can see, the function goes from $(-2\pi,2\pi]$
But Wolfram Alpha gives a wrong answer to this, because she computes it as if the function would go from $-\pi$ to $\pi$.
(The right answer should be $4\sin(\frac{x}{2}) + ..$.)
So, how can I use this command when the function's period T is not 2$\pi$ exactly?