For an Undergrad. sophomore Math Methods class I am taking this session, we have recently covered Fourier series expansions. I made good progress in one of the exercises, but I was stuck for days on one particular problem, given below:
Given: Expand f(x) in a trig. fourier series where f(x)=$\sin(\pi x)$, and that is has a period (-l,l) where l=-1/2.
My Approach:
We require an expansion of the form $f(x)=\frac{a_0}{2}+\Sigma_{n=1}^\infty(a_n \cos(\frac{n\pi}{1/2})+b_n \sin(\frac{n\pi}{1/2}))$. Where the coefficients are given by: $$a_0=2\int_{-\frac{1}{2}}^{-\frac{1}{2}}f(x)dx, a_n=2\int_{-\frac{1}{2}}^{-\frac{1}{2}}f(x)\cos(2n\pi x)dx; b_n=2\int_{-\frac{1}{2}}^{-\frac{1}{2}}f(x)\sin(2n\pi x)dx$$
Now to evaluate Fourier coefficients:
a) $$a_0=2\int_{-\frac{1}{2}}^{\frac{1}{2}}\sin(\pi x)dx=\frac{2}{\pi}\cos(\pi x)]_{-1/2}^{1/2} =\frac{2}{\pi}[\cos(2\pi)-\cos(-2\pi)]=0$$, which makes sense as f(x)=$\sin(\pi x)=-f(-x)$ so it is an odd-function
b)$$a_n=2\int_{-\frac{1}{2}}^{\frac{1}{2}}\sin(\pi x)\cos(2n\pi x)dx=0$$; Here, we have an odd-function multiplied to an even function(f(x)=f(-x)) which makes the resultant an odd-function. Thus this integral evaluates to 0.
c)$b_n=2\int_{-\frac{1}{2}}^{\frac{1}{2}}\sin(\pi x)\sin(2n\pi x)dx$
=$4\int_0^{\frac{1}{2}}\sin(\pi x)\sin(2n\pi x)dx$; as we are evaluating an even function here. Then using the $\cos(A \pm B)$ identities we have:
$$b_n=2\int_{0}^{1/2}\cos[(2n-1)\pi x]-\cos[(2n+1)\pi x]dx=\frac{2\sin[(2n-1)\pi x]}{(2n-1)\pi}-\frac{2\sin[(2n+1)\pi x]}{(2n+1)\pi} \Bigg|_0^{1/2}$$
Now how do I proceed? I am not sure how to deal with the anti-derivatives here. Any help would be appreciated.
Your integration and everything is completely ok- So you just have to evaluate it for x=1/2 since for x=0 all terms are 0. You just have to take in account that if sin(2n-1)pi/2=1 than sin(2n+1)pi/2 =-1 and reverse just find out for what n it applies.