I am computing the Fourier series of
$$f(x)=\sin\frac{\pi x}{L}.$$
The Fourier series of a piecewise smooth function $f(x)$ defined on the interval $-L\leq x\leq L$ is given by
$$f(x)\sim a_0+\sum_{n=1}^{\infty}a_n\cos\frac{n\pi x}{L}+\sum_{n=1}^{\infty}b_n\sin\frac{n\pi x}{L},$$
where
$$\begin{align} a_0&=\frac{1}{2L}\int_{-L}^{L}f(x)\,dx,\\ a_n&=\frac{1}{L}\int_{-L}^{L}f(x)\cos\frac{n\pi x}{L}\,dx,\\ b_n&=\frac{1}{L}\int_{-L}^{L}f(x)\sin\frac{n\pi x}{L}\,dx.\\ \end{align}$$
Since $f$ is an odd function, we have that both $a_0$ and $a_n$ are equal to zero. However, $b_n$ is the integral of an even function. Hence
$$ b_n=\frac{2}{L}\int_{0}^{L}f(x)\sin\frac{n\pi x}{L}\,dx.\tag{1} $$
But it turns out that $(1)$ is equal to zero, because
$$ b_n=\frac{2L\sin(n\pi)}{\pi(1-n^2)}=0,\qquad n\in\mathbb{N}. $$
On the other hand, my book claims that $b_n=1$. Why is this so?