Fourier series

willmoore21

Junior Member
Joined
Jan 26, 2012
Messages
75
One of my tuturial questions at university was:

Write down the first four non-zero terms of the Fourier series for the function xcosx in the range -pi<x<pi.

I have tried to do this have found a0 to be 0, but am stuck with an and bn.

Is this a half range series? Or complex? I have tried the normal method but just get messed up.

Thanks in advance for any replies.

William Moore
 
One of my tuturial questions at university was:

Write down the first four non-zero terms of the Fourier series for the function xcosx in the range -pi<x<pi.

I have tried to do this have found a0 to be 0, but am stuck with an and bn.

Is this a half range series? Or complex? I have tried the normal method but just get messed up.

Thanks in advance for any replies.

William Moore

First decide whether the given function is an odd function or an even function or neither.
 
Thankyou for your reply,

I am pretty sure it is neither, cos(x) is odd but xcos(x) could be either right?

William Moore
 
Fourier Series

Ok, so I'm wrong in the last post, it's obviously odd I was just having a mind block.

Because it is odd I am using the half-range sine series in (0,pi).

Now I am integrating just (2/pi)*x*cos(x)*sin(nx) over 0,pi.

I can't do this by hand so I have used Wolfram, however, there is cosines in the answer, and I thought for a sine series there were only supposed to be cosines in the answer.

Thanks

William Moore
 
Yes, it is an odd function.

So, we have \(\displaystyle \displaystyle\sum_{n=1}^{\infty}b_{n}sin(nx)\)

So, \(\displaystyle \displaystyle b_{n}=\frac{2}{\pi}\int_{0}^{\pi}xcos(x)sin(nx)dx\)

\(\displaystyle =\displaystyle\frac{2\left(\pi n(n-1)(n+1)cos(n\pi)-(n^{2}+1)sin(n\pi)\right)}{{\pi}(n-1)^{2}(n+1)^{2}}\)

But, for integer n:
\(\displaystyle sin(n\pi)=0, \;\ cos(n \pi)=(-1)^{n}\)

So, this whittles down to:

\(\displaystyle b_{n}=\frac{2n(-1)^{n}}{n^{2}-1}\)

Then, we get:

\(\displaystyle f(x)=\displaystyle\sum_{n=1}^{\infty}\frac{2n(-1)^{n}}{n^{2}-1}sin(nx)\)

Now, find the first four terms using values of n. Be careful of n=1.
 
Yes, it is an odd function.

So, we have \(\displaystyle \displaystyle\sum_{n=1}^{\infty}b_{n}sin(nx)\)

So, \(\displaystyle \displaystyle b_{n}=\frac{2}{\pi}\int_{0}^{\pi}xcos(x)sin(nx)dx\)

\(\displaystyle =\displaystyle\frac{2\left(\pi n(n-1)(n+1)cos(n\pi)-(n^{2}+1)sin(n\pi)\right)}{{\pi}(n-1)^{2}(n+1)^{2}}\)

But, for integer n:
\(\displaystyle sin(n\pi)=0, \;\ cos(n \pi)=(-1)^{n}\)

So, this whittles down to:

\(\displaystyle b_{n}=\frac{2n(-1)^{n}}{n^{2}-1}\)

Then, we get:

\(\displaystyle f(x)=\displaystyle\sum_{n=1}^{\infty}\frac{2n(-1)^{n}}{n^{2}-1}sin(nx)\)

Now, find the first four terms using values of n. Be careful of n=1.

I had something very similar, my cancelling was a bit off as I thought I could cancel further.

Thankyou for your reply, very easy to understand your post.
 
Top