Heat equation with interval-indicator initial data (source code)

= Heat equation with interval-indicator initial data

For $u_t=Du_{xx}$ and $u(x,0)=\mathbf1_{[-a,a]}(x)$, convolution with the <heat kernel> gives
$$
u(x,t)=\frac12\left[
\operatorname{erf}\left(\frac{x+a}{2\sqrt{Dt}}\right)
-\operatorname{erf}\left(\frac{x-a}{2\sqrt{Dt}}\right)
\right].
$$