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!

Fourier expansion between two different intervals

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

    f(x) = x+1 for -1,x<0
    x-1 for 0<x<1
    0 for x=0

    expand it in an appropriate cosine or sine series



    2. Relevant equations

    f(x) = a0/2 + [itex]\sum[/itex] [ancos (n[itex]\pi[/itex]x/p) + bn sin (n[itex]\pi[/itex]x/p)

    a0 = 1/p [itex]\int[/itex]f(x).dx

    an = 1/p [itex]\int[/itex] f(x)cos (n[itex]\pi[/itex]x/p).dx

    bn = 1/p [itex]\int[/itex] f(x)sin (n[itex]\pi[/itex]x/p).dx


    3. The attempt at a solution

    As there are two functions within this f(x), I am unsure of how to go ahead and do this.
    I realise the overall function is odd, therefore would only need to expand the bn part of the Fourier series, however the individual functions are not odd.
    How would I go about setting this up?
     
  2. jcsd
  3. Aug 5, 2011 #2
    You'll need to break the integrals into two parts. The first will integrate x+1 from -1 to 0, the second will integrate x-1 from 0 to 1.
     
  4. Aug 5, 2011 #3

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    [tex]\int_{-1}^1 f(x)dx= \int_{-1}^0 f(x)dx+ \int_0^1 f(x)dx[/tex]
     
  5. Aug 6, 2011 #4
    Can this only be done the long winded way of calculating a0, an and bn for each equation, therefore doing 6 integrals? Or will some cancel for being odd/even functions, which I cannot see at first glance?

    Also would the value of 'p' in my 'relevant equations' be -1 for x+1 and 1 for x-1?
     
  6. Aug 6, 2011 #5

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    In a sense, you always have to calculate an and bn. It's just that if you have an even or odd function, you can sometimes use tricks to simplify or avoid lengthy calculations. When you have an odd integrand O(x) and a symmetric interval [-a,a], you know that[tex]\int_{-a}^a O(x)\,dx = 0[/tex](You should be able to prove this.) If you have an even integrand E(x), you can say[tex]\int_{-a}^a E(x)\,dx = 2\int_{0}^a E(x)\,dx[/tex](Again, you should be able to prove this.)

    In this problem, you want to write down the integrals for an and bn, take a look at the integrands, and see if either of the above apply. If they do, you can use them to simplify evaluating the integrals for an and bn.
    You need to understand what the quantities that appear in a formula represent otherwise you're just guessing. So what does p represent in these formulas?
     
  7. Aug 6, 2011 #6
    I thought p represented the value for which we integrate between, as all the examples so far have been where the limit is between p and -p, however, because these functions are between -1 and 0 & 0 and 1, I would presume it was the non-zero number, although I do not understand where the 1/p at the beginning of each integral comes from, so I guess that is where my miss-understanding occurs.
     
  8. Aug 6, 2011 #7

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    The function f(x) defined on the interval [-1,1]. That's what determines what p is equal to. How f(x) is actually defined, in this case, piecewise, has nothing to do with p.
     
  9. Aug 7, 2011 #8
    Therefore p will be 1 for both parts of the function, regardless of where the two parts of the function lie, between this interval?
     
  10. Aug 7, 2011 #9

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    Yup. Take a0 for example. You get
    \begin{align*}
    a_0 &= \frac{1}{p}\int_{-p}^p f(x)\,dx \\
    &= \frac{1}{1}\int_{-1}^1 f(x)\,dx \\
    &= \int_{-1}^1 f(x)\,dx
    \end{align*}
    because a single period is over [-1,1]. Now when you substitute in for f(x), you would split the integral up because of the two pieces to get
    \begin{align*}
    a_0 &= \int_{-1}^1 f(x)\,dx \\
    &= \int_{-1}^0 f(x)\,dx + \int_{0}^1 f(x)\,dx \\
    &= \int_{-1}^0 (x+1)\,dx + \int_{0}^1 (x-1)\,dx
    \end{align*}
    Note that this isn't necessarily the way you'd calculate a0 since you're not taking advantage of the oddness of f(x). It was just to show that p doesn't depend on the fact that f(x) is made out of two or more pieces.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook