# Modelling a function for a fourier series

1. May 8, 2009

### Ry122

when modelling a function for a fourier series, what determines which function i select from the forcing function for an and bn?
eg
in the following would 1-t^2 be used in the an or bn formula?
http://users.on.net/~rohanlal/fourier2.jpg [Broken]

Last edited by a moderator: May 4, 2017
2. May 9, 2009

### Easty

you would have to use both parts of f(t) when finding an and bn. all you need to do is break up the integrals that determine an and bn to the appropriate domains for each part of your function.

3. May 9, 2009

### Ry122

but how do i determine which part of f(x) goes in the an and which in the bn formula?

4. May 9, 2009

### ksac

As Easty says, you have to use both the definitions of f(t) for both an and bn.
Meaning, an will be sum of two integrals :
-One going from -ve infinity to 0 and using the first definition of f(t)=1-t2.
-Second going from 0 to infinity, using the second definition of f(t)=1.

Likewise for bn.

Goodluck!

5. May 9, 2009

### Cyosis

The general expression for a Fourier series of a 2pi-periodic function is given by.

$$f(x)=a_0+\sum_{n=1}^\infty (a_n \cos nx+b_n \sin nx)$$

So in general you will need to always calculate both a_n and b_n, however seeing as we integrate over a symmetric interval to determine the coefficients and we know that if we integrate an odd function over a symmetric interval we get 0. Therefore if f(t) is even f(t)sin(nt) is odd and b_n will be zero. Similarly if f(t) is odd f(t)cos(nt) will be odd and a_n will be zero. Your function is neither even nor odd.

6. May 9, 2009

### Ry122

if an or bn are zero due to the function being even or odd then that means you dont use both parts of f(t) in the formula. How do i determine what part of f(t) i should use?

7. May 9, 2009

### jbunniii

Your f(t) is neither even nor odd. Therefore you must use both parts, as others have already told you.

Why don't you start by trying to write down a formula for $$a_n$$. It will be a sum of two integrals, one for each part of f(t). If you get stuck, then show us what you are trying, and we'll let you know if something is wrong and/or suggest a next step.

8. May 9, 2009

### Ry122

i understand that is the case for this problem but what about problems that have odd or even functions?

9. May 10, 2009

### Cyosis

Your question is answered in post #5. If that's not what you meant then please try to be more detailed.

10. May 10, 2009

### Ry122

I want to find the fourier series of the following function, an even function, meaning bn=0
http://users.on.net/~rohanlal/even.jpg [Broken]
what should i make f(x) in the a_n formula, X+L or L-X?

Last edited by a moderator: May 4, 2017
11. May 10, 2009

### Cyosis

If this is true, I would like to see the formula for a_n and b_n of the previous problem since it works exactly the same as your new problem. Therefore I suspect that you did something awkward for the previous problem as well. Please show us your work.

Last edited: May 10, 2009
12. May 10, 2009

### Ry122

I haven't myself attempted these questions. I want an answer to my question before i bother trying.
Are you saying that you use both parts of f(x) even in even functions?
In the solution to my last posted problem, for a_n f(x) is made to equal L-X and the second part of the function is ignored (X+L).

13. May 10, 2009

### Cyosis

The general rules of this forum as far as I know ask you to attempt first, show us your attempt and we help you from there. My point is that in post 8 you claim to understand the question you ask in post 10. This seemed odd to me. Now seeing what you're doing in post 12 I know for sure you did not understand the previous problem either. That's why I think it's best to return to the original problem before continuing.

Either way the function f(x) is even indeed so b_n is 0. However the question states you have to Fourier transform f(x). The function you're transforming is g(x)=L-X, and $f(x) \neq g(x)$.

This is what you want to calculate:

$$a_n=\frac{1}{L} \int_{-L}^L f(x) cos(\frac{n\pi x}{L})dx$$

[quote='Ry122]
Are you saying that you use both parts of f(x) even in even functions[/quote]

This is not only what I am saying, but also the formula for the Fourier coefficients.

Last edited: May 10, 2009
14. May 10, 2009

### Ry122

so this is wrong? this is a solution from my teacher. theres no X+L in there
http://users.on.net/~rohanlal/laplace.jpg [Broken]

Last edited by a moderator: May 4, 2017
15. May 10, 2009

### Cyosis

Yes that's wrong, what you have there is the Fourier transform of the function g(x) in my previous post. In fact g(x) is odd so g(x) cos( Pi n x/L) is odd. You should really read post #5 again and use the data the assignment has given you. It gives you f(x), you have a formula to calculate a_n which includes the function f(x). So just plug f(x) into the formula and you can't go wrong.

16. May 10, 2009

### Ry122

but this is from my lecturer, and hes repeated the same process in several problems so it cant be a mistake.

17. May 10, 2009

### Cyosis

Ok I reviewed it again it's the correct answer, but you didn't just ignore the x+L part. Did you come to this answer by copying the lecture notes or actually realizing that:

$$\frac{1}{L}\int_{-L}^0 (x+L) dx+\frac{1}{L} \int_0^L(L-x)dx =\frac{2}{L}\int_0^L (L-x) dx$$?

18. May 10, 2009

### Ry122

so what happens with it?

19. May 10, 2009

### Cyosis

The left side is how you integrate your function f(x). Your teacher notices that he can write this as 2 times the integral of the right hand side. This saves time. He does NOT ignore the L+x term. Do you see this?

20. May 10, 2009

### Ry122

so it doesnt matter which part of f(x) you ignore, you can choose either part to be f(x) in a_n?

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook