Extending function to determine Fourier series

J6204
Messages
56
Reaction score
2
Thread moved from the technical forums, so no Homework Template is shown
In the following question I need to find the Fourier cosine series of the triangular wave formed by extending the function f(x) as a periodic function of period 2
$$f(x) = \begin{cases}
1+x,& -1\leq x \leq 0\\
1-x, & 0\leq x \leq 1\\\end{cases}$$
I just have a few questions then I will be able to get started to execute this solution.
**Question 1** How do I extend the function f(x) as a periodic function of period 2?
**Question 2** The formulas for determing the cosine series are the following,
$$a_0 = \frac{2}{L} \int_0^L f(x) dx$$
$$a_n = \frac{2}{L} \int _0^L f(x) \cos \left(\frac{n\pi x}{L}\right) dx$$
$$f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos\left( \frac{n\pi x }{L} \right)$$
Once we have extended the function what will the value of L be?
 
Physics news on Phys.org
J6204 said:
In the following question I need to find the Fourier cosine series of the triangular wave formed by extending the function f(x) as a periodic function of period 2
$$f(x) = \begin{cases}
1+x,& -1\leq x \leq 0\\
1-x, & 0\leq x \leq 1\\\end{cases}$$
I just have a few questions then I will be able to get started to execute this solution.
**Question 1** How do I extend the function f(x) as a periodic function of period 2?

You don't have to "extend the function". Since your function is even, the half range cosine series will be a periodic extension of your function.

**Question 2** The formulas for determing the cosine series are the following,
$$a_0 = \frac{2}{L} \int_0^L f(x) dx$$
$$a_n = \frac{2}{L} \int _0^L f(x) \cos \left(\frac{n\pi x}{L}\right) dx$$
$$f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos\left( \frac{n\pi x }{L} \right)$$
Once we have extended the function what will the value of L be?
##L## is half the period of the extended periodic function. In your case one period is given on ##[-1,1]## so the period is ##2## and ##L=1##.
 
LCKurtz said:
You don't have to "extend the function". Since your function is even, the half range cosine series will be a periodic extension of your function.##L## is half the period of the extended periodic function. In your case one period is given on ##[-1,1]## so the period is ##2## and ##L=1##.
okay so then I am able to start the following integrations, I just want to see if what I have below is correct then I can calculate them

$$a_0 = \frac{2}{L} \int_0^L f(x) dx = 2\int_{-1}^0(1+x)dx + 2\int _{0}^1 (1-x)dx $$
$$a_n = \frac{2}{L} \int _0^L f(x) \cos \left(\frac{n\pi x}{L}\right) dx = 2 \int_{-1}^0(1+x)cos(n\pi x) dx + 2\int_{0}^1 (1-x)cos(n\pi x) dx $$
 
J6204 said:
okay so then I am able to start the following integrations, I just want to see if what I have below is correct then I can calculate them

$$a_n = \frac{2}{L} \int _0^L f(x) \cos \left(\frac{n\pi x}{L}\right) dx$$

That is the formula for ##a_n##. You know ##L=1## and ##f(x)## on that interval is ##1-x##. So your formula is $$a_n = \frac 2 1 \int_{0}^1 (1-x)cos(n\pi x) dx $$That is all there is to it. The whole point of half range formulas is that you don't need to use the other formula for ##[-1,0]##. So what you have below, besides being incorrect, is pointless.

$$ = 2 \int_{-1}^0(1+x)cos(n\pi x) dx + 2\int_{0}^1 (1-x)cos(n\pi x) dx $$
 
Okay thanks, I actually didon't mean to put that 2 in there. Thanks for your help!
 
So I only need to calculaye the (1-x) integral? That makes it much easier
 
J6204 said:
Okay thanks, I actually didon't mean to put that 2 in there. Thanks for your help!
The ##2## needs to go on the half range formula because it essentially includes the other half. But if you include both halves, neither would have the ##2## in front. The point is that the two integrals are equal for an even function and that's why you can do just one of the integrals and double it. But if you did both integrals you wouldn't double either one. Clear?
 
LCKurtz said:
The ##2## needs to go on the half range formula because it essentially includes the other half. But if you include both halves, neither would have the ##2## in front. The point is that the two integrals are equal for an even function and that's why you can do just one of the integrals and double it. But if you did both integrals you wouldn't double either one. Clear?
okay so I understand what you are saying. Now I just need to calculate the following,
$$a_n = 2 \int_0^1 (1-x)\cos (n\pi x) dx $$
then plug it into the formula below to get the form of the Fourier series,
$$f(x) = \sum^\infty_{n=1} a_n \cos\frac{n\pi x}{L}$$ where L is 1
 
Don't forget the appropriate half range formula for ##a_0## and include it.
 
Back
Top