# Math Help - Fourier Series

1. ## Fourier Series

Find the fourier series for

$f(x) = \left\{\begin{array}{c l} 0 & -\pi < x < 0 \\ 1 & 0 < x < \pi \\ f(x + 2\pi) & -\infty < x < \infty \end{array}\right.

$

By considering the Fourier series at $x = \frac{\pi}{2}$ show that $\frac{\pi}{4} = \sum_{m=1}^{\infty} \frac{(-1)^{m+1}}{(2m-1)}$

I am not enjoying these at the moment. I get lost. Really lost.

$A_n=\frac{1}{\pi}\int_{-\pi}^{\pi} f(x) \cos(nx)dx,\quad n=0,1,2,\cdots$

$B_n=\frac{1}{\pi}\int_{-\pi}^{\pi} f(x) \sin(nx)dx,\quad n=1,2,\cdots$

You can calculate those right?

$A_n=\frac{1}{\pi} \int_0^{\pi} \cos(nx)dx=\frac{1-\cos(n\pi)}{n},\quad n=1,2,\cdots$

$B_n=\frac{1}{\pi} \int_0^{\pi} \sin(nx)dx=0$

That's a good start. Then the Fourier series is:

$f(x)=\frac{1}{2}+\frac{1}{\pi} \sum_{n=1}^{\infty} \frac{1-\cos(n\pi)}{n} \sin(n x)$

Now, evaluate that at $x=\pi/2$ and convert the sines and cosines to minus one raised to powers and adjust the summation expression accordingly.

3. I get $a_n = 0$

$b_n = 0$ if n is even, $b_n = \frac{2}{n\pi}$ if n is odd

and

$a_0 = \frac{1}{2}$

So fourier series is

$f(x) = \frac{1}{2} + \sum_{n = 1}^{\infty} \frac{2}{n\pi} \sin (nx)$.

Is this correct?

Im confused with how to "convert the sines and cosines to minus one raised to powers and adjust the summation expression accordingly." Can someone please explain?

4. Originally Posted by shawsend
... the Fourier series is:

$f(x)=\frac{1}{2}+\frac{1}{\pi} \sum_{n=1}^{\infty} \frac{1-\cos(n\pi)}{n} \sin(n x)$

Now, evaluate that at $x=\pi/2$ and convert the sines and cosines to minus one raised to powers and adjust the summation expression accordingly.
Originally Posted by Maccaman
Im confused with how to "convert the sines and cosines to minus one raised to powers and adjust the summation expression accordingly." Can someone please explain?
$\cos(0) = 1,\ \cos(\pi)=-1,\ \cos(2\pi)=1,\ \cos(3\pi) = -1,\ldots$. Does that suggest to you that $\cos(n\pi)$ has something to do with –1 raised to some power?