## Fourier Series

Let $f$ be a piecewise continuous function on the interval $[-T,T]$.  The Fourier Series of $f$ is the trigonometric series

where the $a_n$'s and $b_n$'s are given by the formulas

For example, let $f(x)$ be defined by

If we let $f(x)$ be periodic with period $2\pi$, it is referred to as a square wave.

Find $a_0$ first, $\displaystyle a_0=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)dx=\frac{1}{\pi}\int_{0}^{\pi}1dx=1$

Now find the $a_n$'s

And now for the $b_n$'s

Alternatively, $b_{2n-1}=\frac{2}{(2n-1)\pi}$, while $b_{2n}=0$

so,

Here are the first ten terms: