Question on the solution to obtaining the truncation error for the Crank-Nicolson finite-difference scheme

801 Views Asked by At

I'm working on an exercise in a textbook that asks to derive the local truncation error for the Crank-Nicolson finite-difference scheme at the point $(ih, jk)$ for the partial differential equation $\frac{\partial U}{\partial t} = \frac{\partial^{2}U}{\partial x^{2}}$. The text provides the solution, though one of outlined steps confuses me.

The solution begins by defining the truncation error for the particular scheme as: $$T_{i,j}= \frac{1}{k}(U_{i,j+1} - U_{i,j}) - \frac{1}{2h^2}(\delta^2_{x}U_{i,j+1}+\delta^2_{x}U_{i,j})$$

It omits some details for the subsequent parts, but what I assume the text does is it proceeds to rewrite the term $\delta^2_{x}U_{i,j}$ as $U_{i-1,j}-2U_{i,j}+U_{i+1,j}$. It then obviously performs a Taylor's series expansion for $U_{i-1,j}$ and $U_{i+1,j}$ and simplifies the expression, yielding:

$$\delta^2_{x}U_{i,j}=h^2 \frac{\partial^2 U}{ \partial x^2}+\frac{h^4}{12} \frac{\partial ^4U}{\partial x^4}+O(h^6)$$

My confusion stems for the following portion of the provided solution where the text does not rewrite the $\delta^2_{x}U_{i,j+1}$ as $U_{i-1,j+1}-2U_{i,j+1}+U_{i+1,j+1}$ and then uses the Taylor's expansion on the appropriate terms once again. It instead just uses Taylor's series on $\delta^2_{x}U_{i,j+1}$ without rewriting it at all, obtaining:

$$\delta^2_{x}U_{i,j+1}=\delta^2_{x}U_{i,j}+ k \frac{\partial}{\partial t}\delta^2_{x} U_{i,j}+O(k^2)$$

I'm unsure why it is that the $\delta^2_{x}U_{i,j+1}$ wasn't first re-written and then had Taylor's series applied as in the case with the $\delta^2_{x}U_{i,j}$ term.