Find the complex Fourier series representation of the function with period T defined by
f(t)= \begin{cases}1 & -T / 4<t<T / 4 \\ 0 & \text { otherwise }\end{cases}We find
\begin{aligned} c_n & =\frac{1}{T} \int_{-T / 4}^{T / 4} 1 \mathrm{e}^{-\mathrm{j} 2 n \pi t / T} \mathrm{~d} t \\ & =\frac{1}{T}\left[\frac{\mathrm{e}^{-\mathrm{j} 2 n \pi t / T}}{-\mathrm{j} 2 n \pi / T}\right]_{-T / 4}^{T / 4} \\ & =\frac{-1}{2 n \pi j}\left(\mathrm{e}^{-\mathrm{j} n \pi / 2}-\mathrm{e}^{\mathrm{j} n \pi / 2}\right) \\ & =\frac{1}{n \pi}\left(\frac{\mathrm{e}^{\mathrm{j} n \pi / 2}-\mathrm{e}^{-\mathrm{j} n \pi / 2}}{2 \mathrm{j}}\right) \\ & =\frac{1}{n \pi} \sin \frac{n \pi}{2} \end{aligned}Therefore,
f(t)=\sum_{n=-\infty}^{\infty} \frac{1}{n \pi} \sin \frac{n \pi}{2} \mathrm{e}^{\mathrm{j} 2 n \pi t / T}The observant reader will note that the expressions for c_n appear invalid when n = 0, since the denominator is then zero. We can compute c_o in either of two ways. Using an integral expression we see that
c_0=\frac{1}{T} \int_{-T / 4}^{T / 4} 1 \mathrm{~d} t=\frac{1}{2}Also, using a Taylor series expansion it is possible to show
\lim _{n \rightarrow 0} \frac{1}{T}\left[\frac{\mathrm{e}^{-\mathrm{j} 2 n \pi t / T}}{-\mathrm{j} 2 n \pi / T}\right]_{-T / 4}^{T / 4}=\frac{1}{2}giving a consistent result.