Fourier sine series of a squared sine (source code)

= Fourier sine series of a squared sine
{c}
{title2=$\sin^2(\pi x/L)=\frac8\pi\sum_{m\geq0}\frac{\sin((2m+1)\pi x/L)}{(2m+1)[4-(2m+1)^2]}$}

On $0\leq x\leq L$, the <Fourier sine series> of $\sin^2(\pi x/L)$ has zero even-index coefficients and odd-index coefficients $b_n=8/[\pi n(4-n^2)]$. Substitute $u=\pi x/L$ in the coefficient integral and use $\sin^2u\sin(nu)=\tfrac12\sin(nu)-\tfrac14\sin((n+2)u)-\tfrac14\sin((n-2)u)$. For odd $n$, integrating gives $b_n=(2/\pi)[1/n-\tfrac12(1/(n+2)+1/(n-2))]$; reflection about the midpoint makes the even coefficients zero. The $O(n^{-3})$ decay gives absolute and uniform convergence, and <Fourier orthogonality> identifies the sum. In the <heat equation> with zero endpoint temperatures, multiply each coefficient by $\exp[-\kappa(n\pi/L)^2t]$. With insulated endpoints, the same initial profile is instead just the constant and second cosine modes of a <Fourier cosine series>.