Finding the Fourier Series of f(x)

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
17 replies · 5K views
bon
Messages
547
Reaction score
0

Homework Statement



Trying to find the Fourier series for the function

f(x) = 0 for -pi<x<0 and f(x) = sinx for 0<x<pi


The Attempt at a Solution



im having a little trouble working it out..

are any of the sets of coefficients = 0?

Im getting two non-zero integrals for the coefficients an and bn which are difficult to work out :(
 
Physics news on Phys.org
You need to calculate

[tex]a_0= \frac{1}{2\pi} \int_0^\pi{sin(x) dx}[/tex]
[tex]a_n= \frac{1}{\pi} \int_0^\pi{sin(x)cos(nx) dx}[/tex]
[tex]b_n= \frac{1}{\pi} \int_0^\pi{sin(x)sin(nx) dx}[/tex]

These integrals are not that diffucult are they? I mean [tex]a_0[/tex] is easy. And for [tex]a_n,b_n[/tex] just apply the product-to-sum formulas (or Simpson's formula, whatever you call it).
 
ahh that comes out all horrible though :(

the an integral is like cos pin + 1 / pi - pi n^2
 
but bn = sinpi n / pi - pi n^2 so when n=1 we have sin pi on the top which = 0
 
ok so i think i have it now..but when i graph it, it doesn't seem to fit that well...

trying the first few terms, f(x) = 1/pi -2/3pi cos2x -2/15pi cos4x + ... + 1/2sinx

For one thing, it doesn't go through (0,0)! why?
 
That it doesn't go through (0,0) is expect. The value at 0 is a series and as such is not expected to go through (0,0).

As for the convergence problems. All I can say is that the convergence is probably slow... I do think you have the right solution however...
 
thanks ok

my next question asks me to expand f(x) = xsinx 0<x<pi as a Fourier sine series

the hint is that i should extend the interval to -pi<x<pi and then require that f(-x) = -f(x) i.e. f(x) is odd.. but i don't get it...f(x) isn't odd.. :S

thanks
 
oh i think i get it..

i say that f(x) = -xsinx for -pi to 0 and xsinx for 0 to pi?

Then can i just say all an = 0 as it is odd? Do i need to be careful about case n=1? so in general is it always true that if it is odd, an = 0 ? including n=1?
 
They just mean that u define f(x)=xsin(x) for 0<x<pi. And then extend this function to [-pi,pi] so that the function is odd. So define f(x)=-xsin(x) for -pi<x<0.
 
If a function is odd, then all an are indeed 0. So only the bn matter now.
If a function is even, then all bn are 0.
 
Then can i just say all an = 0 as it is odd? Do i need to be careful about case n=1? so in general is it always true that if it is odd, an = 0 ? including n=1?
 
am i right in thinking bn = 2/pi times the integral from 0 to pi of xsinx sin nx

that is a horrible integral..cant be right..?
 
Yes, it IS a horrible integral :smile:

Try first Simpsons formula to split up sin(x)sin(nx) in sums.
Then do partial integration.

It's even less beautiful then last time