Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Find the best approximation to the first derivative of $f(x)$ based on the values of $f(x), f(x+h), f(x+2h)$. What is the accuracy of this approximation?

I was thinking of using a central difference approximation (because it is a 2nd order approximation) but I am unsure if that is correct.

share|cite|improve this question
Care to accept an answer? – Did Nov 13 '11 at 10:17
up vote 8 down vote accepted

Personally I would use $f'(x) \approx \dfrac{f(x+h)-f(x)}{h}$ for small $h$ but that may be closer to $f'(x+\frac{h}{2})$.

So if you have a reasonable approximation to both $f'(x+\frac{3h}{2})$ and $f'(x+\frac{h}{2})$ and if you think you function is fairly smooth (in the sense of an almost constant second derivative in the range $[x,x+2h]$) then you might reduce the earlier estimate by half the difference between those two, giving $$f'(x) \approx f'(x+\tfrac{h}{2}) - \frac{1}{2}\left(f'(x+\tfrac{3h}{2}) -f'(x+\tfrac{h}{2})\right) $$ and $$\frac{f(x+h)-f(x)}{h} - \frac{1}{2}\left(\tfrac{f(x+2h)-f(x+h)}{h} -\tfrac{f(x+h)-f(x)}{h}\right) = \frac{4f(x+h)-3f(x)- f(x+2h)}{2h}. $$

In fact this is the only estimate which gives correct results for quadratic functions and any $h$.

share|cite|improve this answer
One could also derive the last result by performing Richardson extrapolation on the $2h$ and $h$ approximations... – J. M. Oct 15 '11 at 0:35

From the Taylor series, $f(x+h) = f(x) + h f'(x) + h^2 f''(x)/2 +O(h^3)$ and $f(x-h) = f(x) - hf'(x) + h^2 f''(x)/2+O(h^3)$.

The only combination which gets rid of the $f''(x)$ term is $\frac{f(x+h)-f(x-h)}{2h} = f'(x) + O(h^2)$.

share|cite|improve this answer
I talked about that here... – J. M. Oct 16 '11 at 2:58

Here's a slight elaboration of my comment to Henry's answer: consider the series expansion


From this, we get the double-step expansion


Richardson extrapolation here consists of finding a linear combination of the two previous expansions that knocks out the $h$ term; we find that


and the left-hand side, after simplification, is precisely the last expression Henry obtained.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.