- #1
RUrubee2
- 5
- 0
Homework Statement
To find the Fourier series for
f(x)=
0, -2<x<0
x, 0≤x<1
1, 1≤x<2
Homework Equations
f(x)=a_0/2+Ʃ(from n=0 to ∞) (a_n*cos(npix/p) + b_n*sin(npix/p))
The Attempt at a Solution
So p=2, interval=[-2,2]
a_0=3/4,
a_n=(2/n^2pi^2)*(cos(npi/2)-1),
Here is my problem:
did the exercise twice and keep getting:
b_n=(2/n^2pi^2)(sin(npi/2)+(npi/2)*(1-cos(npi))
I have the solution:
b_n=(2/n^2pi^2)(sin(npi/2)+(npi/2)*(-1)^(n+1))
I know cos(npi)=(-1)^n
and I've been told sin(npi)=(-1)^(n+1)
My steps:
1) b_n=1/2[∫(from 0 to 1) x*sin(npix/2)dx + ∫(from 1 to 2) sin(npix/2)dx]
2) integration by parts for 1st integral and subsequent integration:
→ b_n=1/2[-(2x/npi)cos(npix/2)|(0 to 1) + (4/n^2pi^2)sin(npix/2)|(0 to 1) - (2/npi)cos(npix/2)|(1 to 2)]
3) I am left with:
b_n=1/2[(2/npi) + (4/n^2pi^2)sin(npi/2) - (2/npi)cos(npi)
after regrouping is where (1-cos(npi)) comes from.
Thus original question is:
Can (1-cosnpi)=(-1)^(n+1)? or am I mistaken somewhere?
Thank you
Last edited: