Calculating the Fourier Series of a discontinuous function

301 Views Asked by At

Let $f\left(x\right)=\begin{cases} 1,& \text{if } 0<x<\pi\\ 0, & \text{if } \pi<x<2\pi \end{cases}$

$f\left(x+2\pi\right)=f\left(x\right)$

I have worked out that $a_{0}=\dfrac{1}{2}$ and that $a_{n}=0$.
For $b_{n}$, I so far know that $b_{n}=\dfrac{1}{\pi}\int^{\pi}_{-\pi} f\left(x\right)\sin(nx) dx$ however I am not sure where to go from here?

2

There are 2 best solutions below

0
On BEST ANSWER

Use the definition of $f$: $$b_n=\frac1\pi \int_0^\pi \sin(nx) dx=\frac1{\pi n}(1-(-1)^n) $$

0
On

Since $f(x) = 0$ on the sub-interval $[-\pi,0]$ and $f(x) = 1$ on $[0,\pi]$, you maneuver your expression as follows: $$b_{n}=\dfrac{1}{\pi}\int^{\pi}_{-\pi} = \dfrac{1}{\pi}\int_{0}^{\pi} \sin(nx) \,dx =\frac{1}{\pi} \frac{1}{n} \left[ -\cos (nx) \right]_0^\pi = \left\{ \begin{array}{cc}\frac{2}{n\pi} & n \mbox{ odd} \\ \frac{2}{n\pi} & n \mbox{ even}\end{array} \right. $$

Notice that for finite truncation of the series at some $n$-th term, for large $n$, the sum looks very nearly like $f(x)$ except very near the points of discontinuity, where it "overshoots" by an amount which does not go to zero as $n$ goes to infinity. (The area under the overshoot does go to zero, because the width of the overshoot drops rapidly.) This is called the Gibbs Phenomenon.