Finding the Fourier Series of f(x)

in summary, the function f(x) = xsinx 0<x<pi has two non-zero integrals for the coefficients a_0=\frac{1}{2\pi} \int_0^\pi{sin(x) dx} and a_n=\frac{1}{\pi} \int_0^\pi{sin(x)cos(nx) dx} which are difficult to work out.
  • #1
bon
559
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
  • #2
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).
 
  • #3
ahh that comes out all horrible though :(

the an integral is like cos pin + 1 / pi - pi n^2
 
  • #4
Yeah, the result is not very beautiful, I know ):
 
  • #5
is bn = 0 since n is integer?
 
  • #6
I don't think b1 is 0. The other bn probably are 0.
 
  • #7
but bn = sinpi n / pi - pi n^2 so when n=1 we have sin pi on the top which = 0
 
  • #8
sorry - ignore..
 
  • #9
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?
 
  • #10
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...
 
  • #11
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
 
  • #12
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?
 
  • #13
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.
 
  • #14
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.
 
  • #15
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?
 
  • #16
Yay okay thanks
 
  • #17
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..?
 
  • #18
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
 

FAQ: Finding the Fourier Series of f(x)

What is a Fourier Series and why is it important in science?

A Fourier Series is a mathematical tool used to represent a function as a sum of sine and cosine waves. It is important in science because it allows us to break down complex functions into simpler components, making it easier to analyze and understand them.

What is the process for finding the Fourier Series of a function?

The process for finding the Fourier Series of a function involves finding the coefficients of the sine and cosine terms that best fit the function. This is done by using integral calculus and solving for the coefficients using the orthogonality of sine and cosine functions.

Can any function be represented by a Fourier Series?

Yes, any function that is piecewise continuous and has a finite number of discontinuities can be represented by a Fourier Series. However, some functions may require an infinite number of terms in their series for an accurate representation.

What is the difference between the Fourier Series and Fourier Transform?

The Fourier Series is used to represent a periodic function, while the Fourier Transform is used to represent a non-periodic function. The Fourier Transform also gives information about the frequencies present in a function, while the Fourier Series does not.

How is the accuracy of a Fourier Series determined?

The accuracy of a Fourier Series depends on the number of terms used in the series. As the number of terms increases, the accuracy also increases. However, the series may never be an exact representation of the original function, as some functions may require an infinite number of terms for complete accuracy.

Similar threads

Replies
5
Views
1K
Replies
1
Views
745
Replies
1
Views
1K
Replies
6
Views
1K
Replies
16
Views
1K
Back
Top