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: Odd or Even? - Arbritrary Period Fourier Series

  1. Mar 4, 2016 #1
    1. The problem statement, all variables and given/known data
    Hello everyone,

    I'm new to the great field that is Fourier analysis, and have a question about the way in which to determine if the function is a odd or even function.

    Given the function, of one period

    f(x) = { x; 0 <= x < =1, 1; 1 < x < 2, (3 -x); 2 <= x <= 3:

    Is there a definitive way in which you can determine if this function will be even about the y axis or odd about the x axis.

    2. Relevant equations
    f(-x) = f(x) (even)
    f(-x) = -f(x) (odd)

    3. The attempt at a solution
    Drawing this function I immediately thought that it was even, although on second thought the function could indeed go down into the 3rd quadrant in the Cartesian coordinate system when repeated in the negative x direction. So I turned to numerical analysis.

    Is it correct to use the relevant equations as follows?

    f(-x) = { -x; 0>= -x>=-1, 1; -1>=-x>=-2, (3 + x); -2>=-x>=-3.

    As you would then have a negative slope going from -1 to 0, the constant remains the same in the negative x direction and a positive slope in the -3 to -2 boundaries.

    Wouldn't this imply that it is an even function? Or, the only way to really know is if the function boundary conditions that are initially given, includes the area in the negative x direction?
  2. jcsd
  3. Mar 4, 2016 #2

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    If you look at your f(x) on [0,3] as the basic building block of a periodic function with period 3, the result is naturally even. That happens in this case only because of the special form of f(x) on [0,3], being symmetric about x = 1.5.
  4. Mar 4, 2016 #3
    So because the function is mirrored at the period T= 3/2 therefore x = 3/2, it is even..? I ran a program through Matlab to doubly check if the function was even and check the coefficients calcs, and the b_n coefficient did not equate to 0- with some quite "hairy" coefficients at that.
  5. Mar 5, 2016 #4


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    @Charge2: You need to understand that the function you gave is neither even nor odd. In fact it doesn't make sense to ask whether it is even or odd because it is only defined on ##[0,3]##. And for the same reason, it isn't periodic either. What you can do is talk about extending the definition of the function into an even or odd periodic function. For example, if you add to your definition that$$
    f(x) = -3-x, ~-3\le x \le -2,~f(x) = -1,~-2\le x \le -1,~f(x) = x,~-1\le x \le 0$$ and periodic thereafter you would have an odd function of period ##6##. This is the function that a half range sine series of the given function would represent.

    Just repeating the graph as in post #2 would give an even extension of the function of period ##3##. If you use the half range cosine expansion on the given function it would represent the even extension and would be calculated as a function of period ##6## even though it is also of period ##3##.

    [Edit, added]: I just noticed that your OP states the given function on ##[0,3]## represents one period. So it is defined on the whole line and periodic and is even. Nevertheless, I think you may find my comments above useful, at least I hope so.
  6. Mar 5, 2016 #5

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    No software can tell you if the extended function is even, odd, or neither. YOU can decide to make it even, or you can extend it as an odd function (but not in any natural way). If you apply the Fourier series formulas to your function without further thought, you are tacitly assuming that the function is extended outside [0.3\ in some way.
    I did the same thing in Maple, and for expansion functions ##u_0 = \sqrt{1/3}## and ##u_n = \sqrt{2/3} \, \cos(2 \pi n x/3)##, ##v_n = \sqrt{2/3} \, \sin(2 \pi n x/3)## for ##n = 1, 2, 3, \ldots## (which are orthonormal on ##[0,3]##) the coefficients in
    [tex] f(x) = A_0 u_0 + \sum_{n=1}^{\infty}( A_n u_n(x) + B_n v_n(x) ) [/tex]
    are given by
    [tex] A_n = \int_0^3 f(x) u_n(x) \, dx, \;\; B_n= \int_0^3 f(x) v_n(x) \, dx [/tex]
    for all ##k##.
    Maple gets
    [tex] B_n = \frac{3 \sqrt{6}}{4 \pi^2 n^2} \left( \sin \left(\frac{2 \pi n}{3}\right) + \sin \left(\frac{4 \pi n}{3} \right) \right) [/tex]
    Although this does not look like 0, when you evaluate it at positive integer ##n## you do, actually, get 0! You can even prove this analytically, just by looking at the locations of the points at angles ##2 \pi n/3## and ##4 \pi n/3## on the unit circle.

    Therefore, the Fourier series of ##f(x)## is a Fourier-cosine series, exactly as you would expect of an even function. Is that what was bothering you?
    Last edited: Mar 6, 2016
  7. Mar 7, 2016 #6
    Thanks Ray and LcKurtz, the series has been solved with the help of your clarifications. And yes distinguishing between with what Fourier series to use was a major issue. I made the mistake of thinking that if function was given piecewise and not extended then you would have to take into account the possibility of the function going down into the lower quadrants. This of course was just neglecting the explicit period given, thus I needed to repeat the function as written. To throw that in the mix I'm using two textbooks to learn the material and they both have slightly different notation. Which was confusing when starting this out. I ended up using the period of w = 2pi/3 and doubled each integral for ease of calculation from 3/2 to 0. Anyway, I calculated the coefficients, and got a_0 = 4/6 and a_n = -9/n^2*2*pi^2 for n = 1,2,4,5,7.. which when graphed, fitted my initial sketch of the function with great accuracy. It was very pleasing to see this and I am just starting to see the beautiful mathematics of Fourier analysis. I'm now going to try my hand at more functions with the common periods of pi to -pi then move onto more arbitrary length functions for now just to to let the process and let it all soak in then learn about transforms. Again thanks. :).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted