1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fourier Series assistance

  1. Aug 17, 2012 #1
    1. The problem statement, all variables and given/known data

    Given the function f(x) = Acos(∏x/L), find its Fourier series

    2. Relevant equations

    Okay so, f(x) is even, so the fourier series is given by:

    f(x) = a0 + [itex]\sum[/itex]ancos(nx)

    where a0 = 1/∏[itex]\int[/itex] f(x).dx with bounds ∏ and -∏

    and an = 1/∏[itex]\int[/itex] f(x)cos(nx).dx with bounds ∏ and -∏

    3. The attempt at a solution

    okay, with range L

    a0 = 2/L[itex]\int[/itex]f(x).dx with bounds L to 0

    and an = 2/L[itex]\int[/itex]f(x)cos(n∏x/L).dx with bounds L to 0

    starting with a0:

    a0 = 2/L[itex]\int[/itex]f(x).dx with bounds L to 0

    a0 = 2A/L[itex]\int[/itex]cos(∏x/L).dx

    integrates to a sin, first sub in L gives sin∏ which = 0 and then sub the 0 gives sin0 which = 0 so therefore a0 = 0

    now an:

    and an = 2/L[itex]\int[/itex]f(x)cos(n∏x/L).dx with bounds L to 0

    an = 2A/L[itex]\int[/itex]cos(∏x/L)cos(n∏x/L).dx

    an = 2A/L[itex]\int[/itex]cos2(n∏x/L).dx

    integral of cos2x = x/2 + (1/4)sin2x

    so : an = 2A/L[n∏x/2L + (1/4)sin(2n∏x/L)] between L and 0

    sub in 0 gives 0 + sin0, so only need to sub L,

    an = 2A/L[n∏/2 + (1/4)sin(2n∏)]

    an = An∏/L + (2A/L)sin(2n∏)

    so then subbing back into expression for fourier series with a0 = 0 gives:

    f(x) = [itex]\sum[/itex] [An∏/L + (2A/L)sin(2n∏)](cos(nx))

    doing this course by distance education and theres no textbook, and the online notes are fairly vague. so i just wanna check im on the right track or at least the right method of solving etc. sorry about the latex. not the best at that. thanks.
     
  2. jcsd
  3. Aug 17, 2012 #2

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    Re: Fourier Series assisstance

    I haven't checked the rest of your solution, but [itex]\cos \left( \frac{\pi x}{L} \right)\cos \left( \frac{n \pi x}{L} \right) \neq \cos^2 \left( \frac{n \pi x}{L} \right)[/itex]
     
  4. Aug 17, 2012 #3

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: Fourier Series assisstance

    That wouldn't be the natural FS to use. Your function ##A\cos(\frac {\pi x}{L})## has period ##2L## so you would normally expand it like this$$
    A\cos(\frac{\pi x}{L}) = a_0 +\sum_{n=1}^\infty \left( a_n\cos(\frac{n\pi x}{L})+b_n\sin(\frac{n\pi x}{L})\right)$$used for a function of period ##2L## instead of ##2\pi##. And the formulas for ##a_n## and ##b_n## change accordingly.

    Alert: There is also a very quick shortcut for calculating the ##a_n## and ##b_n## which you might notice if you look carefully at the FS and function you are expanding.
     
    Last edited: Aug 17, 2012
  5. Aug 17, 2012 #4

    uart

    User Avatar
    Science Advisor

    Re: Fourier Series assisstance

    Hi ProPat, I haven't read all of your solution, but just make sure you are totally clear about what function you are working with before you start.

    All Fourier series require that the function be periodic. This is ideally stated explicitly in the function definition, but can be sometimes be implied by the domain you're given to work with. In this example if that domain was [0..2L] then answer would be trivial (and obtained by inspection). Given however that you appear to be working on [0..L], then your function is just a piece of that cosine wave (not a full cycle), repeated with period L.

    This function is not "even", so I suspect you are missing something here from the get-go. Try making a sketch of the function before you begin.
     
    Last edited: Aug 17, 2012
  6. Aug 17, 2012 #5
    Re: Fourier Series assisstance

    You should give people time to edit their posts... Though no offense taken. I made a mistake when I clicked "post" on that one instead of "preview post", so it's technically my mistake. Though I fixed the error and erased my post temporarily within a minute or so until I had finished, so your timing is especially impeccable.

    As far as working the problem for the poster, I used my discretion when working the problem simply because he hinted that he possibly didn't have the required training to work the problem. I did it for pedagogical reasons which I feel will feel should always trump the rules.
     
    Last edited: Aug 17, 2012
  7. Aug 17, 2012 #6

    George Jones

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Re: Fourier Series assisstance

    The original poster actually wrote:
    This makes it clear the original post was homework.
    No. Physics Forums Rules state
    Everyone agrees to the Physics Forums Rules when they register.

    Your help is welcome, but try a give help one step/hint (or a small number of steps/hints) at a time.
     
  8. Aug 17, 2012 #7

    berkeman

    User Avatar

    Staff: Mentor

    Re: Fourier Series assisstance

    No, it does not trump the rules. Do not do students' schoolwork for them.


    EDIT -- George beat me to it!
     
  9. Aug 17, 2012 #8
    Re: Fourier Series assisstance

    ∫hey guys,

    LCKurtz:

    in my attempt at a solution part i defined

    an = 2/L ∫ f(x)cos(n∏x/L)... is that not correct?

    i can see the relationship there between the FS definition and an bn, and i assumed the period was L. im pretty sure the lecture notes and the assignment questions are from two completely different places, because all through the lecture notes "D" is used as "repeats" and theres not an L in sight, so im not entirely sure how to relate L and D inside the different forms of the FS. like i said, ambiguous study notes, pretty much re-teaching myself from internet resources.

    gabbagabbahey: we meet again :) hah

    like 2 minutes after i originally posted i realised that sweet screw up haha.

    ∫cos(n∏x/L .dx = -1/n*sin(n∏x/L)

    if i take ∫cos(∏x/L)cos(n∏x/L) .dx and try integrate by parts its never ending.
    i plugged it into an online integral caclulator and its a massive result so im assuming im missing something somewhere.

    can someone please elaborate on the relationship between L and D and ill have a go from there. using the FS definition that LCKurtz posted, which is what i was using in the end, but i am using it with range L, so bounds 0 > L.

    in my study notes is this definition

    f(x) = A0/2 + Ʃ ancos(2∏nx/D) + Ʃ bnsin(2∏nx/D)

    A0 = 2/D ∫ f(x).dx

    an = 2/D ∫ f(x)cos(2∏nx/D).dx

    bn = 2/D ∫ f(x)sin(2∏nx/D).dx

    so from the given equation and that definition, D = 2L yes? does L have a meaning? D is the period i thought. is L just another way to define the range?

    so if thats the case, as "uart" posted (sorry if thats not the full username, some appears to have not loaded on my browser) the answer should be obtainable by inspection using the exponential FS?

    the original problem statement posted is all im given by the way.

    thanks guys
     
    Last edited: Aug 17, 2012
  10. Aug 17, 2012 #9

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    Re: Fourier Series assisstance

    Use a trig identity instead of integration by parts; [itex]\cos u \cos v = \cos (u+v) + \cos (u-v) [/itex], and be very careful to break this into two cases: [itex]n=1[/itex] and [itex]n \neq 1[/itex] before integrating.

    Let's give this a little more rigour first:

    The Fourier series of a periodic function [itex]f[/itex], with period [itex]D[/itex] on the entire [itex]x[/itex] axis, which is piecewise smooth on the interval [itex] - \frac{D}{2} < x < \frac{D}{2} [/itex], and defined at each point [itex]x[/itex] where it is discontinuous as the mean value of the one-sided limits [itex]f(x+)[/itex] and [itex]f(x-)[/itex], valid for each [itex]x \in (-\infty, \infty)[/itex] is given by:

    [tex]f(x) = \frac{a_0}{2} + \sum_{ n=1 }^{ \infty }a_n \cos \frac{2n \pi x}{D} + b_n \sin \frac{2n \pi x}{D}[/tex]

    where

    [tex]a_n = \frac{2}{D} \int_{ - \frac{D}{2} }^{ \frac{D}{2} } f(x) \cos \frac{2n \pi x}{D} dx \quad ( n = 0,1,2, \ldots )[/tex]

    [tex]b_n = \frac{2}{D} \int_{ - \frac{D}{2} }^{ \frac{D}{2} } f(x) \sin \frac{2n \pi x}{D} dx \quad ( n = 1,2, \ldots )[/tex]

    Does this definition agree with the one in your notes/textbook? If so, does [itex]f(x) = \cos \frac{ \pi x }{L} \quad 0 < x < L[/itex] (and [itex]f(x) = 0[/itex] elsewhere!) satisfy the conditions given in the above definition? If so, what is [itex]D[/itex] in this case?
     
  11. Aug 17, 2012 #10
    Re: Fourier Series assisstance

    okay so this is the integral i got


    [tex] \int \cos \frac{ \pi x}{L} \cos \frac{n \pi x}{L} dx [/tex] = [tex] \frac{ ((n-1) \sin \frac{ ((n \pi + \pi )x}{L}) + (n+1) \sin \frac{ ((n \pi - \pi )x}{L}))}{2 \pi n^2 - 2 \pi} [/tex]

    but now if i take bounds L and 0 and sub them in all sin terms become sin(∏(n-1)) and any integer multiple of sin∏ = 0 so an = 0
     
  12. Aug 17, 2012 #11

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: Fourier Series assisstance

    You are assuming that the period is ##2L## with this formula. That is also what I would assume. But notice that your answer doesn't work when ##n=1## because it gives ##\frac 0 0##. You have to do that case separately. Write out that integral separately and use a different method on it. You should wind up with ##a_1=A##. Then you might look again at the "Alert" hint in my first post.

    I am also going to comment on your other post.
     
  13. Aug 17, 2012 #12

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: Fourier Series assisstance

    No. The period is ##2L## for that formula and it is pretty standard to use it that way.

    In those formulas ##D## is the full period so, yes, ##D=2L##. I must say I have never seen a text that expressed the formulas in terms of the full period ##D## that way. If you put ##D=2L## in those formulas you will get the standard formulas given in most texts. In fact, it is quite common to denote the full period by ##P## and use ##P=2p## in the formulas.
     
  14. Aug 17, 2012 #13
    Re: Fourier Series assisstance

    yeah i noticed that you get 0/0 but then sin0 is just zero anyway ? same as the rest.

    with the splitting of the integral,

    do i take the integral

    [tex] \int \cos \frac{ \pi x}{L} \cos \frac{n \pi x}{L} dx [/tex]

    and then evaluate it with n = 1 and then n = everything else.

    so the integral i did was n = everything else which is all zero, then integrate the integral with n = 1 so it becomes

    [tex] \int \cos \frac{ \pi x}{L} \cos \frac{ \pi x}{L} dx [/tex]

    and then integrating that, this is what i got


    [tex] \frac{ \sin \frac{2 \pi x}{L}L + 2 \pi x }{4 \pi} [/tex]

    then subbing in L there, the sin term becomes sin2∏ which is 0, so its 2∏L/4∏ = L/2 and the subbing in of the 0 just results in a 0.

    so an = 2A/L(L/2) and there it is, = A

    so now work through bn the same way and i should get a good result. that will take some time.
     
  15. Aug 17, 2012 #14
    Re: Fourier Series assisstance

    i found this as a general formula with bounds [a,b]

    [tex]f(x) = \frac{a_0}{2} + \sum_{ n=1 }^{ \infty }a_n \cos \frac{n \pi x}{L} + b_n \sin \frac{n \pi x}{L}[/tex]

    where L = (b-a)/2 and the co-efficients are :

    [tex]a_n = \frac{1}{L} \int_{ a }^{ b } f(x) \cos \frac{n \pi x}{L} dx [/tex]

    [tex]b_n = \frac{1}{L} \int_{ a }^{ b } f(x) \sin \frac{n \pi x}{L} dx [/tex]


    is that a good general formula?
     
  16. Aug 17, 2012 #15

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: Fourier Series assisstance

    Yes. But almost always you will find you use [a,b] = [-L,L] or [a,b] = [0,2L]. But you can always integrate over any period since if ##f(x)## has period ##P## then$$
    \int_0^Pf(x)dx = \int_a^{a+P}f(x)dx$$for any ##a##.
     
  17. Aug 17, 2012 #16

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Re: Fourier Series assisstance

    You mean ##a_1=A##, not ##a_n=A##. Now look back at my post #3. Do you see why you could have concluded ##a_1=A## and all the other coefficients are zero immediately?
     
  18. Aug 17, 2012 #17

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    What is the exact wording on the question as given to you? In particular, is the function [itex]f(x)=\cos \left( \frac{\pi x}{L} \right)[/itex] everywhere, or just for [itex]0 < x <L[/itex] (and presumably zero elsewhere except, perhaps at [itex]x=L[/itex] and [itex]x=0[/itex]), because the answer is very different in the two cases.
     
  19. Aug 18, 2012 #18
    LCKurts:

    yeah i see, for n = 1, Acos(∏x/L) = ancos(∏x/L) and all sin terms are zero since any integer multiple of sin∏ is zero. so for n = 1, A = a1

    what about for the rest of n? theyre all zero right? so when expressing the answer i dont specify its a1?

    gabba: the problem statement originally posted is all i have.

    the exact complete question is this:

    Given the function f(x) = Acos(∏x/L), determine its Fourier series.

    there is nothing else, no domain specified or anything.

    so does that mean ive done everything wrong so far? or right? is a0 = A/L and an = A. or is that not all there is to ann? just trying to summarise.

    thanks guys
     
  20. Aug 18, 2012 #19

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    In that case, your response to LCKurts is correct, a1=A and all other coefficients are zero... what does that make the Fourier Series? (don't be too shocked! There's a reason the answer is what it is...can you see it?:wink:)

    If instead you were told, for example, that

    [tex]f(x)=\left\{ \begin{array}{lr} A \cos \frac{\pi x}{L} & 0 < x < L \\ 0 & x<0 \;\text{or} \; x >L \end{array} \right.[/tex]

    with [itex]f(0)=\frac{A}{2}[/itex] and [itex]f(L)=-\frac{A}{2}[/itex] and asked to find the Fourier series over the interval [itex](-\infty, \infty)[/itex] (which is a very typical problem on Fourier series), you would have found a very different result (the sine terms wouldn't be zero ... do you see why?)
     
    Last edited: Aug 18, 2012
  21. Aug 18, 2012 #20
    [tex] a_0 = 0 [/tex]

    [tex] a_n = A [/tex]

    [tex] b_n = 0 [/tex]

    So the whole Fourier series is:

    f(x) = Sum (Acos(pi*x/L))
    ??
    The same as the original formula? Is that the trick?

    And so the series only iterates once since n = 1 then after that is zero?

    Dunno if the latex will work I'm on my iPhone
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Fourier Series assistance
  1. Fourier series (Replies: 10)

  2. Fourier Series (Replies: 1)

  3. Fourier Series (Replies: 6)

Loading...