Find a formula to approximate $f''(x_0)$

48 Views Asked by At

Find a formula to approximate $f''(x_0)$ which uses $f( x_0),f\left(x_0+\frac{h}{2}\right)$ and $f(x+2h)$.

My workings so far,

$$f''(x) \approx Af(x+2h) + B(x) + C f\left(x_0+\frac{h}{2}\right)$$

Expand in a Taylor series:

$$Af(x+2h) = Af(x) +2Ahf(x) + 2Ah^2f(x)$$ Do I need to solve this using the method of undetermined coefficients? I tried to do this with the rest but I am stuck!.

2

There are 2 best solutions below

2
On BEST ANSWER

We have two obvious formulae for approximating $\require{cancel}f'(x_0)$: \begin{align} f'(x_0)&\approx \frac{f(x_0+2h)-f(x_0)}{2h}\tag{1}\label{1sta}\\ f'(x_0)&\approx \frac{f(x_0+h/2)-f(x_0)}{h/2}\tag{2}\label{1stb} \end{align} When you Taylor expand the RHS of both equations, there are no contribution from $f(x_0)$ and the contribution from $f'(x_0)$ are the same (this is why they approximate $f'(x_0)$). So it makes sense to try subtracting one from another, and the "next" derivative term $f''(x_0)$ will appear (in general, there won't be any miraculous cancellation): \begin{align} &\frac{f(x_0+2h)-f(x_0)}{2h}-\frac{f(x_0+h/2)-f(x_0)}{h/2}\\ &\approx \frac{\color{red}{f(x_0)}+\color{blue}{2hf'(x_0)}+\frac12(2h)^2f''(x_0)\color{red}{-f(x_0)}}{2h}\\ &\qquad\qquad-\frac{\color{red}{f(x_0)}+\color{blue}{\frac12hf'(x_0)}+\frac12(\frac12h)^2f''(x_0)\color{red}{-f(x_0)}}{h/2}\tag{3}\label{01cancel} \\ &=\left[\frac{\frac12(2h)^2}{2h}-\frac{\frac12(\frac12h)^2}{\frac12h}\right]f''(x_0)=\frac34hf''(x_0). \end{align} The cancellations in line \eqref{01cancel} are already alluded to above: $f(x_0)$ already don't appear in \eqref{1sta} and \eqref{1stb}, the $f'(x_0)$ cancel because they are the LHS of \eqref{1sta} and \eqref{1stb} which we are subtracting from. Now rearrange to give an approximation formula for $f''(x_0)$ \begin{align} f''(x_0)&\approx\frac{\dfrac{f(x_0+2h)-f(x_0)}{2h}-\dfrac{f(x_0+h/2)-f(x_0)}{h/2}}{\frac34h}\\ &=\frac{f(x_0+2h)-4f(x_0+h/2)+3f(x_0)}{\frac32h^2}. \end{align}

2
On

If we imagine expanding $f$ into a Taylor series about $x_0$, then we have:

$$ f(x_0 + g) \approx f(x_0) + f'(x_0) g + f''(x_0) \frac{g^2}{2} + O(g^3) $$

Now let's see what happens when we look at this formula for $g=\frac{h}{2}$ and $g=2h$:

\begin{eqnarray*} f(x_0 + \frac{h}{2}) &\approx& f(x_0) + f'(x_0) \frac{h}{2} + f''(x_0)\frac{h^2}{8} \\ f(x_0 + 2h) &\approx& f(x_0) + f'(x_0)(2h) + f''(x_0) (2h^2) \end{eqnarray*}

A little manipulation of the equations then can get you an approximation for $f''(x_0)$. (Hint: examine what $4 f(x_0 + \frac{h}{2}) - 3 f(x_0) - f(x_0 + 2h)$ is approximately equal to.)