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!

Homework Help: Find the Fourier series

  1. Aug 22, 2011 #1
    1. The problem statement, all variables and given/known data

    The function f has period 4 and is such that
    f(x)=2+x, -2<x[itex]\leq0[/itex]
    f(x)=2, 0<x<2

    Sketch the graph of f for x∈[−4, 4] and obtain its Fourier series.

    2. Relevant equations

    3. The attempt at a solution

    Okay so I've pretty much sketched the graph, but I've been thrown by the 2+x and I'm not sure what to do from this point onwards.

    So a0=[itex]\frac{1}{2}[/itex][itex]\int^{2}_{0}2dx[/itex]=2




    Am I on the right lines...?
    Last edited: Aug 22, 2011
  2. jcsd
  3. Aug 22, 2011 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    No, you aren't. You are given one period of a function whose period is 4. That is a two piece function defined on (-2,2). If you have graphed it you will know that it is neither even nor odd so you may not use the half-range formulas for the coefficients. The formula for an in this problem is

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

    and similarly for bn. You have to break these intgrals up into (-2,0) and (0,2) and use the appropriate formula for f(x) in each.
  4. Aug 22, 2011 #3
    Oh god, I'm an idiot. Thank you for that! Can't believe I did that.

    So I now have


    = [itex]\frac{4sin(n\pi)}{n\pi}[/itex]

    and bn= [itex]\frac{-2(ncos(n\pi))(\pi-sin(n\pi))}{n2\pi2}[/itex]
  5. Aug 22, 2011 #4
    Sorry, I forgot to take the sines and cosines out



    bn= 0

    Is what I've got which I HOPE is correct.
    This would make the Fourier series

  6. Aug 22, 2011 #5


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    That can't be correct because your original f(x) is neither even nor odd, and this answer is an even function. You can't have all the bn be zero.
  7. Aug 23, 2011 #6
    I keep reaching different answers for my an and bn

    My latest answers are

    an= [itex]\frac{2(n+1)}{n^{2}\pi^{2}}[/itex]


    bn= [itex]\frac{2(n\pi^{2}+\pi^{2}-1)}{n\pi}[/itex]
  8. Aug 23, 2011 #7


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Those are both wrong and you haven't calculated a0. Here's what you should get for your constants:

    [tex]a_n=\frac{(-1)^{n+1}+1}{\pi n^2}[/tex]

    Keep trying.
  9. Aug 23, 2011 #8


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    Those aren't correct. You should get
    a_n &= (1+(-1)^{n+1})\frac{2}{n^2\pi^2} \\
    b_n &= (-1)^{n+1}\frac{2}{n\pi}
    I think you dropped a factor of pi somewhere, LCKurtz.
  10. Aug 23, 2011 #9
    I got a0= [itex]\frac{3}{2}[/itex]

    Because I thought the formula was


    and L is 2 so

    a0= [itex]\frac{1}{4}[/itex][[itex]\int^{0}_{-2}(2+x) dx + \int^{2}_{0}2 dx][/itex]

    Which would give [itex]\frac{3}{2}[/itex]
  11. Aug 23, 2011 #10


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Yes, 3/2 is correct for a0. Vela's formulas for the coefficients are correct. I inadvertently used L = pi instead of L = 2 when I calculated the coefficients.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook