# Homework Help: Fourier Series help

1. Aug 4, 2011

### gtfitzpatrick

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

f(x) = $e^x$ for $-\pi/2 \leq x \leq \pi/2$

2. Relevant equations

3. The attempt at a solution

Having a bit of trouble getting this out.
This is a odd function right so $a_n = 0$ so i only have to find $b_n$ , right?

2. Aug 4, 2011

### lanedance

does the function repeat outside that interval?

the definition of odd is f(x) = -f(-x), does the function satisfy this?

3. Aug 4, 2011

### gtfitzpatrick

i'm not sure what you mean by this, but i assume it does as the function is periodic.

the definition of odd is f(-x) = -f(x) no???

i thought $e^{-x}$ = $-e^x$ but i guess im wrong so i'll work the whole lot out

4. Aug 4, 2011

### gtfitzpatrick

all the integrals below are over 0 to $\pi/2$

$a_0$ = $4/ \pi \int e^x$ dx = $4/ \pi (e^{\pi/2} - 1)$$a_0$ = $4/ \pi (e^{\pi/2} - 1)$

$a_n$ = $4/ \pi \int e^x cos(2nx)$ dx
$a_n$ = $4/ \pi(0-0)$ - $2/ n\pi n \int e^x sin(2nx)$dx
$a_n$ = $/n^2\pi (e^x (cosnx-cos0))$ - $1/ n^2\pi \int e^x cos(2nx)$ dx
$a_n$ = $e^x/ n^2\pi [ (-1)^2 - 1]$

am i going the right way with this?

5. Aug 4, 2011

### lanedance

yep this is the same as I wrote, but probably the way it is usually written

$f(-x) = e^{-x} \neq -e^x = -f(x)[/tex] so the function is not odd, hence you must calculate both an (cos terms) and bn (sin terms) the easiest way is to draw a sketch, it should eb pretty obvious whether it is symmetric (even) or anti-symmetric (odd) 6. Aug 4, 2011 ### lanedance why do you only integrate on the interval [itex] 0\leq x < \frac{\pi}{2}$?

isn't the problem defined on $-\frac{\pi}{2}\leq x < \frac{\pi}{2}$

7. Aug 5, 2011

### gtfitzpatrick

ahhh yes thanks lancedance, i was only integrating on half the interval and multiplying by 2, the same way that you would if it was an odd or even function! I should do it over the full interval!

A general question...if i wanted to get the half range fourier sine or cosine series for say f(x) = 2x if 0<x<1 ; f(x) = 2 if 1<x<2. This function can be extended over the y axis or across the origin as appropriate. But when im calculating the coefficients do i just integate over the 2 intervals and multiply be 2 in the way i would if i was dealing with and odd or even function? I'm thinking not.
?

8. Aug 7, 2011

### lanedance

I assume you mean it is known on the given interval and you a free to extend over the remaining x axis, the major importance is the fourier series is representative over the given interval

you have bit of leeway to play with here, generally it is eaisest to deifne the function outside 0<x<2 as a reflection in the y=0 axis and then repeating from there. That makes it an even function and halves the terms. However you could similarly come up with a scheme to make it odd or just repeat the function as is. There may be advantages to each in terms of evaluating the integrals or conitinuity which will leader to a faster convergence of terms.