Fourier Series for a piecewise function help

Click For Summary

Homework Help Overview

The discussion revolves around finding a Fourier series for a piecewise function defined over the interval from -π to π, with specific values assigned in different segments of the interval. The original poster attempts to derive the Fourier coefficients and expresses confusion regarding discrepancies in their plotted results.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the calculation of Fourier coefficients, noting patterns in even and odd terms. Questions arise about the correctness of the derived coefficients and the resulting plots. Some participants suggest that the original poster's lack of detailed work may hinder the discussion.

Discussion Status

The conversation includes attempts to clarify the calculations of Fourier coefficients and the interpretation of results. Some participants express the need for more detailed work to identify errors, while the original poster acknowledges a mistake in their approach.

Contextual Notes

There is a mention of using Mathematica for calculations, and the original poster's initial post lacks detailed steps, which some participants highlight as a barrier to effective assistance.

dinospamoni
Messages
90
Reaction score
0

Homework Statement



I'm trying to find a Fourier series for the piecewise function where f(x)=

[itex]0 \in -\pi \leq x \leq 0[/itex]
[itex]-1 \in 0 \leq x \leq \frac{\pi}{2}[/itex]
[itex]1 \in \frac{\pi}{2} \leq x \leq \pi[/itex]

Homework Equations



[tex]a_{n} = \frac{1}{\pi} \int_{0}^{2\pi}\cos(nx)y(x)\,dx[/tex]
[tex]b_{n} = \frac{1}{\pi} \int_{0}^{2\pi}\sin(nx)y(x)\,dx[/tex]

The Attempt at a Solution



I found the pattern that every even a is 0, so that becomes
[tex]a_{m} = \sum_{m=1}^{\infty}\frac{(-1)^{m}2}{(2m-1)\pi}[/tex]

and the b coefficients are 0 when n is odd and 0 for every other even n, so that becomes
[tex]b_{m} = \sum_{m=1}^{\infty}\frac{-2}{\frac{4m-2}{2}\pi}[/tex]

however when I plot this, the plot between -pi and -pi/2 is switched with the plot between pi/2 and pi

I attached a picture for reference along with a plot of f(x)

Any ideas of where i went wrong?
 

Attachments

  • Screen capture00000000000000000 2013-04-24 at 4.01.46 PM.JPG
    Screen capture00000000000000000 2013-04-24 at 4.01.46 PM.JPG
    17.1 KB · Views: 541
  • Screen capture00000000000000000 2013-04-24 at 4.02.58 PM.JPG
    Screen capture00000000000000000 2013-04-24 at 4.02.58 PM.JPG
    8 KB · Views: 451
Last edited:
Physics news on Phys.org
dinospamoni said:
Any ideas of where i went wrong?
Not really since you didn't show your work. Just posting your final, probably wrong answer isn't very helpful.
 
Whoops sorry, I forgot I didn't do this all in mathematica:

[itex]a_{0} = 0[/itex]

[itex]a_{1} = \frac{-2}{\pi}[/itex]

[itex]a_{2} = 0[/itex]

[itex]a_{3} = \frac{2}{3\pi}[/itex]

[itex]a_{4} = 0[/itex]

[itex]a_{5} = \frac{-2}{5\pi}[/itex]

[itex]a_{6} = 0[/itex][itex]b_{1} = 0[/itex]

[itex]b_{2} = \frac{-2}{\pi}[/itex]

[itex]b_{3} = 0[/itex]

[itex]b_{4} = 0[/itex]

[itex]b_{5} = 0[/itex]

[itex]b_{6} =\frac{-2}{3\pi}[/itex]

[itex]b_{7} = 0[/itex]

[itex]b_{8} = 0[/itex]

[itex]b_{9} = 0[/itex]

[itex]b_{10} =\frac{-2}{5\pi}[/itex]

[itex]b_{11} = 0[/itex]

[itex]b_{12} = 0[/itex]

[itex]b_{13} = 0[/itex]

[itex]b_{14} = \frac{-2}{7\pi}[/itex]
 
Last edited:
And I figured out the summations from just looking at these in terms of n:

[itex]a_{n} = \sum\frac{(-1)^{n}2}{n\pi}[/itex]

[itex]b_{n} = \sum\frac{-2}{\frac{n}{2}\pi}[/itex]

and then to get rid of the 0s I made it in terms of m:

[itex]a_{m} = \sum\frac{(-1)^{m}2}{(2m-1)\pi}[/itex]

[itex]b_{m} = \sum\frac{-2}{\frac{4m-2}{2}\pi}[/itex]

The function is then:

[tex]g(x) = \sum_{m=1}^{\infty} a_m Cos((2m-1)x) + \sum_{m=1}^{\infty} b_m Sin((2m-1)x)[/tex]
 
Last edited:
I figured out what I did wrong, but thanks!
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · 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 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K