Answer check for a couple fourier series problems

In summary, the conversation discussed two problems, one involving a 2\pi periodic function and the other using sine expansion. The first problem was solved using cosine expansion, while the second one required the use of trigonometric identities. The individual discussing the problems had some confusion with the second exercise, but it was resolved by realizing that if the coefficient inside the cosine function is 0, the integral would be x instead of sine.
  • #1
jianxu
94
0

Homework Statement


hello, so I've got a couple of problems I need someone to kind of check over because on one of them, I'm not sure if it's correct, and then the other looks to be incorrect.

For problem 1, we have a 2[tex]\pi[/tex] periodic function where f(x) = xsin(x)

For the second problem, I need to use sine expansion on f(x) = (1+cos([tex]\pi[/tex]x))*sin([tex]\pi[/tex]x)


Homework Equations


cosine expansion = [tex]\left.a_{0}+\sum^{\infty}_{k=1}a_{k}cos(\frac{kx\pi}{p})[/tex]
sine expansion =[tex]\left.\sum^{\infty}_{k=1}b_{k}sin(\frac{kx\pi}{p})[/tex]

trig identities:
[tex]\left.2cos(a)sin(b)= sin(a+b) - sin(a-b)[/tex]
[tex]\left.2sin(a)sin(b)= cos(a-b) - cos(a+b)[/tex]

The Attempt at a Solution



For [tex]\left.f(x) = xsin(x)[/tex]:
It's an even function so I can use cosine expansion,
so [tex]a_{0}[/tex] would be:
[tex]\left.a_{0}=\frac{1}{\pi}\int^{\pi}_{0}xsin(x)[/tex]
doing integration by parts I get
-xcosx+sinx
after evaluating I get
[tex]\left.a_{0}=-1[/tex]

Now for [tex]\left.a_{k}[/tex]:
[tex]\left.a_{k}=\frac{2}{\pi}\int^{\pi}_{0}xsin(x)cos(kx)[/tex]

using trig identities for sin(x)cos(kx),
2sin(x)cos(kx)=(sin(kx+x)-sin(kx-x))

So now the integral becomes:
[tex]\left.a_{k}=\frac{1}{\pi}\int^{\pi}_{0}xsin((k+1)x)-xsin((k-1)x)[/tex]

after the integration by parts I have:

[tex]\left.a_{k}=\frac{1}{\pi}(\frac{-xcos((k+1)x)}{k+1}+\frac{xcos((k-1)x)}{k-1}+\frac{sin((k+1)x)}{\left(k+1\right)^{2}}-\frac{sin((k-1)x)}{\left(k-1\right)^{2}})\right|^{\pi}_{0}[/tex]

now when I evaluate it, the sin terms will be zero and the only terms I get are these two:
[tex]\left.\frac{-xcos((k+1)x)}{k+1}+\frac{xcos((k-1)x)}{k-1}[/tex] when evaluated at [tex]\pi[/tex]
now I simplified it by simply saying the cos will alternate between 1 and -1 depending on k and so I had the two terms reduced to:
[tex]\left.\frac{-1^{k}\pi}{k+1}+\frac{-1^{k+1}\pi}{k-1}[/tex]

so [tex]\left.a_{k}=\frac{1}{\pi} * \left(\frac{-1^{k}\pi}{k+1}+\frac{-1^{k+1}\pi}{k-1}\right)[/tex]

so my Fourier series will be:
[tex]\left.-1+\sum^{\infty}_{k=1}(\frac{-1^{k}}{k+1}+\frac{-1^{k+1}}{k-1})cos(\frac{kx\pi}{p})[/tex]

Please let me know if this looks correct Thanks!

For the second one, I first simplified f(x) by saying:
[tex]\left.\left(1+cos\left(\pi *x\right)\right)sin\left(\pi*x)= sin(\pi * x)+ cos(\pi*x)sin(\pi*x)[/tex]

so for the [tex]b_{k}[/tex]:
[tex]\left.b_{k}= 2\int^{1}_{0}\left(sin(\pi * x)+ cos(\pi*x)sin(\pi*x)\right)*sin\left(\pi * x\right)dx[/tex]
I split the integral up so:
[tex]\left.b_{k}= 2\int^{1}_{0}sin\left(\pi * x\right)*sin\left(\pi * kx\right)dx + 2\int^{1}_{0}cos\left(\pi*x\right)sin\left(\pi*x\right)*sin\left(\pi * kx\right)dx[/tex]

So I use a couple of trig identities where
[tex]\left.2sin\left(\pi *x\right)sin\left(\pi *kx\right)= cos\left((k-1)\pi *x\right)-cos\left((k+1)\pi *x\right)[/tex]

and
[tex]\left.2cos(\pi* x)sin(\pi *x) = sin(2 \pi *x)[/tex]
then:
[tex]\left.2sin(2 \pi *x)sin(k \pi *x) = cos((k-2)\pi *x) - cos((k+2) \pi *x)[/tex]

so now our [tex]b_{k}[/tex] becomes:
[tex]\left.b_{k}= 2\int^{1}_{0}cos\left((k-1)\pi *x\right)-cos\left((k+1)\pi *x\right)dx + \frac{1}{2}\int^{1}_{0}cos((k-2)\pi *x) - cos((k+2) \pi *x)dx[/tex]

so lastly I do all the integration and got:
[tex]\left.\left(\frac{sin((k-1) \pi *x)}{(k-1)\pi}-\frac{sin((k+1)\pi *x)}{(k+1)\pi}+\frac{1}{2}\left(\frac{sin((k-2) \pi *x)}{(k-2)\pi}-\frac{sin((k+2)\pi *x)}{(k+2)\pi}\right)\right)\right|^{1}_{0}[/tex]

So here's my problem with this second exercise, all the terms goto zero since they have [tex]\pi[/tex] terms and so I'm confused(maybe I did my integrations wrong, or trig identities wrong).

Thanks to whoever decideds to help and read this long post!
 
Last edited:
Physics news on Phys.org
  • #2
Hi jianxu! :smile:
jianxu said:
so lastly I do all the integration and got:
[tex]\left.\left(\frac{sin((k-1) \pi *x)}{(k-1)\pi}-\frac{sin((k+1)\pi *x)}{(k+1)\pi}+\frac{1}{2}\left(\frac{sin((k-2) \pi *x)}{(k-2)\pi}-\frac{sin((k+2)\pi *x)}{(k+2)\pi}\right)\right)\right|^{1}_{0}[/tex]

So here's my problem with this second exercise, all the terms goto zero since they have [tex]\pi[/tex] terms and so I'm confused(maybe I did my integrations wrong, or trig identities wrong).

Thanks to whoever decideds to help and read this long post!

Yeah :rolleyes: … no way am i reading all that! :redface:

I've read the bit above, and I think what you're missing is that if the coefficient inside the cos is 0, then the integral isn't sin, it's x …

does that fix it? :smile:
 
  • #3
are you referring to the first term where I have k-1? I guess I can assume that for the first term when k =1, then cos will be zero but...I had the impression this is suppose to be as general as possible?

so am i suppose to say only the first 2 terms will give me nonzero items while the rest will just be zero? Thanks
 
Last edited:

What is a Fourier series?

A Fourier series is a way to represent a periodic function as a sum of sine and cosine functions. It is often used in mathematics and physics to analyze and understand periodic phenomena.

How is a Fourier series calculated?

A Fourier series is calculated using the Fourier coefficients, which are determined by integrating the function over one period. These coefficients are then used to construct the Fourier series, which is an infinite sum of sine and cosine functions.

Why is a Fourier series useful?

A Fourier series is useful because it allows us to approximate complicated periodic functions with simpler trigonometric functions. This makes it easier to analyze and understand the behavior of these functions.

What is the difference between a Fourier series and a Fourier transform?

A Fourier series is used for periodic functions, while a Fourier transform is used for non-periodic functions. A Fourier transform also gives a continuous spectrum of frequencies, while a Fourier series only has discrete frequencies.

Can a Fourier series accurately represent any function?

No, a Fourier series can only accurately represent a function if it is periodic. Non-periodic functions cannot be fully represented by a Fourier series, but they can be approximated by using a Fourier transform.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
212
  • Calculus and Beyond Homework Help
Replies
1
Views
340
  • Calculus and Beyond Homework Help
Replies
3
Views
343
  • Calculus and Beyond Homework Help
Replies
3
Views
413
  • Calculus and Beyond Homework Help
Replies
1
Views
534
  • Calculus and Beyond Homework Help
Replies
5
Views
353
  • Calculus and Beyond Homework Help
Replies
2
Views
913
  • Calculus and Beyond Homework Help
Replies
16
Views
559
  • Calculus and Beyond Homework Help
Replies
8
Views
230
  • Calculus and Beyond Homework Help
Replies
3
Views
280
Back
Top