Fourier and half range series for $\sin x$

1. Expand in Fourier series of $f(x) = \sin x$ for $0<x<l$. Deduce the result $\frac1{1 \cdot 3} - \frac{1}{3\cdot5} +\frac{1}{5\cdot 7} - \cdots = \pi-\frac{2}{4}.$

2. Obtain half range sine series for $f(x)$ in $0<x<l$ and deduce the series $\sum\frac{1}{n^2} = \frac{{\pi^2}}6.$

-
Perhaps you should explain what you have tried already? –  copper.hat Jul 20 '12 at 19:01
I tried to fix the source and tags — whatever you typed wasn't displaying at all on my end, so I tried to put everything in LaTeX. Please check for errors. [It's a good idea to try to learn the rudiments of LaTeX for the purpose of asking questions here, by the way.] In particular, I couldn't tell what you were trying to write in that first series. It doesn't look right to me as it is. –  Dylan Moreland Jul 20 '12 at 19:02
Presumably, the term $\frac 1 {3\cdot 7}$ is meant to be $\frac 1 {5\cdot 7}$, or else I don't see the pattern to the series. –  Thomas Andrews Jul 20 '12 at 19:05
@ThomasAndrews Change made. –  Dylan Moreland Jul 20 '12 at 19:22
@ThomasAndrews I hv the same question as it is written....May be there is a printing mistake...Please can you provide me the steps of the solution taking 1/5.7 if you think its correct....and the steps for the second part too....please.... –  Naman Sindhi Jul 20 '12 at 20:08

$$f(x) = \left\{ \begin{array}{rcl} {-k} & \mbox {when} & -\pi \lt x \lt 0 \\ +k & \mbox{when} & 0 \lt x \lt \pi \end{array}\right.$$ and when $f(x+2\pi)=f(x)$.
To obtain the Fourier coefficients $a_n$ and $b_n$ you do the following integration $$a_n= \frac{1}{\pi}\int_{-\pi}^{+\pi}{k\cos(nx)dx}$$ and $$b_n= \frac{1}{\pi}\int_{-\pi}^{+\pi}{k\sin(nx)dx}$$ This will show that $a_n=0$ and $b_n=\frac{4k}{n\pi}$ when n is odd and $b_n=0$ when n is even. So $$f(x)=\frac{4k}{\pi}\left(\sin x + \frac{1}{3}\sin 3x+\frac{1}{5}\sin 5x+\dots\right)$$ Now we know $f(x)=+k$ when $0 \lt x \lt \pi$. So $f(\frac{\pi}{2})=+k$ and hence $$k=\frac{4k}{\pi}\left(\sin\frac{\pi}{2} + \frac{1}{3}\sin3\frac{\pi}{2}+\frac{1}{5}\sin5\frac{\pi}{2}+\dots\right)$$ $$\Rightarrow \frac{\pi}{4}=1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\dots$$ Now let $$\frac{1}{1 \cdot 3} - \frac{1}{3\cdot5} +\frac{1}{5\cdot 7} - \cdots = S_1.$$$$\Rightarrow S_1=\frac{1}{2}\left[\frac{3-1}{1 \cdot 3}- \frac{5-3}{3\cdot5} +\frac{7-5}{5\cdot 7} - \cdots\right]$$ $$\Rightarrow 2S_1=\left[1-2\cdot\frac{1}{3}+2\cdot\frac{1}{5}-2\cdot\frac{1}{7}- \cdots\right]$$$$\Rightarrow 2S_1=\left[1+2\left(\frac{\pi}{4}-1\right)\right]$$$$\Rightarrow S_1=\frac{\pi}{4}-\frac{1}{2}$$$$\Rightarrow \frac{1}{1 \cdot 3} - \frac{1}{3\cdot5} +\frac{1}{5\cdot 7} - \cdots=\frac{\pi}{4}-\frac{1}{2}$$ I think this is what you are looking for in the first part.