Deriving formula for approximating the derivatives

calculusnumerical methods

Derive the following formula for approximating derivates and show that it is O(h^4) by establishing its error:

$$
f'(x) \approx \frac{1}{12h} [-f(x+2h)+8f(x+h)-8f(x-h)+f(x-2h)]
$$

I've tried writing everything out with their taylor expansions. Then I get
$$
f'(x) \approx \frac{1}{12h} \left( 12hf'(x) \right)
$$

But I am not sure if im doing the right thing. Any ideas or hints?

Best Answer

Write the Taylor expansion of your terms up to fourth order

For example:

$$ f(x+h)= f(x) + hf'(x) + h^2/2 f"(x) + h^3/6 f'''(x) + O(h^4)$$
$$ f(x-h)= f(x) - hf'(x) + h^2/2 f"(x) - h^3/6 f'''(x) + O(h^4)$$ $$ f(x+2h)= f(x) +2hf'(x) + (2h)^2/2 f"(x) + (2h)^3/6 f'''(x) + O(h^4)$$ $$f(x-2h)= f(x) -2hf'(x) + (2h)^2/2 f"(x) - (2h)^3/6 f'''(x) + O(h^4)$$ Plug in the RHS and solve for f'(x) to get the LHS.