Fourier series of a periodic odd function Given $\ f(\theta)=\theta(\pi-\theta)$ is a $2\pi$-periodic odd function on $[0,\pi]$. Compute the Fourier coefficients of $f$, and show that $\ f(\theta)=\frac{8}{\pi} \sum_{\text{$k$ odd} \ \geq 1} \frac{\sin{k\theta}}{k^3}$.
My progress: By applying the formula to calculate the n-th Fourier coefficient, we have:
If $n\neq 0$, $\ \hat{f}(n)= \frac{1}{\pi}\int_{0}^{\pi} \theta(\pi-\theta)e^{-2in\theta}d\theta = \int_{0}^{\pi} \theta\ e^{-2in\theta}d\theta -\frac{1}{\pi}\int_{0}^{\pi} \theta^{2}e^{-2in\theta}d\theta$
Now, using integration by parts, together with the fact that $\ e^{-2in\pi}=1$, I ended up with the first integral $= -\frac{\pi}{2in}$, while the 2nd term (so including the term $\frac{-1}{\pi}$) = $\frac{-1}{2n^2} + \frac{\pi}{2in}$.  
For $n=0$, I got $\hat{f}(0)= \frac{\pi^2}{6}$. Combining these results, I don't understand how can $\ f(\theta) = \text{the RHS}$ as we are asked to show:P Can anyone please help me with this problem?
2nd progress: I tried calculating the integral above where the exponential in the integrand is $e^{-in\theta}$ (so, 2 is deleted). And I obtained $\ \hat{f}(n)=\frac{-e^{-in\pi}}{n^2}-\frac{1}{n^2}-\frac{2e^{-in\pi}}{n^3i\pi} + \frac{2}{n^3i\pi}$ = $\frac{(-1)^{n+1}}{n^2}-\frac{1}{n^2}-\frac{2(-1)^{n}}{n^3i\pi}+\frac{2}{n^3i\pi}.$ Still can't get the RHS(!?)
3rd progress: Finally, I was able to obtain the RHS!! But I am not quite satisfied with my solution, because I have to "borrow" a result which states that if $f$ is a $2\pi$-periodic odd function, then $\ f(\theta) = 2i\ \hat{f}(n)sin(nx)$ for every ODD $n$, and using the final result in 2nd progress, I finally got the RHS! I really want to see a solution using a purely algebraic manipulation, starting from my result for $\ \hat{f}(n)$ in 2nd progress, without using any sorts of extra result like I did.
 A: The Fourier sine coefficients should be given by a formula of the form $b_n = \frac{2}{\pi}\,\int_0^{\pi} \, \theta(\pi - \theta)\, \sin (n\theta) \, d\theta = \frac{8}{\pi\,n^3}$ for $n$ odd (and $0$ for $n$ even). The stated formula now follows.
The factor of $2$ comes from the fact that we have an odd extension of $f$ to $[-\pi,\pi]$ so that the integrand becomes even thereby doubling the usual integral over $[0,\pi]$.
A: (We replace $\theta$ throughout by $x$.) Let's look at the full Fourier series of $f(x) = x(\pi-x)$ on $[-\pi,\pi]$ first, where $f$ is defined outside of this interval by periodicity, i.e., $f$ is of period $2\pi$ outside $[-\pi,\pi]$.  In this case $\displaystyle a_0 = \frac{1}{\pi}\,\int_{-\pi}^{\pi}\,x(\pi-x)\, dx = -\frac{2\pi^2}{3},$ where the first term (constant term) of the FS is given by $\displaystyle \frac{a_0}{2} = -\frac{\pi^2}{3}$.
Next the cosine terms are given by $\displaystyle a_n = \frac{1}{\pi}\,\int_{-\pi}^{\pi}\,x(\pi-x)\,\cos (nx)\, dx = \frac{4\,(-1)^{1+n}}{n^2} .$ Similarly, the Fourier sine coefficients are given by  $\displaystyle b_n = \frac{1}{\pi}\,\int_{-\pi}^{\pi}\,x(\pi-x)\,\sin (nx)\, dx =  \frac{2\pi (-1)^{n+1}}{n}.$ Hence the full FS of $f$ defined above is
$$f(x) \sim -\frac{\pi^2}{3} + \sum_{n=1}^\infty \left (\frac{4\,(-1)^{1+n}}{n^2}\,\cos(nx) + \frac{2\pi (-1)^{n+1}}{n}\,\sin (nx)\right),$$ for $x \in (-\pi,\pi)$ with ordinary convergence at all points of continuity. Thus, for example, setting $x=\pi/2$ we get the neat result $\displaystyle \sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^2} = \frac{\pi^2}{12}.$ So, this must be the correct representation.
Now for half-range expansions. In this case we are given $f(x)$ on only  {\it half the range}, i.e., $[0,\pi]$ here (instead of $[-\pi,\pi]$). But we are also told that it is $2\pi$-periodic. So the natural way to extend this function $f$ defined on $[0,\pi]$ to a periodic function of period $2\pi$ is to extend it to the left of $x=0$ by making either an even function (so you get only a cosine series) or an odd function (so you get only a sine series). To make $f$ into an even (resp. odd) function on $[-\pi,\pi]$ you redefine it by setting $f(x) = f(-x)$ (resp. $f(x) = - f(-x)$) for any $x \in [-\pi,0]$. In this case the Fourier coefficients are given by either
$\displaystyle b_n = \frac{2}{\pi}\int_0^\pi x(\pi-x) \sin(nx)\, dx $ which is the original required expression for a pure sine series, and 
$\displaystyle a_n = \frac{2}{\pi}\int_0^\pi x(\pi-x) \cos(nx)\, dx = -\frac{2}{n^2}(1+(-1)^n)$ with $\displaystyle a_0 = \frac{2}{\pi}\int_0^\pi x(\pi-x) \, dx = \frac{\pi^2}{6}$ for a pure cosine representation each series converging on $[0,\pi]$.
A: It's implicit that the period is $P$ as you can gather from the partial sums of the FS (read line 2 under "Definition"). 
The important thing here is that the Fourier coefficients are always defined by integrating over a symmetric interval of length $P$, the period of $f$. Here you are looking for a so-called "half range expansion", so you need to extend the function to $[-\pi,0]$ by making it an odd function (or else the expansion you seek will not be possible). So, basically, generally speaking, the $b_n$ are given by $\displaystyle \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\,\sin (nx)\, dx$ where $f(x)$ is defined on $[-\pi,0]$ by a central reflection (so it becomes odd on $[-\pi,\pi]$). Since the product of two odd functions is even you get the factor of $2$ above over the half-range $[0,\pi]$.
The wiki entry should be updated.
