Fourier series coefficients for odd square wave function

6 replies · 2K views · last reply
Aristotle
Messages
169
Reaction score
1

Homework Statement


Handwritten problem statement asking for a Fourier series of a periodic function, with piecewise definition: f=0 on -2<x<-1, f=-1 on -1<x<0, f=1 on 0<x<1, f=0 on 1<x<2, and a graph of the square-wave-like function against x.


Homework Equations



Fourier series formula: A_0 + sum from n=1 to infinity of (A_n cos(nx) + B_n sin(nx)).

Fourier series formula: F_n(x) = a_0 + sum from k=1 to n of (a_k cos(kx) + b_k sin(kx)).

The Attempt at a Solution



Since P=2L, L=1 ?

a_o = 1/2 [ ∫(from -1 to 0) -dx + ∫(from 0 to 1) dx ] = 1/2 [ (0-1) + (1-0) ] = 1/2(0) = 0

a_n = - ∫ (from -1 to 0) cosnπx dx + ∫ (from 0 to 1) cosnπx dx = 0

b_n = - ∫ (from -1 to 0) sinnπx dx + ∫ (from 0 to 1) sinnπx dx = 2/nπ - 2/nπ*(cosnπ) = 2nπ / (1-cosnπ) = { 4/nπ n is odd ; 0 is even
The problem is my teacher has this as his answer:
Handwritten formula: f(x) = (2/π){sin(πx/2) + sin(πx) + (1/3)sin(3πx/2) + (1/5)sin(5πx/2)}, with the sum continuing on the second line.


Am i doing something incorrectly?
 
Last edited:
Dr. Courtney said:
Why not check by graphing the original function and the Fourier series?
I understand you can check through graphing, but I just wanted some verification that my math is correct?
 
Aristotle said:
Wait L is suppose to equal 2 correct? Not 1?

If you mean that one period of the function goes from ##-L## to ##+L## then yes, of course ##L = 2##. That was implied in the question.
 
  • Like
Likes   Reactions: Aristotle
Ray Vickson said:
If you mean that one period of the function goes from ##-L## to ##+L## then yes, of course ##L = 2##. That was implied in the question.
I figured...
For my b_n I got 2/(n*pi) [1 - cos(n*pi / 2 ).

Is this correct?
 
Aristotle said:
I figured...
For my b_n I got 2/(n*pi) [1 - cos(n*pi / 2 ).

Is this correct?
Why don't you do as suggested and graph the resulting series? That'll tell you immediately if you got the right series. If you still want someone to check your work, you need to show it. Just posting the answer is next to useless.