Solution (source code)

= Solution

A <Fourier sine series> automatically meets the zero-temperature <boundary conditions> because $\sin0=\sin(n\pi)=0$. Equivalently, extend $\Theta_0$ oddly from $(0,L)$ to $(-L,L)$ and then periodically with period $2L$. Its <Fourier series> has only sine terms, with
$$
\boxed{k_n=\frac{n\pi}{L},\qquad b_n=\frac2L\int_0^L\Theta_0(x)\sin\!\left(\frac{n\pi x}{L}\right)dx\quad(n\geq1)}.
$$
The coefficient formula follows from the <orthogonality> identity
$$
\int_0^L\sin(k_nx)\sin(k_mx)\,dx=\frac L2\delta_{nm}.
$$
For piecewise smooth initial data the series equals $\Theta_0$ at interior continuity points and the average of its one-sided values at interior jumps. More general square-integrable data have convergence in <L2 norm convergence>. A classical solution continuous at the initial corners additionally requires $\Theta_0(0)=\Theta_0(L)=0$, in agreement with the prescribed <boundary conditions>.