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 of |sin x|

  1. Sep 24, 2008 #1
    I'm trying to find the fourier series of |sin x| between -pi and pi.

    I've got it down to:

    a_n = \frac{1}{\pi} \int^{\pi}_{-\pi} |sin x| cos (nx) dx

    which i wrote as:

    a_n = \frac{2}{\pi}\int^{\pi}_0 sin x cos (nx) dx


    sin x cos (nx) = \frac{1}{2} (sin (n+1)x - sin (n-1)x)

    I eventually get

    a_n = \frac{2(n(-1)^n - 1)}{\pi(n^2 - 1)}


    f(x) = \frac{2}{\pi} + \sum^{\infty}_{n=1} \frac{2(n(-1)^n - 1)}{\pi(n^2 - 1)} cos(nx)

    The answer however gives

    f(x) = \frac{2}{\pi} + \frac{4}{\pi}\sum^{\infty}_{n=1} \frac{cos (2nx)}{4n^2 - 1}

    I don't see how they arrive at this... if anyone can let me know where i've gone wrong or if i'm missing something :S
    Last edited: Sep 24, 2008
  2. jcsd
  3. Sep 24, 2008 #2


    User Avatar
    Science Advisor

    You mad a mistake in calculating an. There is no n in the numerator. It should be (-1)n-1-1. Then all the terms for odd n are 0 and the even terms remain. (I suggest you redo the calculation).
  4. Sep 24, 2008 #3
    yeah i found the mistake,
    I get the numerator to be
    2((-1)^{n-1} - 1)

    which does lead to the right answer.

    thx for your help.:cool:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook