Nth order central difference for odd $n$

583 Views Asked by At

I am interested in the $n^{\mathrm{th}}$-order central difference of an expression $f$. The general form of the $n^{\mathrm{th}}$-order central difference is given by

$$\delta_h^n[f](x)=\sum_{i=0}^n(-1)^i {n \choose i}f(x+(\frac{n}{2}-i)h).$$

For odd $n$, the central difference will have $h$ multiplied by non-integers, which can often be problematic. According to this Wiki article, the problem can be circumvented by taking the average of $\delta^n[f](x-\frac{h}{2})$ and $\delta^n[f](x+\frac{h}{2})$.

What does that actually mean? Does this mean that I adjust the generalized formula from $f(x+(\frac{n}{2}-i)h)$ (only this part?) to e.g., $\delta^n[f](x-\frac{h}{2})$? And if so, $i$ is just a bookkeeping device. For example, for the third order difference, does it mean that I use the generalized formula for $i = \{0,2\}$ and the adjusted formula for $i = \{1,3\}$?

I know, of course, that it is also possible to use the explicit formula for, e.g., the third derivative. However, I am interested in the application of the generalized expression.

1

There are 1 best solutions below

2
On BEST ANSWER

The usual $3$-rd order central difference in accordance to the provided formula turns out to be:

$$f^{(3)}(x)\approx\frac{f(x+\frac32h)-3f(x+\frac12h)+3f(x-\frac12h)-f(x-\frac32h)}{h^3}\tag1$$

Yet in a discrete context, this is not desirable because we cannot evaluate $f$ at half integers. One option is to double $h$,

$$f^{(3)}(x)\approx\frac{f(x+3h)-3f(x+h)+3f(x-h)-f(x-3h)}{8h^3}\tag2$$

but this then skips over $f(x+2h)$ and $f(x-2h)$, and for higher order derivatives this becomes even worse.

Wikipedia as you linked suggests a different but still fairly simple alternative. It more or less boils down to estimating half integers by their neighboring integer values:

$$f\left(x+\frac h2\right)\approx\frac{f(x)+f(x+h)}2\tag3$$

Subsituting this into $(1)$ gives:

$$f^{(3)}(x)\approx\frac{f(x+2h)-2f(x+h)+2f(x-h)-f(x-2h)}{2h^3}\tag4$$

More generally, we may write this as:

$$f^{(2n+1)}(x)\approx\sum_{i=0}^n\binom{2n}i(-1)^i\frac{f(x+(n+1-i)h)-f(x-(n+1-i)h)}{2h^3}\tag5$$

For even derivatives, you may simply use the original formula since it doesn't involve any half-integer calculations.

$(5):$ Note that for $i=n$, the term is zero.