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: Fourier series (sine,cosine)

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

    Given f(x) = 2x+1 periodic from -pi<x<pi. Find the fourier series from (-pi to pi) as well as the sine series from [0, pi] and cosine series from (0,pi)


    2. Relevant equations



    3. The attempt at a solution

    So since f(x) is periodic it is odd, so then a0 and ak = 0.

    for bk:

    bk = 1/pi int f(x) sin kx from -pi to pi.
    skipping forward, I get bk = [(-1)^ k][-4/k]

    now im a bit confused about the sine and cosine series. I thought if f(x) was odd then it turns into a sine series automatically so isn't it basically the same thing as what I got?

    And the cosine series should just be 0?
     
  2. jcsd
  3. Feb 1, 2012 #2

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    f isn't odd. For example, f(1) = 3 while f(-1) = -1. Clearly, f(1) ≠ -f(-1).

    The idea is to restrict f to the domain [0, π] and then extend it so that it's an even or odd function on the interval [-π, π]. In other words, when -π≤x<0, you have f(x) = ±f(|x|).
     
  4. Feb 2, 2012 #3
    I thought when you have f(x+p) when its periodic it is just equal to f(x)?
    Regardless I got ak and a0 as 0 even when I used f(x) = 2x+1

    And shouldn't it be f(x) = f(-x)?

    if x E [0,pi] then f(x) = 2x +1 and if x E [-pi,0], f(-x) = 2x+1??
     
    Last edited: Feb 2, 2012
  5. Feb 2, 2012 #4

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    If p is the period, then yes. But what does that have to do with anything about f being even or odd?

    All I can say is you got the wrong answer since you haven't shown your work.

    Yes, if f is an even function.

    No, that's not right. Take ##x=+\pi/2 \in [0,\pi]## so ##f(\pi/2) = \pi+1##. Now take ##x=-\pi/2 \in [-\pi,0]##. You're saying ##f(-x) = 2x+1##, but you have
    $$f(-x) = f(-(-\pi/2)) = f(\pi/2) = \pi+1$$ whereas
    $$2x+1 = 2(-\pi/2) + 1 = -\pi + 1.$$ Clearly, f(-x) ≠ 2x+1.
     
  6. Feb 2, 2012 #5
    Ok I figured it out. For the fourier series I got ak and a0 as 0? But for the cosine series i did this
    F(x) = f(x) for 0<x<pi
    F(x) = -f(-x) for -pi<x<0

    where f(x) = 2x+1

    that results in an even function so I solved for a0 and ak from there.
     
  7. Feb 2, 2012 #6

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    How are you getting a0=0 for the regular Fourier series?
     
  8. Feb 2, 2012 #7
    Oh yeah I made a calculation error i believe.

    ao = 1/2pi int from pi to -pi 2x+1 dx
    = 1/2pi (x^2 + x) from pi to -pi
    = 1/2pi [pi^2 + pi - ((-pi)^2 -pi]
    = 1

    ak = 1/pi int 2x+1 cos kx dx from -pi to pi

    u = 2x+1 dv = cos kx
    du = 2 dx v = 1/k sin kx

    x from -pi to pi
    =1/pi[(2x+1 sin kx)/k) - 2/k int (sin kx) from -pi to pi]

    = 1/pi[0 - 2/k (-1/k cos kx from -pi to pi)]
    = 1/pi[2/k^2 (cos kx from -pi to pi)] = 0

    that right?
     
  9. Feb 2, 2012 #8

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    Looks good.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook