I am attempting to perform taylor expansion on the following numerical differentiation formula:

$f'''(0) = \frac {−f(−3h/2) + 3f(−h/2) − 3f(h/2) + f(3h/2)) }{ h^3 }$

Over the reference interval [−3h/2, 3h/2]

After the derivation of the weights using Lagrange polynomials, the result is:

$p'''0 = f0*l_0'''(0) + f1*l_1'''(0) + f2*l_2'''(0) + f2*l_3'''(0)$

$ \frac {-f0 + 3f1 - 3f2 + f3} {h^3} $

Where $f0 = (-3h/2), f1 = (-h/2), f2 = (h/2), f3 = (3h/2)$

When trying to find the leading error term with Taylor expansion, my leading error term is $\frac {-3}{2h^2} fo'$. This gives an order of accuracy equal to -2.

The taylor expansion is done as follows:

$ \frac {-f0 + 3f1 - 3f2 + f3} {h^3} - f'''0$

$\frac {1} {h^{3}} (-f0 + 3(f0 +(-h/2)f0' + ...) - 3(f0 +(h/2)f0' + ...) + (f0 +(3h/2)f0' + ...))-f'''0$

Am I doing something wrong?

  • 1
    $\begingroup$ To see if you did something wrong we first need to see what you did? What reasoning led to your error formula? $\endgroup$ – Dr. Lutz Lehmann Nov 17 '15 at 11:02
  • $\begingroup$ I updated my question to provide more details. $\endgroup$ – stevetronix Nov 17 '15 at 16:38

You should decide which of the formulas $$ \frac{-f(x)+3f(x+h)-3f(x+2h)+f(x+3h)}{h^3} $$ or $$ \frac{-f(x-3h/2)+3f(x-h/2)-3f(x+h/2)+f(x+3h/2)}{h^3} $$ you are actually considering and then stay with it. Your Taylor expansions mix (partial) terms from both formulas.

  • $\begingroup$ I don't see where my Taylor expansion is using -f(x) + 3f(x+h) − 3f(x+2h) + f(x+3h). I am using f0=(−3h/2), f1=(−h/2), f2=(h/2), f3=(3h/2) $\endgroup$ – stevetronix Nov 17 '15 at 21:21
  • 1
    $\begingroup$ Then your expansion should be around $h=0$, which is not reflected in your computations. $\endgroup$ – Dr. Lutz Lehmann Nov 17 '15 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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