I wanna know what is the difference between explicit Euler's method and implicit Euler's method. And is the local truncation error for both of them is $O(h)$ and the coefficient of the $O(h)$ term is $h/2$?
[Math] Implicit Euler method and explicit Euler method
euler-mascheroni-constantnumerical methodsrunge-kutta-methods
Best Answer
The error of both explicit and implicit Euler are $O(h)$. So
$$f(x-h) = f(x) - h f'(x) + \frac{h^2}{2} f''(x) - \frac{h^3}{6} f'''(x) + \cdots$$
and
$$f(x+h) = f(x) + h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots$$
So the backward Euler is
$$f(x) - f(x-h) = h f'(x) - \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) - \cdots$$
$$f'(x) = \frac{f(x) - f(x-h)}{h} + \frac{h}{2} f''(x) - \frac{h^2}{6} f'''(x) + \cdots$$
the backward Euler is first order accurate
$$f'(x) = \frac{f(x) - f(x-h)}{h} + O(h)$$
And the forward Euler is
$$f(x+h) - f(x) = h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots$$
the forward Euler is first order accurate
$$f'(x) = \frac{f(x+h) - f(x)}{h} + O(h)$$
We can do a central difference and find
$$f(x+h) - f(x-h) = (h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots) - (- h f'(x) + \frac{h^2}{2} f''(x) - \frac{h^3}{6} f'''(x) + \cdots)$$
$$f(x+h) - f(x-h) = (h f'(x) + \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) + \cdots) + (h f'(x) - \frac{h^2}{2} f''(x) + \frac{h^3}{6} f'''(x) - \cdots)$$
$$f(x+h) - f(x-h) = 2 h f'(x) + \frac{h^3}{6} f'''(x) + \cdots$$
$$f'(x) = \frac{f(x+h) - f(x-h)}{2h} - \frac{h^2}{12} f'''(x) + \cdots$$
Therefore, the central difference is second order accurate.
$$f'(x) = \frac{f(x+h) - f(x-h)}{2h} + O(h^2)$$