Solution (source code)

= Solution

With $h=\Delta x$, $\tau=\Delta t$, $r=\tau/h^2$ and $c=\alpha\tau/h$, the <Forward Euler method> gives
$$
\boxed{u_m^{n+1}=(r-c/2)u_{m-1}^n+(1-2r)u_m^n+(r+c/2)u_{m+1}^n.}
$$
For a <Fourier mode> $e^{im\theta}$, the amplification factor is $G(\theta)=1-4r\sin^2(\theta/2)+ic\sin\theta$. Set $s=\sin^2(\theta/2)$. Then
$$
|G|^2-1=4s\{c^2-2r+(4r^2-c^2)s\}.
$$
The expression in braces is an <affine function> of $s$, so it is nonpositive for all $s\in[0,1]$ precisely when its two endpoint values are nonpositive. For $\tau>0$, these conditions are $c^2\leq2r$ and $r\leq1/2$. Thus <Forward Euler stability for centered advection-diffusion> requires exactly
$$
\boxed{\Delta t\leq\frac{(\Delta x)^2}{2},\qquad\alpha^2\Delta t\leq2.}
$$
For $\alpha=0$, only the first condition remains. If either bound fails, a band of <Fourier modes> has $|G|>1$, giving instability under <von Neumann stability analysis>. At equality the amplification bound still holds, so the endpoints are included. This is discrete <L2 norm> stability; nonnegative stencil weights would impose the additional spatial restriction $|\alpha|\Delta x\leq2$.