How can I find the Fourier series expansion of this (discontinuous) function?

219 Views Asked by At

Consider the following function $$ f(x) = \cases{0 \hspace{10mm} - \pi < x < 0 \\ 1 \hspace{16mm} 0 < x < \pi} $$

I wish to find the Fourier series expansion of this function. To do this, I know that a periodic function $f(x)$ defined on the interval $(-L, L)$ has the Fourier expansion $$ F(x) = \frac{a_{0}}{2} + \sum_{n=1}^{\infty} \left( a_n Cos \left( \frac{n \pi x}{L} \right) + b_n Sin \left( \frac{n \pi x}{L} \right) \right) $$

where the coefficients $a_n , b_n$ are given by $$ a_n = \frac{1}{L} \int_{-L}^{L} f(x) Cos \left( \frac{n \pi x}{L} \right) dx $$ and $$ b_n = \frac{1}{L} \int_{-L}^{L} f(x) Sin \left( \frac{n \pi x}{L} \right) dx $$

So for our function, the fourier coefficients would be $$ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) Cos \left( nx \right) dx $$ and $$ b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) Sin \left( nx \right) dx $$

But since our function is undefined at $x=-\pi$ and $x=\pi$ we cannot say what these integrals are?