Computing Mixed Derivatives by Finite Differences

The post is aimed to summarize various finite difference schemes for partial derivatives estimation dispersed in comments on the Central Differences page. To gather them all in one place as a reference.

Listed formulas are selected as being advantageous among others of similar class – highest order of approximation, low rounding errors, etc. Please use comments to add other schemes.

Second order

O(h^2):

(1)   \begin{equation*} \displaystyle{{\frac{\partial^2{f}}{\partial{x}\partial{y}}}\approx \frac{1}{4\,h^2}\left[f_{-1,-1}+f_{1,1}-f_{1,-1}-f_{-1,1}\right]} \end{equation*}

O(h^4):

(2)   \begin{equation*} \frac{\partial^2 f}{\partial x \partial y} \approx \frac{1}{144 h^2}\left[   \begin{array}{l}     8(f_{1,-2}+f_{2,-1}+f_{-2,1}+f_{-1,2})-8(f_{-1,-2}+f_{-2,-1}+f_{1,2}+f_{2,1})\\    -(f_{2,-2}+f_{-2,2}-f_{-2,-2}-f_{2,2})+64(f_{-1,-1}+f_{1,1}-f_{1,-1}-f_{-1,1})   \end{array}\right] \end{equation*}

The last formula is provided by “Felix”.

There are other formulas (e.g. provided by Edward F. Valeev) which can be beneficial for some applications (e.g. to use minimum number of function values in trade-off with decreased accuracy).

Third & Fourth order

To be continued…

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.80)
Loading...

One Comment

  1. Posted June 21, 2018 at 9:11 pm | #

    Pavel, really thanks to have these formulae summarized in one page !!

    Sorry, 4 years have passed… I hope you can see this message…

    I am wondering how easy is to get the formula to have O(h^4) precision on partial second derivative when the points are close to the border, (so, when f_{2,2} or f_{1,-2} are not available).

Post a Reply to Alessio

Your email is never published nor shared.

Use native LaTeX syntax to include formulas: $ ... $, \[ ... \], etc. Do not forget to preview comment before posting.

Also you may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Subscribe without commenting