Solution (source code)

= Solution

Write $h=\Delta x$, $k=\Delta t=\mu h$, and $D_0u=[u(x+h)-u(x-h)]/(2h)$. The scheme is the trapezoidal time rule with a centered spatial <derivative>:
$$
u^{n+1}-u^n=\tfrac k2(D_0u^{n+1}+D_0u^n).
$$
Insert a smooth exact solution of $u_t=u_x$. Taylor expansion of the unnormalized one-step residual gives
$$
\begin{aligned}u(t+k)-u(t)&=ku_t+\tfrac12k^2u_{tt}+\tfrac16k^3u_{ttt}+O(h^4),\\\tfrac k2(D_0u(t+k)+D_0u(t))&=ku_x+\tfrac12k^2u_{xt}+\tfrac14k^3u_{xtt}+\tfrac16kh^2u_{xxx}+O(h^4).
\end{aligned}
$$
All repeated time <derivatives> equal the corresponding spatial <derivatives>. The first two orders cancel, leaving
$$
\boxed{R=-\left(\frac{k^3}{12}+\frac{kh^2}{6}\right)u_{xxx}+O(h^4)=-\frac{\mu(\mu^2+2)}{12}h^3u_{xxx}+O(h^4).}
$$
Thus the one-step local error is $O(h^3)$ at fixed <Courant number>. If “<local truncation error>” is instead defined after division of the residual by $\Delta t$, its order is $O(h^2)$; these are two different normalizations of the same second-order method.