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!

Frustrated by Fourier series

  1. Sep 20, 2011 #1
    I'm trying to get fourier series for some function however I get the same nonsense series each time:

    [tex]
    f(x)=\begin{cases}
    0, & \mbox{if x $\in [-\pi,0]$}\\
    x, & \mbox{if x $\in (0,\pi)$} \end{cases}
    [/tex]

    [tex]
    \pi a_n=\int_{-\pi}^\pi f(x)cos(nx)dx=\int_{-\pi}^0 0 \cdot cos(nx)dx+\int_0^\pi xcos(nx)dx=\left.\left[\frac{xsin(nx)}{n}-\frac{cos(nx)} {n^2}\right]\right|_0^\pi
    [/tex]

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

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

    [tex]
    \pi b_n=\int_{-\pi}^\pi f(x)sin(nx)dx=\int_{-\pi}^0 0 \cdot sin(nx)dx+\int_0^\pi xsin(nx)dx=\left. \left[-\frac{xcos(nx)}{n}-\frac{sin(nx)}{n^2}\right] \right|_0^\pi=-\frac{\pi (-1)^n}{n}
    [/tex]

    [tex]
    b_n=-\frac{(-1)^n}{n}
    [/tex]


    WolframAlpha suggests that I wrongly calculated the integral, however I used well know theorem:
    [tex]\int p(x)f(x)dx=p \cdot F_1+p' \cdot F_2... [/tex]
    You can also see the same on this picture:
    0.jpeg
     
    Last edited: Sep 20, 2011
  2. jcsd
  3. Sep 20, 2011 #2
  4. Sep 20, 2011 #3
  5. Sep 20, 2011 #4

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    That last minus should be a plus; that's all that is wrong.
     
  6. Sep 20, 2011 #5
    Sorry but I don't understand why.

    if p(x) is polynomial and f(x) is continues in I then:
    [tex]\int p(x)f(x)dx=p(x)F_1+p'(x)F_2 [/tex] where F_1 is integral of f(x) and F_2 is the integral of the integral of f(x)

    p(x)=x, p'(x)=1
    f(x)=cos(nx)
    [tex]\int f(x)=F_1=\frac{sin(nx)}{n} [/tex]
    [tex]\int F_1=F_2=\frac{-cos(nx)}{n^2}[/tex]

    Thus: [tex]\int xcos(nx)=\frac{sin(nx)}{n}-\frac{cos(nx)}{n^2}[/tex]
     
  7. Sep 20, 2011 #6

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    That formula is incorrect. That + should be a -.
     
  8. Sep 20, 2011 #7

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Actually, there is more than that wrong with it. If F(x) is an antiderivative of f(x):

    [tex]\int p(x)f(x)\, dx = p(x)F(x) -\int p'(x)F(x)\, dx[/tex]
     
    Last edited: Sep 20, 2011
  9. Sep 20, 2011 #8
    Oh this is embarrassing mistake...

    Thanks [again]!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Frustrated by Fourier series
  1. Fourier series (Replies: 10)

  2. Fourier Series (Replies: 1)

  3. Fourier Series (Replies: 6)

Loading...