Solution (source code)

= Solution

Take the <inner product> of the <Fourier series> with $\sin(n\pi x/L)$. <Fourier orthogonality> eliminates the constant, all cosine terms, and all sine terms except the $n$th. The remaining squared <norm> is
$$
\int_{-L}^{L}\sin^2(n\pi x/L)\,dx=L,
$$
so
$$
\boxed{b_n=\frac1L\int_{-L}^{L}f(x)\sin(n\pi x/L)\,dx,\qquad n\geq1}.
$$
For a <square-integrable function>, the calculation is justified by taking <inner products> of finite <Fourier partial sums> and passing to their <convergence in L2>[mean-square limit].