# Showing that the Crank-Nicolson method is second order

For the diffusion equation $\dfrac{\partial \rho}{\partial t} = D\,\Delta \rho$, I'm trying to show that Crank-Nicolson is second order. I've isolated the truncation error $\tau_i^{n+1}$ to be $D\left(\frac{\rho(x_{i+1}, t_{n+1}) + \rho(x_{i-1}, t_{n+1}) - 2\rho(x_i, t_{n+1})}{2(\Delta x)^2} + \frac{\rho(x_{i+1}, t_n) + \rho(x_{i-1}, t_n) - 2\rho(x_i, t_n)}{2(\Delta x)^2}\right)$, but I'm having trouble actually showing that it's $O((\Delta t)^2 + O((\Delta x)^2)$.

How should I proceed? A simple hint (ie how to to the Taylor Series) would be just fine!

Thank you!

• is $D$ the derivative or just a scalar? – Ellya May 6 '14 at 20:18
• Hint: try to develop each of the first long fraction near the point $(x_i,t_{n+1})$ and the second near $(x_i,t_n)$ up to fourth degree. – TZakrevskiy May 6 '14 at 20:20

$f(x,y)=f(a,b)+\sum_{1\le r+s\le n}\frac{\partial^{r+s}f(a,b)}{\partial x^r\partial y^s}\frac{(x-a)^r}{r!}\frac{(y-b)^s}{s!}+E_n(x,y)$
Where the error term $E_n(x,y)=\sum_{r+s=n+1}\frac{\partial^{r+s}f(\xi,\eta)}{\partial x^r\partial y^s}\frac{(x-a)^r}{r!}\frac{(y-b)^s}{s!}$
Where $(\xi,\eta)$ is some value on the line between the points $(a,b)$ and $(x,y)$.
And as the commenter pointed out you will probably need a fourth order approximation to cancel with the $(\Delta x)^2$ on the bottom of the fraction.