I have uniform grid and have to calculate third partial derivative approximations at nodes.
There I found approximations only for second order.
Could someone point me to or explain a way to build formula for third order partial derivatives.
Particularly, I have to calculate fxxx(x,y), fxxy(x,y), fyyy(x,y) and fyyx(x,y).
Many thanks.
Let's say that f[i,j] is the value at node (i,j), and h is the size of space step. You already know how to calculate second order derivatives of f, for example
fxx[i,j] = (f[i+1,j]-2*f[i,j]+f[i-1,j])/h^2
fyy[i,j] = (f[i,j+1]-2*f[i,j]+f[i,j-1])/h^2
fxy[i,j] = (f[i+1,j+1]-f[i+1,j-1]-f[i-1,j+1]+f[i-1,j-1])/h^2
These are of second degree of accuracy, that is the error is about h2. In order to maintain this accuracy, take one more derivative using the symmetric difference rule, like
gx[i,j] = (g[i+1,j]-g[i-1,j])/(2*h)
This results in:
fxx[i,j] = ((f[i+2,j]-2*f[i+1,j]+f[i,j])-(f[i,j]-2*f[i-1,j]+f[i-2,j]))/(2*h^3)
(which can be simplified), and similarly for other derivatives:
fxxy[i,j] = ((f[i+1,j+1]-2*f[i,j+1]+f[i-1,j+1])-(f[i+1,j-1]-2*f[i,j-1]+f[i-1,j-1]))/(2*h^3)