Troubleshooting Fourier Series Expansion for Piecewise Function

Click For Summary

Homework Help Overview

The discussion revolves around finding the Fourier series expansion for a piecewise function defined as f(t)=0 for -π

Discussion Character

  • Exploratory, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • Participants discuss the calculation of Fourier coefficients a₀, aₙ, and bₙ, with some expressing uncertainty about their integrals and results. There are attempts to verify these calculations using tools like Mathematica and Wolfram Alpha. Questions arise regarding the correctness of the integrals and the impact of separating summations into odd and even cases.

Discussion Status

The discussion is active, with participants sharing their findings and corrections to their calculations. Some have acknowledged mistakes in their integrals, while others are still questioning the results and exploring the implications of their approaches. There is no clear consensus yet, but there is a collaborative effort to clarify misunderstandings.

Contextual Notes

Participants are working under the constraints of homework rules, which may limit the information they can share or the methods they can use. The nature of the piecewise function and its Fourier expansion is central to the discussion, with specific attention to the behavior of the function at the boundaries.

Telemachus
Messages
820
Reaction score
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 a_0=\displaystyle\frac{1}{\pi}\displaystyle\int_{0}^{\pi}t^2dt=\displaystyle\frac{\pi^2}{3}

a_n=\displaystyle\frac{1}{n^2}\cos(n\pi)

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

Then the Fourier series expansion:

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)}

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: 765
Last edited:
Physics news on Phys.org
I don't obtain the same integrals as you do. At least, wolfram alpha doesn't. Can you show how you found them?
 
Alright.

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

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}

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: 569
Last edited:
Those results aren't correct.
 
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: 521
Ah, it's good to hear that Fourier hasn't been disproved :biggrin:
 
Thank you both :D
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K