1

I have a question with respect to deriving an approximation for $f^{''}(x)$ using the forward, backward, or centered difference. It goes as follows:

"Using the method of your choice, construct an approximation of $f^{''}(x)$ using the sample points $f(x+h)$, $f(x)$, and $f(x-2h)$."

The second part asks for the order of accuracy of this approximation.

Would someone pleased provide some advice on how I should proceed? The problem is I am a bit unsure on how to make the derivation without using the point $f(x-h)$ so some advice would be greatly appreciated.

Thank you.

PutsandCalls
  • 1,051

1 Answers1

1

Consider the function $$g(x)=a f(x+h)+b f(x)+c f(x-2h)$$ and develop it as a Taylor expansion around $h=0$. Grouping terms, this leads to $$g(x)=f(x) (a+b+c)+h (a-2 c) f'(x)+\frac{1}{2} h^2 (a+4 c) f''(x)+\frac{1}{6} h^3 (a-8 c) f'''(x)+O\left(h^4\right)$$ So, $$a+b+c=0$$ $$a-2c=0$$ that is to say $a=2c$, $b=-3c$. This makes $$g(x)=2c f(x+h)-3c f(x)+c f(x-2h)=3c h^2 f''(x)-ch^3 f'''(x)+\cdots$$ So, since we want $f''(x)$ let us ignore the higher order terms, $$f''(x)\approx\frac{2c f(x+h)-3c f(x)+c f(x-2h)}{3ch^2}=\frac{2 f(x+h)-3 f(x)+ f(x-2h)}{3h^2}$$

Edit

There is another way to do it : say that you look for a quadratic approximation of the function going through three points and write $$g(x)=a+b x+c x^2$$ So,$$g(x+h)=f(x+h)=a+b(x+h)+c(x+h)^2$$ $$g(x)=a+b x+c x^2$$ $$g(x-2h)=f(x-2h)=a+b(x-2h)+c(x-2h)^2$$ Solve for $a,b,c$ to get $$c=\frac{2 f(h+x)-3 f(x)+f(x-2 h)}{6 h^2}$$ and $f''(x)=2c$.