# How is the Taylor expansion for $f(x + h)$ derived?

According to this Wikipedia article, the expansion for $f(x\pm h)$ is:

$$f(x \pm h) = f(x) \pm hf'(x) + \frac{h^2}{2}f''(x) \pm \frac{h^3}{6}f^{(3)}(x) + O(h^4)$$

I'm not understanding how you are left with $f(x)$ terms on the right hand side.

I tried working out, for example, the Taylor expansion for $f(x + h)$ (using $(x+h)$ as $x_0$) and got this:

$$f(x + h) = f(x+h) + f'(x + h)(x-(x+h)) + \frac{f''(x+h)}{2!}(x-(x+h))^2 + \frac{f'''(x+h)}{3!} (x - (x + h))^3 + \cdots$$

$$= f(x + h) - hf'(x+h) + \frac{h^2}{2!}f''(x + h) - \frac{h^3}{3!} f'''(x+h) + \cdots$$

Am I doing this correctly?

-
It is $x$ which is the "$x_0$", and $x\pm h$ which is the "$x$". – André Nicolas Dec 9 '12 at 19:25

It looks as if the notation you are accustomed to for the Taylor expansion is something like $$f(x)\approx f(x_0)+f'(x_0)(x-x_0)+\frac{f''(x_0)}{2!}(x-x_0)^2+ \frac{f'''(x_0)}{3!}(x-x_0)^3+\cdots.$$
Now write $x$ instead of $x_0$, and $x\pm h$ instead of $x$.