# Homework Help: Fourier Series Question

1. Oct 22, 2008

### TFM

1. The problem statement, all variables and given/known data

Find the Fourier series corresponding to the following functions that are periodic over the
interval $$[-\pi,\pi]$$

$$f(x) = 1, -\pi/2 < x< \pi/2; f(x)$$ otherwise.

2. Relevant equations

Fourier Series:

$$f(x) = \frac{1}{2}a_0 + \sum^\infty_{n=1}a_n cos\frac{2*\pi*n*x}{l} + \sum^\infty_{n=1} b_n sin\frac{2*\pi*n*x}{l}$$

$$\frac{1}{l}\int^{l/2}_{-l/2}f(x) dx$$

$$a_n = \frac{1}{l}\int^{l/2}_{-l/2}f(x) cos frac{2*\pi*n*x}{l}dx$$

$$a_n = \frac{1}{l}\int^{l/2}_{-l/2}f(x) sin frac{2*\pi*n*x}{l}dx$$

3. The attempt at a solution

So far I have:

$$a_0 = 1$$

$$a_n = \frac{1}{\pi n}[sin(nx)]^{\pi/2}_{-\pi/2}$$

$$b_n = -\frac{1}{\pi n}[cos(nx)]^{\pi}_{-\pi}$$

But I am not sure what to do now. I seem to be mainly confused about the n's

TFM

2. Oct 22, 2008

### TFM

My equations didn't come out quite right...Sorry. Should be:

$$a_0 = \frac{1}{l}\int^{l/2}_{-l/2}f(x) dx$$

$$a_n = \frac{1}{l}\int^{l/2}_{-l/2}f(x) cos \frac{2*\pi*n*x}{l} dx$$

$$b_n = \frac{1}{l}\int^{l/2}_{-l/2}f(x) sin \frac{2*\pi*n*x}{l}dx$$

TFM

3. Oct 22, 2008

### dirk_mec1

Note that:

$$\sin( n \cdot \pi /2)= 1$$ if n = 1,3,5...
$$\sin( n \cdot \pi /2) = 0$$ if n = 2,4,6,...

and

$$\cos( n \cdot \pi ) = (-1)^{n}$$

4. Oct 22, 2008

### TFM

So for $$a_n$$

$$a_n = \frac{1}{\pi n}[sin(nx)]^{\pi/2}_{-\pi/2}$$

n = 1,3,5...

so

$$a_n = \frac{1}{\pi 1}[sin(1x)]^{\pi/2}_{-\pi/2},$$

$$\frac{1}{\pi * 3}[sin(3x)]^{\pi/2}_{-\pi/2},$$

$$\frac{1}{\pi * 5}[sin(5x)]^{\pi/2}_{-\pi/2} ...$$

and

$$\cos( n \cdot \pi ) = (-1)^{n}$$

cos of n pi always = -1? (as long as pi is a whole number)

TFM