Fourier series for square wave signal 
Show that the Fourier series for the square wave function $$f(t)=\begin{cases}-1 & -\frac{T}{2}\leq t \lt 0, \\ +1 & \ \     \ \ 0 \leq  t \lt  \frac{T}{2}\end{cases}$$
is $$f(t)=\frac{4}{\pi}\left(\sin\left(\frac{2\pi t}{T}\right)+\frac{\sin(\frac{6\pi  t}{T})}{3}+\frac{\sin(\frac{10\pi  t}{T})}{5}+\cdots\right)$$


I understand that the general Fourier series expansion of the function $f(t)$ is given by $$f(t)=\frac{a_0}{2}+ \sum_{r=1}^{r=\infty}\left(a_r\cos\left(\frac{2\pi r t}{T}\right)+b_r\sin\left(\frac{2\pi r t}{T}\right)\right)$$ But what happened to the $$\frac{a_0}{2}$$ term at the beginning of
$$f(t)=\frac{a_0}{2}+ \sum_{r=1}^{r=\infty}\left(a_r\cos\left(\frac{2\pi r t}{T}\right)+b_r\sin\left(\frac{2\pi r t}{T}\right)\right)$$ for the general Fourier series expansion?
From advice, I've been told that the constant term can be found by integrating $f(t)$ such that $$\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}}f(t)\mathrm{d}t= 
\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \left(\frac{a_0}{2}+ \sum_{r=1}^{r=\infty} (a_r\cos\frac{2\pi r t}{T}+b_r\sin\frac{2\pi r t}{T})\right)\mathrm{d}t$$ from here could someone please show me the steps involved in showing that $$\frac{a_0}{2}=0$$
Many thanks,
Blaze
 A: First, your function considered on each of the intervals $[0,T/2[$ and $[-T/2,0[$ separately, is just a constant function. It's the whole that is non-constant. So, when you integrate, since you can separate out your integration over the different integration intervals, on them, you are just integrating a constant function.
So, $f$ didn't disappear, $f$ is just equal to $1$ over the interval $[0,T/2[$.
Second, your function is also odd. The constant term is found by simply integrating the function over an interval symmetric around the origin.
$$a_0=\frac{2}{T}\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}}f(t)\,\mathrm{d}t=\frac{2}{T}\int_{t=-\frac{T}{2}}^{t=0}f(t)\,\mathrm{d}t+\frac{2}{T}\int_{t=0}^{t=\frac{T}{2}}f(t)\,\mathrm{d}t \\ =\frac{2}{T}\int_{t=-\frac{T}{2}}^{t=0}-1 \, \,\mathrm{d}t+\frac{2}{T}\int_{t=0}^{t=\frac{T}{2}} 1 \, \,\mathrm{d}t = 0 \; .$$
Therefore the integral is zero.
EDIT: $$\begin{eqnarray}\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}}f(t)\,\mathrm{d}t & = &  \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \left(\frac{a_0}{2}+ \sum_{r=1}^{r=\infty} a_r\cos\frac{2\pi r t}{T}+b_r\sin\frac{2\pi r t}{T}\right)\,\mathrm{d}t\\
& = & \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \frac{a_0}{2}\,\mathrm{d}t+ \sum_{r=1}^{r=\infty} a_r \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}}\cos\frac{2\pi r t}{T}\,\mathrm{d}t+\sum_{r=1}^{r=\infty}b_r\int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \sin\frac{2\pi r t}{T}\,\mathrm{d}t \\ 
& = & \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \frac{a_0}{2}\,\mathrm{d}t+ \sum_{r=1}^{r=\infty} a_r \cdot 0+\sum_{r=1}^{r=\infty}b_r\cdot 0 \\
& = & \int_{t=-\frac{T}{2}}^{t=\frac{T}{2}} \frac{a_0}{2}\,\mathrm{d}t \\
& = & \frac{a_0}{2}\cdot T 
\end{eqnarray}$$
