# Taylor series in numerical differentiation

I'm studying some numerical methods and especially the numerical differentiation.

I have some troubles with the central differentiation. How do you become from the Taylor series the formula for $f(x+h)$, $f(x-h)$, $f(x+2h)$ and $f(x-2h)$?

• Take the ordinary formula and substitute $h$ for $-h,2h$ and $-2h$. (It even works with $0$ !) – Yves Daoust Jan 10 '18 at 11:55

$$f(x) = \sum_{n=0}^{+\infty}\frac{f^{(n)}(a)}{n!}(x-a)^n \tag{1}$$

Call $y = x - a$, so that $x = a + y$. Eqn. (1) becomes

$$f(y + a) = \sum_{n=0}^{+\infty}\frac{f^{(n)}(a)}{n!}y^n \tag{2}$$

Now, to recover your second set of equations you can call $y \to h$ and $a\to x$, the result is

$$f(x+h)=\sum_{n=0}^{+\infty}\frac{f^{(n)}(x)}{n!}h^n \tag{3}$$

With $y\to 2h$, $\cdots$ you will recover the other equations

• Thnx, but how do you become the equations f(x-h) and f(x-2h)? – WinstonCherf Jan 10 '18 at 11:57
• @LeneCoenen In Eqn. (2) replace $y\to -h$ and $a\to x$ – caverac Jan 10 '18 at 11:59
• How do you know until which term you have to expand? And what does the O(h^4) for example mean? – WinstonCherf Jan 10 '18 at 12:13
• @LeneCoenen The more terms you include the more accurate is your approximation. The symbol $O(h^4)$ just means that the terms that follow are all going to be of order $h^4$ or higher. – caverac Jan 10 '18 at 12:17