# Fourier Series

1. Apr 16, 2008

### Shomy

[SOLVED] Fourier Series

1. The problem statement, all variables and given/known data
I know this may be a simple problem but im just beginning to understand this subject and this question has confused me.

Expand the following as a whole-range fourier series:

f(x) = 1 -pi < x < 0
f(x) = x 0 < x < pi

I can solve FS with one eqn, but what do you do with two, do you integrate twice or something?

2. Relevant equations

3. The attempt at a solution

2. Apr 16, 2008

### Hootenanny

Staff Emeritus
Welcome to PF Shomy,

The first thing to decide is whether the function is even, odd or neither.

3. Apr 16, 2008

### Shomy

Thanks for the welcome!
The first part is even and the second is odd

4. Apr 16, 2008

### Hootenanny

Staff Emeritus
I suspect that the function is written thus,

$$f(x) = \left\{\begin{array}{cr}1 & -\pi<x<0 \\ x & 0<x<\pi\end{array}\right.$$

Which means it isn't actually two functions, but one piecewise function.

5. Apr 16, 2008

### Shomy

Yeah

6. Apr 16, 2008

### Hootenanny

Staff Emeritus
So now, is the function odd or even?

7. Apr 16, 2008

### Shomy

The first part is even and the second is odd

8. Apr 16, 2008

### Hootenanny

Staff Emeritus
So overall the function is...?

9. Apr 16, 2008

### Shomy

Odd?

10. Apr 16, 2008

### Hootenanny

Staff Emeritus
Correct! What does this tell you about the Fourier series coefficients?

11. Apr 16, 2008

### Shomy

One of the coefficients (cos) is zero

12. Apr 16, 2008

### Hootenanny

Staff Emeritus
Correct, all the coefficients of cosine are zero. So what is the Euler formula for calculating the coefficients of sine?

Last edited: Apr 16, 2008
13. Apr 16, 2008

### Shomy

Well i meant that one of the coefficients (ie the cos ) is zero because i am using sum notation.

an = 1/pi integral f(x)cosmx dx from pi to -pi. Do I integrate both functions and sum them or what?

14. Apr 16, 2008

### Hootenanny

Staff Emeritus
Haven't we just agreed that the cosine coefficients are zero?

15. Apr 16, 2008

### Shomy

Yeah sorry

16. Apr 16, 2008

### Hootenanny

Staff Emeritus
No problem . So what about the coefficients of sine?

17. Apr 16, 2008

### Shomy

bm = 1/pi integral f(x)sinmx dx

So do you integrate the first part from pi to 0 and the second part from 0 to -pi

18. Apr 16, 2008

### Hootenanny

Staff Emeritus
I believe it's the other way around. Overall the coefficient is given by,

$$b_n=\frac{1}{\pi}\int_{0}^{2\pi}f(x)\sin(nx)dx$$

However, since f(x) is defined piecewise we must write,

$$b_n = \frac{1}{\pi}\left[\int_{-\pi}^{0}1\cdot\sin(nx)dx + \int_{0}^{\pi}x\cdot\sin(nx)dx\right]$$

Is that what you meant?

19. Apr 16, 2008

### Shomy

Yeah thats what was holding up. Thanks so much!

20. Apr 16, 2008

### Hootenanny

Staff Emeritus
No problem