Implicit Scheme
We could also have used a midpoint approximation for the first derivative, resulting in
ut≈u(xi,tj+Δt)−u(xi,tj−Δt)2Δt,
with a truncation error
O(Δt2).
Here we will stick to the backward formula and come back to the latter below.
For the second derivative we use however
uxx≈u(xi+Δx,tj)−2u(xi,tj)+u(xi−Δx,tj)Δx2,
and define again
α=Δt/Δx2.