1. Not finding help here? Sign up for a free 30min 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!

Help solving fourier cosine series related problem

  1. Feb 4, 2016 #1

    RJLiberator

    User Avatar
    Gold Member

    1. The problem statement, all variables and given/known data
    3.jpg

    I am doing #9.

    2. Relevant equations


    3. The attempt at a solution
    I've been looking at a lot of similar problems on the internet. The main difference between this one and them is that this one has an interval of [0,4] while they often have intervals of [0,pi] or [-pi,pi]

    In my class, we discussed using change of variables to make it into some form.

    I thought maybe I could work with [-2,2] and call it an even function letting [-2,2] f(x) = 1.

    But I didn't get anywhere with this.

    It's, once again, one of these problems where once I get the first step, I feel like I will be off to the races.


    The answer to this problem is:
    (4/pi)∑[(-1)^(n+1)/(2n-1)]*[cos[(2n-1)*pi*x/4]]
     
  2. jcsd
  3. Feb 4, 2016 #2

    RJLiberator

    User Avatar
    Gold Member

    Here's some of my further work.

    We wish to represent this as a cosine series.

    f(x) = 1 = ∑a_n*cos(n*pi*x/L)

    a_n = 2/L integral from 0 to L of f(x) * cos(n*pi*x/L)dx
    = 2/L integral from 0 to L cos(n*pi*x/L) dx
    = (2/L)*(L/(n*pi))*[sin(n*pi*x/L)] from 0 to L

    = 2/L *L/(n*pi) * sin((n*pi)-0)

    The problem here is, is that sin(n*pi) is always equal to 0.

    :/
     
  4. Feb 4, 2016 #3

    RJLiberator

    User Avatar
    Gold Member

    I think I am on to something.

    So, in my post above, I solved only half of the problem (I think) from 0 to 2.

    But, f(x) = -1 from 2 < x < 4
    so we solve the other half, similarly

    2/L *L/(n*pi) * sin((n*pi)-sin(n*pi/2))
    = 2/(n*pi)*(-sin(n*pi/2))

    Here, sin(n*pi/2) is either 1 or -1 (when odds) or 0 (when even)

    So if we add the two (or subtract, not sure which one yet) solutions together we get
    0 +/- (-2/(n*pi))(-1)^n
    where n is odd

    the sum starts to look like the answer from the book when we make the switch from n to 2n+1 for the summation so that all n values become odd.

    2/pi ∑[(-1)^(n+1)/(2n+1)]*[cos[(2n+1)*pi*x/4]]

    Answer from book:
    4/pi∑[(-1)^(n+1)/(2n-1)]*[cos[(2n-1)*pi*x/4]]

    Not sure if this is at all correct, but it's looking closer and closer like the solution. Not sure how I got 2/pi instead of 4/pi and the - and + signs are killing me.
     
  5. Feb 4, 2016 #4

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    Doesn't the problem ask you for a sine series? You want to extend the function for x<0 so that f(-x) = f(x).

    This is right for the cosine series, but you're assuming here that ##n\ne 0##. You need to consider that case separately.
     
  6. Feb 4, 2016 #5

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    Oh, you're doing #9. Never mind. ;)
     
  7. Feb 4, 2016 #6

    RJLiberator

    User Avatar
    Gold Member

    If n equals 0 we have sin(n*pi) = 0 and an n in the denominator. That's no good!

    a_0 = 2/pi based on
    1/pi* integral from 0 to 2 of 1

    (from the definition of cosine a_0)


    Was I correct in my latest post suggesting that I should also look at the 2 <x < 4 part and add/subtract that to the 0 part ?
     
  8. Feb 4, 2016 #7

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    Remember ##a_0## is the average value of the function, so in this case, you expect ##a_0=0##. For a constant function f(x)=1, you would have gotten ##a_0=1##.

    To answer your question, yes, you have to integrate over the entire cycle.
    $$a_n = \frac 2L \int_0^4 f(x)\cos\left(\frac{2\pi n}{L} x\right)\,dx = \frac 2L \int_0^2 f(x)\cos\left(\frac{2\pi n}{L} x\right)\,dx + \frac 2L \int_2^4 f(x)\cos\left(\frac{2\pi n}{L} x\right)\,dx$$ You just need to evaluate the integral piecewise since f(x) is defined piecewise.
     
  9. Feb 4, 2016 #8

    RJLiberator

    User Avatar
    Gold Member

    Are you sure that the cosine function takes on the argument of (2*pi*n*x / L) instead of just pi*n*x/L ?

    I have not seen that on other websites :eek:.
     
  10. Feb 4, 2016 #9

    RJLiberator

    User Avatar
    Gold Member

    In the second term, I would think L aka the length, would be equal to 2 and not 4.
    If this is true, then we have 0 + 0 and this doesn't make any sense to me.
    However, If L = 4 then I am on my way to the solution, but I don't understand why it would equal 4.
     
  11. Feb 4, 2016 #10

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    I made a mistake. You're right. For the general Fourier series, you're expanding in multiples of the fundamental frequency ##\frac{2\pi}{T}##, where ##T## is the period.

    Here, the function is defined from 0 to ##L##, but you're extending it to an even function defined on ##[-L,L]## so ##T=2L##.
     
  12. Feb 4, 2016 #11

    RJLiberator

    User Avatar
    Gold Member

    Ah, so L does equal 2 but since we are extending it, 2*2 = 4 and now I can solve it.

    :).
     
  13. Feb 4, 2016 #12

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    No, ##L=4## and ##T=8##. Look at the interval the original function is defined on.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Help solving fourier cosine series related problem
  1. Fourier Cosine Series (Replies: 7)

  2. Fourier Cosine Series (Replies: 6)

Loading...