Solution (source code)

= Solution

The normalized Dirichlet <eigenfunctions> on $(-L,L)$ and their decay rates are
$$
\varphi_n(x)=\frac1{\sqrt L}\sin\frac{n\pi(x+L)}{2L},\qquad
E_n=D\left(\frac{n\pi}{2L}\right)^2,\quad n=1,2,\ldots.
$$
Their norms are one because the sine-squared integral is $L$. At the initial <position> zero, $\varphi_n(0)=L^{-1/2}\sin(n\pi/2)$, so all even $n$ disappear. For $n=2j+1$, the two signs from $\varphi_n(x)$ and $\varphi_n(0)$ cancel, yielding
$$
\boxed{K_{|x|<L}(x,t|0,0)=\frac{\Theta(t)}L
\sum_{j=0}^{\infty}
\cos\frac{(2j+1)\pi x}{2L}
\exp\!\left[-\frac{(2j+1)^2\pi^2Dt}{4L^2}\right].}
$$
This holds for $|x|<L$ and is zero outside. The kernel is even in $x$, vanishes at both boundaries and tends weakly to the initial delta. The <eigenvalues> are decay rates rather than quantum energies unless one makes an additional unit convention.