Answer check for a couple fourier series problems

Click For Summary
SUMMARY

This discussion focuses on verifying solutions for two Fourier series problems involving the functions f(x) = xsin(x) and f(x) = (1 + cos(πx))sin(πx). The first problem utilizes cosine expansion, yielding a0 = -1 and ak coefficients derived through integration by parts and trigonometric identities. The second problem, which involves sine expansion, leads to confusion regarding the evaluation of integrals, particularly when terms vanish due to π factors. The participants clarify that only specific terms contribute non-zero values, emphasizing the importance of correctly identifying conditions under which coefficients are non-zero.

PREREQUISITES
  • Understanding of Fourier series, specifically sine and cosine expansions.
  • Proficiency in integration techniques, including integration by parts.
  • Familiarity with trigonometric identities relevant to Fourier analysis.
  • Knowledge of periodic functions and their properties.
NEXT STEPS
  • Study the derivation of Fourier coefficients for various periodic functions.
  • Learn advanced integration techniques, particularly integration by parts in the context of Fourier series.
  • Explore the application of trigonometric identities in simplifying Fourier series calculations.
  • Investigate common pitfalls in evaluating integrals involving periodic functions and their coefficients.
USEFUL FOR

Students and educators in mathematics, particularly those focusing on Fourier analysis, as well as anyone seeking to enhance their understanding of series expansions and integration techniques in applied mathematics.

jianxu
Messages
91
Reaction score
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\pi periodic function where f(x) = xsin(x)

For the second problem, I need to use sine expansion on f(x) = (1+cos(\pix))*sin(\pix)


Homework Equations


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

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

The Attempt at a Solution



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

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

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

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

after the integration by parts I have:

\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}

now when I evaluate it, the sin terms will be zero and the only terms I get are these two:
\left.\frac{-xcos((k+1)x)}{k+1}+\frac{xcos((k-1)x)}{k-1} when evaluated at \pi
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:
\left.\frac{-1^{k}\pi}{k+1}+\frac{-1^{k+1}\pi}{k-1}

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

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

Please let me know if this looks correct Thanks!

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

so for the b_{k}:
\left.b_{k}= 2\int^{1}_{0}\left(sin(\pi * x)+ cos(\pi*x)sin(\pi*x)\right)*sin\left(\pi * x\right)dx
I split the integral up so:
\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

So I use a couple of trig identities where
\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)

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

so now our b_{k} becomes:
\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

so lastly I do all the integration and got:
\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}

So here's my problem with this second exercise, all the terms goto zero since they have \pi 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
Hi jianxu! :smile:
jianxu said:
so lastly I do all the integration and got:
\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}

So here's my problem with this second exercise, all the terms goto zero since they have \pi 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:
 
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:

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K