Fourier Series/Square Wave

Theorem


Let $\map f x$ be the real function defined on the open interval $\openint {-l} l$ as:


 * $\map f x = \begin{cases} -1 & : x \in \openint {-l} 0 \\ 1 & : x \in \openint 0 l \end {cases}$

Then its Fourier series can be expressed as:

Proof
Let $\map f x$ be the function defined as:
 * $\forall x \in \openint {-l} l: \begin{cases} -1 & : -l < x < 0 \\ 1 & : 0 < x < l \end {cases}$

By inspection we see that $\map f x$ is an odd function.

Hence from Fourier Series for Odd Function over Symmetric Range we can express $f$ by a half-range Fourier sine series:


 * $\displaystyle \map f x \sim \sum_{n \mathop = 1}^\infty b_n \sin \dfrac {n \pi x} l$

where for all $n \in \Z_{> 0}$:
 * $b_n = \displaystyle \frac 2 l \int_0^l \map f x \sin \dfrac {n \pi x} l \rd x$

over the interval $\openint 0 l$.

In that interval $\openint 0 l$, we have:
 * $\map f x = 1$

Hence:

The result follows.