Troubleshooting Fourier Series Expansion for Piecewise Function

In summary, the problem asks for the Fourier expansion of the function f(t) = 0 if -pi<t<0, f(t) = t^2 if 0<t<pi, but the equation gives different results depending on whether the even or odd numbers are included.
  • #1
Telemachus
835
30
Hi there. I have some trouble with this problem, it asks me to find the Fourier expansion series for the function
f(t)=0 if -pi<t<0, f(t)=t^2 if 0<t<pi

So I've found the coefficients [tex]a_0=\displaystyle\frac{1}{\pi}\displaystyle\int_{0}^{\pi}t^2dt=\displaystyle\frac{\pi^2}{3}[/tex]

[tex]a_n=\displaystyle\frac{1}{n^2}\cos(n\pi) [/tex]

[tex]b_n=-\displaystyle\frac{\pi\cos(n\pi)}{n}-\displaystyle\frac{4}{n^3\pi}[/tex]

Then the Fourier series expansion:

[tex]f(t)\sim{\displaystyle\frac{\pi^2}{6}+\sum_{n=1}^{\infty}\displaystyle\frac{1}{n^2}\cos(n\pi)\cos(nt)- \left( \displaystyle\frac{\pi}{n}+ \displaystyle\frac{4}{n^3\pi}\right)\sin(nt)}[/tex]

When I plot this on mathematica I get something that doesn't look like what I'm looking for. I've tried many ways, I've done the integrals first by hand, then I did it with mathematica, the graph always seems the same, it doesn't get to zero in the interval zero to -pi as it should, and it isn't close to the plot of t^2, it doesn't even get to zero on the origin. I don't know what I'm doing wrong. I've looked at the equations carefully, I'm pretty much sure I've done things right. Whats happening?

attachment.php?attachmentid=35997&stc=1&d=1306620049.png


I've also tried to make a distinction between the odd and even cases, but as I supposed it didn't affect at all, the equation as I wrote it includes both cases.
 

Attachments

  • four.PNG
    four.PNG
    1.9 KB · Views: 688
Last edited:
Physics news on Phys.org
  • #2
I don't obtain the same integrals as you do. At least, wolfram alpha doesn't. Can you show how you found them?
 
  • #3
Alright.

[tex]a_n=\displaystyle\frac{1}{\pi}\displaystyle\int_{0}^{\pi}t^2\cos(nt)dt=\displaystyle\frac{1}{n^2} \cos(n\pi)[/tex]

[tex]b_n=\displaystyle\frac{1}{\pi}\displaystyle\int_{0}^{\pi}t^2\sin(nt)dt=\displaystyle\frac{-\pi}{n}\cos(n\pi)-\displaystyle\frac{4}{n^3\pi}[/tex]

Thats how I did it. Do you need the mid steps? its quiet a bit tricky. For the first integral mathematica give just the same, but with a sine with an npi inside, which is obviously zero. For the second integral it gives something quiet similar to the result I've found. Anyway, I've tried using mathematica results, and gives the same graph.

Ow. I've found a mistake in my integrals now, but I think it doesn't change much.

Ok, I've corrected the mistake, now this is what I get:
attachment.php?attachmentid=36001&stc=1&d=1306626781.png

Its closer now, but stills wrong.
 

Attachments

  • four2.PNG
    four2.PNG
    6.9 KB · Views: 499
Last edited:
  • #4
Those results aren't correct.
 
  • #6
You were right, I had another silly mistake :) I think its okey now:

https://www.physicsforums.com/attachment.php?attachmentid=36003&stc=1&d=1306628272

It doesn't make any difference in separating the summations on odd and even numbers, right? or does it have something to do with the speed of convergence?
 

Attachments

  • four3.PNG
    four3.PNG
    5.5 KB · Views: 454
  • #7
Ah, it's good to hear that Fourier hasn't been disproved :biggrin:
 
  • #8
Thank you both :D
 

Related to Troubleshooting Fourier Series Expansion for Piecewise Function

1. What is a Fourier series expansion?

A Fourier series expansion is a mathematical tool used to represent a periodic function as a combination of sine and cosine functions. It is based on the principle that any periodic function can be broken down into an infinite sum of simple sine and cosine functions with different frequencies and amplitudes.

2. How is a Fourier series expansion calculated?

A Fourier series expansion is calculated by finding the coefficients of the sine and cosine functions that make up the periodic function. This is done using a process called Fourier analysis, which involves evaluating integrals and solving systems of equations.

3. What are the applications of Fourier series expansion?

Fourier series expansion has a wide range of applications in various fields such as physics, engineering, and signal processing. It is used in image and sound processing, data compression, and solving differential equations, among others.

4. What is the difference between a Fourier series and a Fourier transform?

A Fourier series expansion is used to represent periodic functions, while a Fourier transform is used to analyze non-periodic functions. A Fourier transform also takes into account all frequencies, while a Fourier series only considers the specific frequencies of the periodic function.

5. Can any function be represented by a Fourier series expansion?

No, not all functions can be represented by a Fourier series expansion. The function must be periodic and satisfy certain conditions in order for its Fourier series expansion to exist. For example, it must be continuous and have a finite number of discontinuities within one period.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
256
  • Calculus and Beyond Homework Help
Replies
3
Views
439
  • Calculus and Beyond Homework Help
Replies
1
Views
555
  • Calculus and Beyond Homework Help
Replies
3
Views
329
  • Calculus and Beyond Homework Help
Replies
1
Views
371
  • Calculus and Beyond Homework Help
Replies
2
Views
391
  • Calculus and Beyond Homework Help
Replies
16
Views
590
  • Calculus and Beyond Homework Help
Replies
6
Views
273
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
397
Back
Top