Solution (source code)

= Solution

The <leapfrog finite-difference scheme for the diffusion equation> uses centered time and space differences:
$$
\frac{u_j^{n+1}-u_j^{n-1}}{2\Delta t}=\frac{u_{j-1}^n-2u_j^n+u_{j+1}^n}{(\Delta x)^2}.
$$
A <Fourier mode> with amplification factor $z$ gives
$$
z^2+8\mu\sin^2(\theta/2)z-1=0.
$$
Writing $b=4\mu\sin^2(\theta/2)$, the roots are $z_\pm=-b\pm\sqrt{1+b^2}$. For any $\mu>0$ and any nonzero spatial frequency, $b>0$ and
$$
|z_-|=b+\sqrt{1+b^2}>1.
$$
Thus
$$
\boxed{\text{leapfrog is unstable for the heat equation for every }\mu>0.}
$$
Although the other root decays, the growing parasitic root is excited by generic starting data or perturbations, so it cannot be discarded in a stability test.