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: Fourier Series.

  1. May 15, 2009 #1
    1. The problem statement, all variables and given/known data

    Hi I'm stuck with the following problem:

    Find the fourier series of:

    f(t) = { -sint for -pi < t < 0 and sint for 0 < t < pi }

    3. The attempt at a solution

    since they are both even functions I expanded both using the cosine series and I get two integrals which are the same if i swap the limits of integration around. So I add them together and I get:

    1/pi [ ʃ sin(t)cos(nx)] in the limits of -pi to pi

    Im trying to use a trig identity so that i can then integrate it but this is where I'm a bit lost.

    Any help will be greatly appreciated.
  2. jcsd
  3. May 15, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    That is not the integral you want to do. It's going to be zero for any choice of n. Do you see why? What you want to do is integrate -sin(x)cos(nx) from -pi to 0 and sin(x)cos(nx) from 0 to pi and add them. The first integral is the same as the second, so just do the second one and double it. To actually do the integral there is a trig identity that expresses sin(a)cos(b) in terms sin(a+b) and sin(a-b). Can you find it?
  4. May 15, 2009 #3
    Yes that integral contains an odd function so through those limits it will go to 0 I'm guessing?

    Yes thats whats I thought, although by multiplying one of them by 2 would i need to change the limits of integration or simply just multiply what I get by integrating one of the terms by 2?

    Im guessing the integral would then be:

    1/2 sin (u + v) + 1/2 sin(u - v) with limits 0 to pi ?
  5. May 15, 2009 #4


    User Avatar
    Science Advisor
    Homework Helper

    Just realize the integral from -pi to 0 is the same as the integral from 0 to pi and double one. Don't change the limits of integration. And, yes, you have the correct trig identity.
  6. May 16, 2009 #5
    Ok, Im sorry im finding this quite hard, i got the following integral then:

    1/(pi).1/2 [∫sin(t + nt) + sin(t - nt) dt

    I then get:

    1/n(pi)[ -cos(t + nt) + cos(t -nt) through the limits pi and 0 right?

    How do i make this equal to 1/2 when n is even? where am I going wrong?
  7. May 16, 2009 #6


    User Avatar
    Homework Helper

    Something went wrong with the integration.

    a_n & = \frac{1}{\pi}\int_{-\pi}^\pi f(t) \cos(nt)dt
    & = \frac{1}{\pi} \left(\int_{-\pi}^0 -\sin(t) \cos(nt)dt +\int_0^\pi \sin(t) \cos(nt)dt\right)
    & = \frac{2}{\pi} \int_0^\pi \sin(t) \cos(nt)dt
    & = \frac{1}{\pi} \int_0^\pi (\sin(t+nt) +\sin(t-nt))dt
    & = \frac{1}{\pi} \left[- \frac{1}{1+n} \cos(t+nt)-\frac{1}{1-n} \cos(t-nt)\right]_0^\pi
    Last edited: May 16, 2009
  8. May 16, 2009 #7
    Thanks very much. How would I be able to deduce that when n = even , it equals to 1/2?
  9. May 16, 2009 #8


    User Avatar
    Homework Helper

    Try to take it from this calculation on. If you get stuck we'll help you get unstuck.
  10. May 17, 2009 #9
    Ok yes. so If i put the limits in I get:

    1/pi [1/(1 + n) + 1/(1 - n)] - 1/pi [ -1/(1 + n) - 1/(1 - n) ]

    I have tried subtituting this into the cosine series formula and then for n =even...

    f(x) = 2/pi sigma[ cos(nt)/-n ]

    But How can I get 1/2 I really need to solve this question. Thanks for the help.
  11. May 17, 2009 #10


    User Avatar
    Homework Helper

    This isn't right, you ignored all cosines for some reason. For example [itex]\cos((1+n)\pi) \neq 1 \;\;\; \forall n \in \mathbb{Z}[/itex].

    Try to rush less and put the limits in again so you get the correct expression.

    Edit:I'll give you how the integral looks after simplification so that you can check if you've done it correctly,[tex]\frac{2(1+(-1)^n)}{\pi(1-n^2)}[/tex].
    Last edited: May 17, 2009
  12. May 17, 2009 #11
    Ok I'll show you my working out:

    When inputting the limits I get:

    1/pi [-1/(1+n) cos(pi + npi) - 1/(1 - n) cos(pi - npi)] - 1/pi [ -1/(1 + n)cos(0) - 1/(1 -n) cos(0)]


    This simplies to:

    2/ (1 + n)pi + 2/ (1 - n)pi


    2(1 - n) / (1 - n²) + 2(1 + n)/ (1 - n²)pi

    How do I get what you've just posted? and how does the sum of all n=even give me 1/2.
    I just can't see it.
  13. May 17, 2009 #12


    User Avatar
    Homework Helper

    You have inserted the limits correctly, however what happens to [itex]\cos(\pi + n \pi)?[/itex] after that?

    I really can't see what you did there. It seems that you claim [itex]\cos(\pi + n \pi)=1\;\;\forall n \in \mathbb{Z}[/itex]. I have already told you that this is not true.

    Please list all of your steps.

    What sum are you talking about, because the Fourier series itself won't go to 1/2?
    Last edited: May 17, 2009
  14. May 17, 2009 #13
    I thought when n= even cos(pi + npi) = 1 to be honest but you just said it wasn't the case.

    I can't see how I can narrow down the equation to show that : sigma 1/(n² -1) =1/2 when n =even
  15. May 17, 2009 #14


    User Avatar
    Homework Helper

    Ah you already assumed n is even. You should not do that in general, luckily in this case when n is odd the expression reduces to zero so there won't be a difference. Still it's a very bad method unless you consciously make the decision that since n is odd the expression goes to zero so I may as well start with n is even right away.

    The point however is that for n an integer [itex]\cos(\pi+n\pi)=(-1)^{n+1}[/itex]. Yes when n is even the expression reduces to [itex]\frac{4}{\pi(1-n^2)}[/itex]. The big question is why are you interested in that sum you just listed? It has nothing to do with the exercise you wrote down in your first post. Perhaps tell us exactly what the question is, because it seems very different from what you asked in post 1.

    Edit: After some thinking I guess you are asked to calculate that sum with the help of the Fourier series of |sin(t)|? If so could you please stop jumping to this magical 1/2 question and continue to finish the Fourier series step by step. Once this is done you will understand how you can calculate the sum.
    Last edited: May 17, 2009
  16. May 19, 2009 #15
    Sorry for the delayed reply I've been busy with exams this week...

    The question asked me to find out the sum of the terms when n = even thats why I didnt use (-1)^n+1

    Ok, I put 4/(pi)(1 - n²) into the cosine series formula and I get:

    Sigma 4/(pi)(1 - n²) cos (nt)dt = [-1/3 cos (2t) - 1/15 cos(4t) .....] = 1/(1 -n²)

    I dont understand how I can get 1/2 from this though? what am I missing out from here?
  17. May 19, 2009 #16


    User Avatar
    Homework Helper

    Okay. The 1/2 value will flow naturally out the Fourier series. However the Fourier series itself does not converge to 1/2, it should of course converge to the original function.

    What we have so far is [itex]a_0=\frac{2}{\pi}[/itex] and [itex]a_n=\frac{4}{\pi(1-n^2)}[/itex].

    Therefore the Fourier series is:
    f(t)=\frac{2}{\pi}+\sum_{n=even} \frac{4 \cos n t}{\pi(1-n^2)}

    Now you have an equation you can solve for the sum. Can you see how to find the value of the sum you're interested in now?
  18. May 20, 2009 #17

    Well doesnt this mean:

    Modulus Sine =\frac{2}{\pi}+\sum_{n=even} \frac{4 \cos n t}{\pi(1-n^2)}

    I know this may sound stupid but I dont really know how to go on from here..
  19. May 20, 2009 #18


    User Avatar
    Homework Helper

    Yep that is correct. The only question that sounds stupid is the one you don't ask when you don't understand something.

    What you want to do now is to compare the sum to the sum you're interested in. For example put the constants in front, turn some signs around, take a value for t etc. Play a bit with it and see if you can get it into the required form.
    Last edited: May 20, 2009
  20. May 20, 2009 #19
    Aha! Well I put t=0 into the equation and after some rearranging I actually got:

    1/2 = Sigma 1/(n² -1)

    Which is what they were asking! Well I'm happy that I was able to solve it after a lengthy thread lol. Thanks very much for the help! Really appreciated!

    One more question before this thread disappears lol, Im trying to see if I got it right:

    If in the range -pi < x < pi , a function f(x) is defined by:

    f(x) = x if 0 < x < pi AND -x otherwise

    (a) Calculate the Fourier Series representation of f(x) :

    Since it is an even function I expanded using the cosine series

    And I got :

    f(x)= x = pi/2 + Sum [((-1)^n) -1 / n²] (cosnx) *Not sure if i got the whole thing correctly*

    But part (b) says:

    By choosing an appropiate value of x deduce that :

    pi² = 8(1 + 1/9 + 1/25 ...)

    How do I go around with this part of the question? Do I replace x by pi² but If I do I still cant seem to rearrange it and get what is needed.

  21. May 20, 2009 #20


    User Avatar
    Homework Helper

    You're welcome. This question is much like the first, however the reason you're probably stuck is that you made an error calculating a_n, a_0 is correct. Once you have calculated a_n correctly finding an expression for pi^2 will be much like finding the value 1/2 of the previous exercise.

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

    Look how close you were. Try to find where you lost 2/pi in your calculations.
  22. May 20, 2009 #21
    Brilliant! manage to complete it. I have a general question though:

    If for a range of -1 to 1 for the integral of cos using cosine series is it always zero? and how about if f(x) is sine will using the cosine series give me zero too? Is there any general argument that can be used to avoid lots of working out?

  23. May 21, 2009 #22


    User Avatar
    Homework Helper

    If an odd function is integrated over a symmetrical interval and the integral converges then the integral is always zero. So let f(x) be an odd function then [itex]\int_{-a}^a f(x) =0[/itex]. In your example f(x)=cos(x), cos(x) is even and cos(x)cos(nx) is even so [itex]\int_{-a}^a \cos x \cos nx dx \neq 0[/itex] in general. Of course if a=0 in this case the integral is zero, and if f(x)=0 which is even then the integral is zero as well. Now if we take a look at the sine series, we have cos(x)sin(n x), which is odd therefore [itex]\int_{-a}^{a} \cos x \sin nx =0[/itex]. Of course the integrals needs to exist, for example 1/x is odd but [itex]\int_{-1}^{1} \frac{1}{x}[/itex] does not converge.

    So to summarize:

    If [itex]f(x)[/itex] is an odd function and [itex]\int_{-a}^a f(x) dx[/itex] exists, then [itex]\int_{-a}^a f(x) dx=0[/itex].
    Last edited: May 21, 2009
  24. May 24, 2009 #23

    Brilliant! had the exam the other day and a similar question came up so thanks for the help again! I will be sticking around these forums for quite some while, I have a lot of improvement to make..lol
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook