# Fourier Series.

1. May 15, 2009

### hhhmortal

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. May 15, 2009

### Dick

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?

3. May 15, 2009

### hhhmortal

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 ?

4. May 15, 2009

### Dick

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.

5. May 16, 2009

### hhhmortal

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?

6. May 16, 2009

### Cyosis

Something went wrong with the integration.

\begin{align*} 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 \end{align*}

Last edited: May 16, 2009
7. May 16, 2009

### hhhmortal

Thanks very much. How would I be able to deduce that when n = even , it equals to 1/2?

8. May 16, 2009

### Cyosis

Try to take it from this calculation on. If you get stuck we'll help you get unstuck.

9. May 17, 2009

### hhhmortal

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.

10. May 17, 2009

### Cyosis

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

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,$$\frac{2(1+(-1)^n)}{\pi(1-n^2)}$$.

Last edited: May 17, 2009
11. May 17, 2009

### hhhmortal

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

hence:

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.

12. May 17, 2009

### Cyosis

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

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

What sum are you talking about, because the Fourier series itself won't go to 1/2?

Last edited: May 17, 2009
13. May 17, 2009

### hhhmortal

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

14. May 17, 2009

### Cyosis

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 $\cos(\pi+n\pi)=(-1)^{n+1}$. Yes when n is even the expression reduces to $\frac{4}{\pi(1-n^2)}$. 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
15. May 19, 2009

### hhhmortal

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?

16. May 19, 2009

### Cyosis

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 $a_0=\frac{2}{\pi}$ and $a_n=\frac{4}{\pi(1-n^2)}$.

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?

17. May 20, 2009

### hhhmortal

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..

18. May 20, 2009

### Cyosis

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
19. May 20, 2009

### hhhmortal

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.

Thanks!

20. May 20, 2009

### Cyosis

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.