# Thread: Trigonometric Fourier series

1. ## Trigonometric Fourier series

Hi,

I have the following $2\pi$-periodic function:

$\displaystyle f(t)=\left\{\begin{array}{lll}{\pi} ,\,\,0 < t < 1\\{}\\0 ,\,\, 1 < t< 2\pi-1\\{}\\{\pi} ,\,\, 2\pi-1 < t< 2\pi\end{array}\right$

$\displaystyle{c_{0}={\frac{1}{2\pi}\int_{-\pi}^{\pi}f(t)dt$ (1) $\displaystyle\implies$

$\displaystyle\implies\displaystyle{c_{0}={\frac{1} {2\pi}(\int_{0}^{1}{\pi}dt+{\int_{2\pi-1}^{2\pi}{\pi}dt)$

Is this integral to compute $c_{0}$ correct using (1)? If not what are the limits? Any help or guidance would be appriciate it.

2. Hmm. I'd say your expression for $c_{0}$ should be

$\displaystyle{c_{0}=\frac{1}{2\pi}\int_{0}^{2\pi}f (t)\,dt.}$

Your initial integral there had the wrong limits. Your final expression is correct (you fixed your error in there somewhere.)

3. Originally Posted by Ackbeet
Hmm. I'd say your expression for $c_{0}$ should be

$\displaystyle{c_{0}=\frac{1}{2\pi}\int_{0}^{2\pi}f (t)\,dt.}$

Your initial integral there had the wrong limits. Your final expression is correct (you fixed your error in there somewhere.)
$\displaystyle\implies\displaystyle{c_{0}={\frac{1} {2\pi}(\int_{0}^{2\pi-1}{\pi}dt+{\int_{2\pi-1}^{2\pi}{\pi}dt)={\pi}$

Is it correct now? Isn't the first value of the function is $\pi$ between the limits 0 to 1 and the value is 0 between $1 < t< 2\pi-1$

Kind regards

4. No, no. Re-read my earlier post more carefully:

Your initial integral there had the wrong limits. Your final expression is correct...

5. Originally Posted by Ackbeet
No, no. Re-read my earlier post more carefully:
Ok, sorry. My last post didn't seem correct at all.

$\displaystyle{c_{0}=\frac{1}{2\pi}\int_{0}^{2\pi}f (t)\,dt.}$

$\displaystyle\implies\displaystyle{c_{0}={\frac{1} {2\pi}(\int_{0}^{1}{\pi}dt+{\int_{2\pi-1}^{2\pi}{\pi}dt)=1$

6. Looks good to me.

7. I have computed $a_{k}$ and was wondering if this is correct.

$\displaystyle a_{k} = \frac{2}{T} \int_{P}^{} \cos (k\Omega t) \ dt$

$\displaystyle\Omega=\frac{2\pi}{T}\implies T=2\pi\implies \Omega=1$

$\displaystyle a_{k} = \frac{2}{2\pi} ({\pi}(\int_{0}^{1} \cos (kt) \ dt+{\int_{2\pi-1}^{2\pi}\cos (kt) \ dt)=$...

The first integral...
$\displaystyle\int_{0}^{1} \cos (kt) \ dt=\frac{sin(k)}{k}$

The second integral...

$\displaystyle{\int_{2\pi-1}^{2\pi}\cos (kt) \ dt=\frac{1}{k}(sin({2\pi} k)-sin({2\pi}k-k))$

$\displaystyle sin({2\pi} k)=0$

$\displaystyle-sin({2\pi}k-k)=sin({2\pi} k) cos(k)-cos({2\pi} k) sin (k)$

$\displaystyle cos({2\pi} k)=1$

...therefore is the second integral equals...

$\displaystyle{\int_{2\pi-1}^{2\pi}\cos (kt) \ dt=\frac{sin(k)}{k}$

and I get...

$\displaystyle a_{k} = 2 \frac{sin(k)}{k}$

That concludes that the trigonometric Fourier series for the given function above is...
$
\displaystyle1+2 \sum_{k=1}^{\infty} \frac{\sin k}{k}$

8. I agree with your computations of $a_{k}$. And since you're dealing with an even function, your $b_{n}=0$ for all $n$. However, when you construct your Fourier Series, the result should have $t$'s in it! The formula you want, in your case, is

$\displaystyle{f(t)=\frac{a_{0}}{2}+\sum_{k=1}^{\in fty}a_{k}\cos(kt)}.$

9. Since the function is even shouldn't $c_{0}$ be as followed? In other words I should double the integral?

$\displaystyle{c_{0}=\frac{1}{2\pi}\int_{0}^{2\pi}f (t)\,dt$

$\displaystyle\implies\displaystyle{c_{0}={\frac{2} {2\pi}(\int_{0}^{1}{\pi}dt+{\int_{2\pi-1}^{2\pi}{\pi}dt)=2$

10. You're confusing yourself, I think. Constructing a trigonometric Fourier series is a two-step process (depending on how you count steps):

1. Compute the coefficients $a_{k}$ and $b_{k}$, including $a_{0}.$ That is, compute

$\displaystyle{a_{0}=\frac{1}{2\pi}\int_{0}^{2\pi}f (t)\,dt,$

$\displaystyle{a_{k}=\frac{1}{\pi}\int_{0}^{2\pi}f( t)\,\cos(kt)\,dt,$ and

$\displaystyle{b_{k}=\frac{1}{\pi}\int_{0}^{2\pi}f( t)\,\sin(kt)\,dt.$

2. Write out the representation of the function as

$\displaystyle{f(t)=a_{0}+\sum_{k=1}^{\infty}\left[a_{k}\cos(kt)+b_{k}\sin(kt)\right]}.$

Note: the wiki has a slightly different account. Consult it to see how the factors work.

I've seen you do some good work on computing the coefficients, but I have not seen you do step 2 correctly yet.

11. Originally Posted by Ackbeet
You're confusing yourself, I think. Constructing a trigonometric Fourier series is a two-step process (depending on how you count steps):

1. Compute the coefficients $a_{k}$ and $b_{k}$, including $a_{0}.$ That is, compute

$\displaystyle{a_{0}=\frac{1}{2\pi}\int_{0}^{2\pi}f (t)\,dt,$

$\displaystyle{a_{k}=\frac{1}{\pi}\int_{0}^{2\pi}f( t)\,\cos(kt)\,dt,$ and

$\displaystyle{b_{k}=\frac{1}{\pi}\int_{0}^{2\pi}f( t)\,\sin(kt)\,dt.$
Are the limits always $[0,2\pi]$ ? I mean in the formulas for ${a_{0},a_{k}$ and $b_{k}$ .

I have to be honest that I am confused. The reason for that is everywhere I look the formulas for ${a_{0}$, $a_{k}$and $b_{k}$ are different.

For instance these two expressions are not the same to me:

(1) $\displaystyle{f(t)=\frac{a_{0}}{2}+\sum_{k=1}^{\in fty}a_{k}\cos(kt)+b_{k}\sin(kt)}$ $\displaystyle\neq$

(2) $\displaystyle\neq$ $\displaystyle{f(t)=a_{0}+\sum_{k=1}^{\infty}\left[a_{k}\cos(kt)+b_{k}\sin(kt)\right]}$
I noted also the expressions from wiki and when I apply these I should get the same result but I don't. For example:

$\displaystyle{c_{0}=\frac{1}{\pi}\int_{0}^{2\pi}f( t)\,dt={\frac{1}{\pi}(\int_{0}^{1}{\pi}dt+{\int_{2 \pi-1}^{2\pi}{\pi}dt)=2
$
Should I apply this result to (1)?

But when I computed the ${c_{0}$ above:

$\displaystyle{c_{0}=\frac{1}{2\pi}\int_{0}^{2\pi}f (t)\,dt}={\frac{1}{2\pi}(\int_{0}^{1}{\pi}dt+{\int _{2\pi-1}^{2\pi}{\pi}dt)=1$ should I apply (2) for this result?

Thank you

12. For a $2\pi$-periodic integrable function $f(t)$, you have

$\displaystyle{f(t)=\frac{1}{2\pi}\int_{P}f(x)\,dx+ \frac{1}{\pi}\sum_{k=1}^{\infty}\left[\left(\int_{P}f(x)\,\cos(kx)\,dx\right)\cos(kt)+\l eft(\int_{P}f(x)\,\sin(kx)\,dx\right)\sin(kt)\righ t].}$

Here the notation

$\displaystyle{\int_{P}}$

just means integrate over one period. The endpoints of the interval $[a,b]$ over which you integrate are unimportant, except that you must have $b-a=2\pi.$ Also, you'll notice that I've used a dummy variable for the integrations so as not to collide with the $t$ of $f(t).$

The stuff inside the parentheses are "essentially" the Fourier coefficients. Different authors put the $1/\pi$ in different places, depending on their preferences. So the key to remember is that those factors are there somehow, and that the cosine integrals get multiplied by the cosine terms, and the same for the sin integrals.

Does this clear things up a bit?

13. Originally Posted by Ackbeet

The endpoints of the interval $[a,b]$ over which you integrate are unimportant, except that you must have $b-a=2\pi.$
Is it the interval $[a,b]$ for the given function? In this case the function starts at 0 and finishes at $2\pi$. Or does $b-a=2\pi$ apply for each integral?

Does this clear things up a bit?
Yes, a bit Thank you.

14. In your case, simply choose a = 0, b = 2pi. You have a 2pi-periodic function. That means you can choose the 2pi-wide interval that you want to use. So pick the easiest one: [0,2pi]. All of the integrals in the big equation I wrote above must be 2pi-wide. That's the important thing: you capture one period in each interval. Nothing else matters. I would just pick the same interval for all three integrals: it's the easiest thing to do.

15. So the trigonometric Fourier series for the given function is:

$\displaystyle{f(t)=a_{0}+\sum_{k=1}^{\infty}\left[a_{k}\cos(kt)+b_{k}\sin(kt)\right]}\implies$

$\displaystyle\implies{f(t)=1+2 \sum_{k=1}^{\infty}\left\frac{sin(k)}{k}\cos(kt)}$

Your explanation made it much more clear and I can see that the different ways the authors write ${a_{0}, a_{k}$ and $b_{k}$ all relate to each other, thanks to your two last posts. Thank you very much.

Page 1 of 2 12 Last