<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">OALibJ</journal-id><journal-title-group><journal-title>Open Access Library Journal</journal-title></journal-title-group><issn pub-type="epub">2333-9705</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/oalib.1110875</article-id><article-id pub-id-type="publisher-id">OALibJ-129548</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Biomedical&amp;Life Sciences</subject><subject> Business&amp;Economics</subject><subject> Chemistry&amp;Materials Science</subject><subject> Computer Science&amp;Communications</subject><subject> Earth&amp;Environmental Sciences</subject><subject> Engineering</subject><subject> Medicine&amp;Healthcare</subject><subject> Physics&amp;Mathematics</subject><subject> Social Sciences&amp;Humanities</subject></subj-group></article-categories><title-group><article-title>
 
 
  Effect of Asymmetric Finite Difference Formulas on the Orders of Central Difference Approximations for the Second Derivative of a Periodic Function
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Hippolyte</surname><given-names>Nyengeri</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Jimmy</surname><given-names>Jackson Sinzingayo</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Bonaventure</surname><given-names>Dusabe</given-names></name><xref ref-type="aff" rid="aff3"><sup>3</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Eugène</surname><given-names>Ndenzako</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff2"><addr-line>Software Engineering, College of Software, Nankai University, Tianjin, China</addr-line></aff><aff id="aff3"><addr-line>Faculté des Sciences de l’Ingénieur, Université du Burundi, Bujumbura, Burundi</addr-line></aff><aff id="aff1"><addr-line>Département de Physique, Faculté des Sciences, Université du Burundi, Bujumbura, Burundi</addr-line></aff><pub-date pub-type="epub"><day>09</day><month>11</month><year>2023</year></pub-date><volume>10</volume><issue>11</issue><fpage>1</fpage><lpage>26</lpage><history><date date-type="received"><day>12,</day>	<month>October</month>	<year>2023</year></date><date date-type="rev-recd"><day>27,</day>	<month>November</month>	<year>2023</year>	</date><date date-type="accepted"><day>30,</day>	<month>November</month>	<year>2023</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  The traditional numerical computation of the first and higher derivatives of a given function f(x) of a single argument x by central differencing is known to involve aspects of both accuracy and precision. However, central difference formulas are useful only for interior points not for a certain number of end points belonging to a given grid of points. In order to get approximations of a desired derivative at all points, one has to use asymmetric difference formulas at points where central differencing doesn’t work. This must surely affect the accuracy and precision of the approximation. In this paper, we study the dependence of the orders of the five-point and the seven-point central difference formulas for the second derivative of f(x) on the oscillatory properties of this function and the value of the sampling period h in the case where it is necessary to use forward and backward formulas to approximate the derivative at some points belonging to a given grid of equally spaced points. As an illustrative example, we consider the case where f(x)=sin(αx).
 
</p></abstract><kwd-group><kwd>Numerical Differentiation</kwd><kwd> Finite Difference Formulas</kwd><kwd> Order of Approximation</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Numerical differentiation is an elementary and essential part in scientific modeling and numerical analysis [<xref ref-type="bibr" rid="scirp.129548-ref1">1</xref>] . It is widely used for the differentiation of the functions which are difficult to differentiate analytically, and for finding the derivative of the sampled data for which the generating function is not known. This is the case when solving the ordinary or partial differential equations numerically.</p><p>Many methods have been introduced and discussed to determine the derivatives numerically [<xref ref-type="bibr" rid="scirp.129548-ref2">2</xref>] . These methods can be classified into two approaches [<xref ref-type="bibr" rid="scirp.129548-ref2">2</xref>] . The first approach aims to develop formulas for calculating the derivatives numerically. This includes the Taylor expansion based finite difference method [<xref ref-type="bibr" rid="scirp.129548-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref7">7</xref>] , the operator method [<xref ref-type="bibr" rid="scirp.129548-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref8">8</xref>] , the interpolating polynomial method [<xref ref-type="bibr" rid="scirp.129548-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref8">8</xref>] [<xref ref-type="bibr" rid="scirp.129548-ref9">9</xref>] , and the lozenge diagram method [<xref ref-type="bibr" rid="scirp.129548-ref10">10</xref>] . The second approach does not give an explicit formula for the derivative; it just aims to evaluate it by using the function data [<xref ref-type="bibr" rid="scirp.129548-ref1">1</xref>] .</p><p>The Taylor series based finite difference approximation is used to numerically evaluate the derivative of a function at a grid reference point by using data samples at the other neighboring points within the domain of this function. Depending on the pattern of the samples used in calculation, the most commonly used approximation formulas for derivatives are classified as forward, backward and central difference formulas. Forward difference approximations use the samples at a mesh point and next (forward) equally spaced points of analysis for calculating the derivative at the mesh point. In contrast, backward difference approximations use the samples at a mesh point and the previous (backward) equally spaced points, whereas central difference approximations use both forward and backward samples in calculating the derivative at the specified mesh point. Forward and backward differencing are part of a larger group of what might be called lateral (as distinct from central) differencing methods, including extrapolative differencing that might be appropriate for singularity [<xref ref-type="bibr" rid="scirp.129548-ref11">11</xref>] .</p><p>We have to emphasize that the number of points used to approximate the derivative defines the order of the approximation and generally, the greater is this number, the more is the accuracy of the approximation. For example, a finite difference approximation of the second derivative using n p points is said to be of order n p − 1 for the central approximation and n p − 2 for both the forward and backward approximations, which means that central difference formula gets an extra order of accuracy for free. The central differencing is therefore the most accurate of the above three methods for a given number of equidistant data samples [<xref ref-type="bibr" rid="scirp.129548-ref12">12</xref>] . However, central difference formulas are useful only for interior points not for end points. For example, if we have a grid of N x + 1 points x i given by x i = x 0 + i h , ( i = 0 , 1 , 2 , ⋯ , N x ) for some fixed tabular interval h, and some integer N x &gt; n p , the n p -point central difference approximation for the second derivative of a certain function f ( x ) can be used only at grid points x j , j ∈ [ ( n p − 1 ) / 2 , N x − ( n p − 1 ) / 2 ] but not for j ∈ [ 0 , ( n p − 3 ) / 2 ] or j ∈ [ N x − ( n p − 3 ) / 2 , N x ] , n p being an odd integer such that n p ≤ 3 &lt; N x . In order to get approximations of f ″ ( x j ) at the ( n p − 3 ) / 2 first points (resp. last points) while preserving the accuracy of the results, one can theoretically use a ( n p + 1 ) -point forward difference (resp. backward difference) formula, which must surely affect the accuracy and precision of the results.</p><p>The main purpose of this paper is to study the dependence of the orders of central difference approximations for the second derivative of a function on the oscillatory properties of this function and the value of the sampling period h in the case where it is necessary to use forward/backward approximations for this derivative at some points belonging to a given grid of equally spaced points.</p><p>The rest of this paper is organized as follows. Section 2 contains a brief presentation of Khan and Ohba’s closed-form expressions for finite difference approximations of first and higher derivative based on Taylor’s series, which have been shown to be suitable for computing derivatives of any degree with arbitrary order of accuracy over all the known function sampling points with a minimum effort [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>] . Thereafter, we use these expressions to establish forward, backward and central difference formulas of several orders for the first two derivatives. In Section 3, we show how to determine numerically and graphically the order of a finite difference formula for a derivative of a certain degree q. In Section 4, we present and comment our results concerning the orders of some finite difference formulas for the second derivative of the function f ( x ) defined by f ( x ) = sin ( α x ) , α being a positive real parameter which allows working with various oscillation frequencies of the function under consideration. We concentrate on the behavior of the order of each formula as a function of the α parameter and the sampling period h. The conclusion is given in Section 5.</p></sec><sec id="s2"><title>2. Finite Difference Formulas of the First and Second Derivatives Based on Taylor Series</title><p>Following the notations as found in [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>] , the Taylor series defines the relation between the discrete time values of a time function f ( t ) sampled at t = k h , where k = 0 , &#177; 1 , &#177; 2 , ⋯ , and h is the sampling period, to the value of the function and its derivatives at origin t = 0 . It can, mathematically, be written as [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>]</p><p>f k = f 0 + k h f 0 ( 1 ) + ( k h ) 2 2 ! f 0 ( 2 ) + ⋯ + ( k h ) n n ! f 0 ( n ) + O ( h n + 1 ) (1)</p><p>where f k denotes the value of f ( t ) at t = k h , f 0 ( k ) denotes the value of the kth derivative of f at t = 0 and O ( h n + 1 ) is a term of the order of h n + 1 coming from the truncation of the series after n + 1 terms. The value of the kth derivative of f at t = i h is denoted by f i ( k ) .</p><p>In this Section, we are mainly interested in the forward, backward and central difference approximations of the first and second derivatives of a function. We found it clarifying to use the notations of Ishtiaq Rasool Khan and Ryoji Ohba [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>] . The advantage of this notation is that it is suitable for calculating derivatives of any degree with arbitrary order of accuracy over all the known function sampling points with a minimum effort.</p><p>The following paragraphs summarize a number of expressions for finite difference approximations of first and second derivatives found in [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>] .</p><sec id="s2_1"><title>2.1. Case of the First Derivative</title><p>Based on forward values of the function, we have [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>]</p><p>f i ( 1 ) = 1 h ∑ k = 0 n g k , n F , 1 f k + i + O ( h n ) (2)</p><p>where g k , n F , 1 denotes the coefficient of a term f k in a forward approximation of first derivative of order n.</p><p>Ishtiaq Rasool Khan and Ryoji Ohba calculated the g k , n F , 1 coefficients for different orders of approximation, and observed that they can be expressed by the following explicit formulas [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>] :</p><p>g 0 , n F , 1 = − ∑ j = 1 n 1 j (3)</p><p>and</p><p>g k , n F , 1 = ( − 1 ) k + 1 k C k n ,       k = 1 , 2 , ⋯ , n , (4)</p><p>where C a b is defined as a ! b ! ( a − b ) ! .</p><p>Similarly based on the backward values of the function, we may write</p><p>f i ( 1 ) = 1 h ∑ k = − n 0 g k , n B , 1 f k + i + O ( h n ) (5)</p><p>where the superscript B refers to backward difference approximations. The g k , n B , 1 coefficients are such that</p><p>g 0 , n B , 1 = − g 0 , n F , 1 = ∑ j = 1 n 1 j (6)</p><p>and</p><p>g k , n B , 1 = − g k , n F , 1 = ( − 1 ) k k C k n ,       k = 1 , 2 , ⋯ , n . (7)</p><p>According to Khan I. R. and Ohba R. [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>] , a central difference approximation of order 2n for the first derivative is, for its part, given by the following Equation:</p><p>f i ( 1 ) = 1 h ∑ k = − n n g k , 2 n C , 1 f k + i + O ( h 2 n ) (8)</p><p>where</p><p>g 0 , 2 n C , 1 = 0 (9)</p><p>and</p><p>g k , 2 n C , 1 = ( − 1 ) k + 1 ( n ! ) 2 k ( n − k ) ! ( n + k ) ! ,       k = &#177; 1 , &#177; 2 , ⋯ , &#177; n . (10)</p><p>The approximations of the first derivative for some values of n are listed below (See <xref ref-type="table" rid="table1">Table 1</xref>).</p></sec><sec id="s2_2"><title>2.2. Case of the Second Derivative</title><p>For this case we have [<xref ref-type="bibr" rid="scirp.129548-ref13">13</xref>] :</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Backward, forward and central difference approximations of f i ( 1 ) for some values of n</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >n</th><th align="center" valign="middle" >Finite Difference Formulas</th></tr></thead><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" >Forward Difference Formulas</td></tr><tr><td align="center" valign="middle" >1</td><td align="center" valign="middle" >( − f i + f i + 1 ) / h + O ( h )</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >( − 3 f i + 4 f i + 1 − f i + 2 ) / ( 2 h ) + O ( h 2 )</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >( − 11 f i + 18 f i + 1 − 9 f i + 2 + 2 f i + 3 ) / ( 6 h ) + O ( h 3 )</td></tr><tr><td align="center" valign="middle" >4</td><td align="center" valign="middle" >( − 25 f i + 48 f i + 1 − 36 f i + 2 + 16 f i + 3 − 3 f i + 4 ) / ( 12 h ) + O ( h 4 )</td></tr><tr><td align="center" valign="middle" >5</td><td align="center" valign="middle" >( − 137 f i + 300 f i + 1 − 300 f i + 2 + 200 f i + 3 − 75 f i + 4 + 12 f i + 5 ) / ( 60 h ) + O ( h 5 )</td></tr><tr><td align="center" valign="middle" >6</td><td align="center" valign="middle" >( − 147 f i + 360 f i + 1 − 450 f i + 2 + 400 f i + 3 − 225 f i + 4 + 72 f i + 5 − 10 f i + 6 ) / ( 60 h ) + O ( h 6 )</td></tr><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" >Backward Difference Formulas</td></tr><tr><td align="center" valign="middle" >1</td><td align="center" valign="middle" >( − f i − 1 + f i ) / h + O ( h )</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >( f i − 2 − 4 f i − 1 + 3 f i ) / ( 2 h ) + O ( h 2 )</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >( − 2 f i − 3 + 9 f i − 2 − 18 f i − 1 + 11 f i ) / ( 6 h ) + O ( h 3 )</td></tr><tr><td align="center" valign="middle" >4</td><td align="center" valign="middle" >( 3 f i − 4 − 16 f i − 3 + 36 f i − 2 − 48 f i − 1 + 25 f i ) / ( 12 h ) + O ( h 4 )</td></tr><tr><td align="center" valign="middle" >5</td><td align="center" valign="middle" >( − 12 f i − 5 + 75 f i − 4 − 200 f i − 3 + 300 f i − 2 − 300 f i − 1 + 137 f i ) / ( 60 h ) + O ( h 5 )</td></tr><tr><td align="center" valign="middle" >6</td><td align="center" valign="middle" >( 10 f i − 6 − 72 f i − 5 + 225 f i − 4 − 400 f i − 3 + 450 f i − 2 − 360 f i − 1 + 147 f i ) / ( 60 h ) + O ( h 6 )</td></tr><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" >Central Difference Formulas</td></tr><tr><td align="center" valign="middle" >1</td><td align="center" valign="middle" >( − f i − 1 + f i + 1 ) / ( 2 h ) + O ( h 2 )</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >( f i − 2 − 8 f i − 1 + 8 f i + 1 − f i + 2 ) / ( 12 h ) + O ( h 4 )</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >( − f i − 3 + 9 f i − 2 − 45 f i − 1 + 45 f i + 1 − 9 f i + 2 + f i + 3 ) / ( 60 h ) + O ( h 6 )</td></tr><tr><td align="center" valign="middle" >4</td><td align="center" valign="middle" >( 3 f i − 4 − 32 f i − 3 + 168 f i − 2 − 672 f i − 1 + 672 f i + 1 − 168 f i + 2 + 32 f i + 3 − 3 f i + 4 ) / ( 840 h ) + O ( h 8 )</td></tr></tbody></table></table-wrap><p>• Forward formulas</p><p>f i ( 2 ) = 1 h 2 ∑ k = 0 n g k , n F , 2 f k + i + O ( h n ) (11)</p><p>where</p><p>g k , n F , 2 = ( − 1 ) k C k n k ∑ j = 1 j ≠ k n 1 j ,         k = 1 , 2 , ⋯ , n , (12)</p><p>and</p><p>g 0 , n F , 2 = − ∑ k = 1 n g k , n F , 2 (13)</p><p>• Backward formulas</p><p>f i ( 2 ) = 1 h 2 ∑ k = − n 0 g k , n B , 2 f k + i + O ( h n ) (14)</p><p>where g k , n B , 2 , the coefficient of f k , is the same as the corresponding kth coefficient in forward difference approximation given by Equations (12) and (13).</p><p>• Central difference formulas</p><p>f i ( 2 ) = 1 h 2 ∑ k = − n n g k , 2 n C , 2 f k + i + O ( h 2 n ) (15)</p><p>where</p><p>g 0 , 2 n C , 2 = − ∑ k = 1 n g k , 2 n C , 2 (16)</p><p>and</p><p>g k , 2 n C , 2 = ( − 1 ) k + 1 2 ! k 2 ( n ! ) 2 ( n − k ) ! ( n + k ) ! ,         k = &#177; 1 , &#177; 2 , ⋯ , &#177; n . (17)</p><p><xref ref-type="table" rid="table2">Table 2</xref> presents finite difference approximations of the second derivative for some values of n.</p></sec></sec><sec id="s3"><title>3. Numerical and Graphical Determination of the Order of a Finite Difference Formula</title><p>It is possible to calculate numerically and graphically the order of a given finite difference formula for a derivative of a function. To achieve this, it is necessary to choose a function whose successive derivatives are exactly known in a certain interval [ a , b ] of the independent variable. We then consider several values of h and compute for each of them the error E [ q ] ( h ) defined as</p><p>E [ q ] ( h ) = max i ∈ [ 0 , N x ] | f ( q ) ( x i ) − f i ( q ) | (18)</p><p>where f ( q ) ( x i ) denotes the value of the qth derivative of the function f at x = x i , N x is a positive integer such that</p><p>h = ( b − a ) / N x , (19)</p><p>which means that we discretize the interval of interest by N x + 1 points, i.e., x 0 = a ,   x 1 ,   x 2 , ⋯ ,   x N x = b . If</p><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Forward, backward and central difference approximations of f i ( 2 ) for some values of n</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >n</th><th align="center" valign="middle" >Finite Difference Formulas</th></tr></thead><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" >Forward Difference Formulas</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >( f i − 2 f i + 1 + f i + 2 ) / h 2 + O ( h )</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >( 2 f i − 5 f i + 1 + 4 f i + 2 − f i + 3 ) / h 2 + O ( h 2 )</td></tr><tr><td align="center" valign="middle" >4</td><td align="center" valign="middle" >( 35 f i − 104 f i + 1 + 114 f i + 2 − 56 f i + 3 + 11 f i + 4 ) / ( 12 h 2 ) + O ( h 3 )</td></tr><tr><td align="center" valign="middle" >5</td><td align="center" valign="middle" >( 45 f i − 154 f i + 1 + 214 f i + 2 − 156 f i + 3 + 61 f i + 4 − 10 f i + 5 ) / ( 12 h 2 ) + O ( h 4 )</td></tr><tr><td align="center" valign="middle" >6</td><td align="center" valign="middle" >( 812 f i − 3132 f i + 1 + 5265 f i + 2 − 5080 f i + 3 + 2970 f i + 4 − 972 f i + 5 + 137 f i + 6 ) / ( 180 h 2 ) + O ( h 5 )</td></tr><tr><td align="center" valign="middle" >7</td><td align="center" valign="middle" >( 938 f i − 4014 f i + 1 + 7911 f i + 2 − 9490 f i + 3 + 7380 f i + 4 − 3618 f i + 5 + 1019 f i + 6 − 126 f i + 7 ) / ( 180 h 2 ) + O ( h 6 )</td></tr><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" >Backward Difference Formulas</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >( f i − 2 − 2 f i − 1 + f i ) / h 2 + O ( h )</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >( − f i − 3 + 4 f i − 2 − 5 f i − 1 + 2 f i ) / h 2 + O ( h 2 )</td></tr><tr><td align="center" valign="middle" >4</td><td align="center" valign="middle" >( 11 f i − 4 − 56 f i − 3 + 114 f i − 2 − 104 f i − 1 + 35 f i ) / ( 12 h 2 ) + O ( h 3 )</td></tr><tr><td align="center" valign="middle" >5</td><td align="center" valign="middle" >( − 10 f i − 5 + 61 f i − 4 − 156 f i − 3 + 214 f i − 2 − 154 f i − 1 + 45 f i ) / ( 12 h 2 ) + O ( h 4 )</td></tr><tr><td align="center" valign="middle" >6</td><td align="center" valign="middle" >( 137 f i − 6 − 972 f i − 5 + 2970 f i − 4 − 5080 f i − 3 + 5265 f i − 2 − 3132 f i − 1 + 812 f i ) / ( 180 h 2 ) + O ( h 5 )</td></tr><tr><td align="center" valign="middle" >7</td><td align="center" valign="middle" >( − 126 f i − 7 + 1019 f i − 6 − 3618 f i − 5 + 7380 f i − 4 − 9490 f i − 3 + 7911 f i − 2 − 4014 f i − 1 + 938 f i ) / ( 180 h 2 ) + O ( h 6 )</td></tr><tr><td align="center" valign="middle" ></td><td align="center" valign="middle" >Central Difference Formulas</td></tr><tr><td align="center" valign="middle" >1</td><td align="center" valign="middle" >( f i − 1 − 2 f i + f i + 1 ) / h 2 + O ( h 2 )</td></tr><tr><td align="center" valign="middle" >2</td><td align="center" valign="middle" >( − f i − 2 + 16 f i − 1 − 30 f i + 16 f i + 1 − f i + 2 ) / ( 12 h 2 ) + O ( h 4 )</td></tr><tr><td align="center" valign="middle" >3</td><td align="center" valign="middle" >( 2 f i − 3 − 27 f i − 2 + 270 f i − 1 − 490 f i + 270 f i + 1 − 27 f i + 2 + 2 f i + 3 ) / ( 180 h 2 ) + O ( h 6 )</td></tr></tbody></table></table-wrap><p>E [ q ] ( h ) ≈ C h p (20)</p><p>for h sufficiently small (as h → 0 ), then p is the order of the finite difference formula. Here, C is a constant depending on the function, the degree of the derivative and the finite difference formula. From Equation (20), we have</p><p>log ( E [ q ] ( h ) ) ≈ log ( C h p ) = log ( C ) + p log ( h ) . (21)</p><p>Using the logarithmic scale resulting from the change of variable X = log ( h ) and Y = log ( E [ q ] ( h ) ) , we obtain the expression</p><p>Y ≈ log ( C ) + p X , (22)</p><p>which is the equation of a straight line. The slope of this line is therefore the order of the finite difference approximation.</p></sec><sec id="s4"><title>4. Numerical Experimentation</title><p>In order to study orders of finite difference formulas for the second derivative, we consider the periodic function f ( x ) defined by</p><p>f ( x ) = sin ( α x ) ,         α ∈ ℝ 0 + ,         x ∈ [ 0 , 2 π ] . (23)</p><p>The parameter α allows working with various oscillation frequencies of the function under consideration.</p><p><xref ref-type="fig" rid="fig1">Figure 1</xref> shows the dependence of the function f ( x ) on the independent variable x and the parameter α. As expected, the number of oscillations increases with α.</p><p>In Figures 1-5, we show the errors E [ 2 ] ( h ) plotted against h on a log-log scale for several values of the α parameter and the three numerical differentiation methods mentioned above. This is a good way to plot errors when we expect</p><p>them to behave like some power of h, since if the error E [ q ] ( h ) behaves like E [ q ] ( h ) ≈ C h p then log ( E [ q ] ( h ) ) ≈ log ( C ) + p log ( h ) . So on a log-log scale, the error behaves linearly with a slope that is equal to p, the order of accuracy.</p><p>It must be remembered that each of the three considered difference methods using n<sub>p</sub> points to approximate f i ( 2 ) requires us to use at least one of the two other methods in the approximation of this derivative for at least one point. More precisely:</p><p>• A n<sub>p</sub>-point forward formula requires use of a n<sub>p</sub>-point backward formula to approximate f i ( 2 ) at the ( n p − 1 ) last points.</p><p>• A n<sub>p</sub>-point backward formula requires use of a n<sub>p</sub>-point forward formula to approximate f i 2 at the ( n p − 1 ) first points.</p><p>• A n<sub>p</sub>-point central difference formula requires use of the ( n p + 1 ) -point forward formula (resp. backward formula) for the ( n p − 1 ) / 2 first points (resp. last points).</p><p>It appears from Figures 2-5 that the shape of each plot depends on the range the sampling period h belongs to, the method used to approximate f i ( 2 ) at the majority of points (those for which the method is useful) and the value of the α parameter. Indeed, the potential values of h can obviously be placed in three different regions when a ( 2 n + 1 ) -point central difference formula is applied to the function f ( x ) = sin ( α x ) with α positive integer or half-integer and x ∈ [ 0 , 2 π ] (See <xref ref-type="fig" rid="fig2">Figure 2</xref>, <xref ref-type="fig" rid="fig3">Figure 3</xref>(a) and <xref ref-type="fig" rid="fig3">Figure 3</xref>(b), <xref ref-type="fig" rid="fig4">Figure 4</xref> and <xref ref-type="fig" rid="fig5">Figure 5</xref>(a) and <xref ref-type="fig" rid="fig5">Figure 5</xref>(b)): the small-h region where the curve is a straight line with slope 2n, the medium-h region where we have a straight line of slope 2 n + 1 and the high-h region where the slope of the curve is not where defined. The length and endpoints of each region depend on the values of the integer n and the parameter α, which implies that sizes and endpoints of the three regions are dependent on both the oscillation frequency of the function and the number of points used in the approximation of the derivative. With the same function, but values of α which are neither integers nor half-integers, only two regions are observed: there is no medium-h region (See <xref ref-type="fig" rid="fig3">Figure 3</xref>(c) and <xref ref-type="fig" rid="fig3">Figure 3</xref>(d) and <xref ref-type="fig" rid="fig5">Figure 5</xref>(c) and <xref ref-type="fig" rid="fig5">Figure 5</xref>(d)). We have to add that all results obtained from forward differencing formulas fit with those of the corresponding backward formulas. Furthermore, no cases of medium-h region were reported for these two methods.</p><p>In an effort to better understand the origin of the medium-h region, we show the errors E [ 2 ] , C C ( h ) (<xref ref-type="fig" rid="fig2">Figure 2</xref>, <xref ref-type="fig" rid="fig4">Figure 4</xref>, <xref ref-type="fig" rid="fig3">Figure 3</xref>(a) and <xref ref-type="fig" rid="fig3">Figure 3</xref>(b) and <xref ref-type="fig" rid="fig5">Figure 5</xref>(a) and <xref ref-type="fig" rid="fig5">Figure 5</xref>(b)) defined as</p><p>E [ 2 ] , C C ( h ) = max i ∈ [ n ,   N x − n ] | f ( 2 ) ( x i ) − f i ( 2 ) | (24)</p><p>for a ( 2 n + 1 ) -point central difference approximation of the second derivative. We have to emphasize that E [ 2 ] , C C ( h ) is obtained from Equation (18) by omitting all points at which the central difference approximation for the second derivative is not valid. It is remarkable that any case of medium-h region is observed for E [ 2 ] , C C ( h ) , which means that this region is simply the consequence of asymmetric finite difference approximations of the derivative in question at some points (those at which the central difference formula is not valid).</p><p>Now consider the problem of estimating the slope of the line segment connecting two any consecutive points on each of the curves of Figures 2-5 for only central differencing formulas and integer or half-integer values of the parameter α. We used the expression p [ 2 ] ( h j ) to denote the value of the slope for the line segment whose endpoints are ( log ( h j − 1 ) , log ( E [ 2 ] , C ( h j − 1 ) ) ) and ( log ( h j ) , log ( E [ 2 ] , C ( h j ) ) ) :</p><p>p [ 2 ] ( h j ) = log ( E [ 2 ] , C ( h j ) ) − log ( E [ 2 ] , C ( h j − 1 ) ) log ( h j ) − log ( h j − 1 ) ,         h j = 2 π / N j , ​ ​ ​ ​     j ∈ [ 1 , N x ] . (25)</p><p>The plots of the functions highlighting p [ 2 ] ( h ) for several values of the parameter α are shown in <xref ref-type="fig" rid="fig6">Figure 6</xref> and <xref ref-type="fig" rid="fig7">Figure 7</xref>. We see the same three regions appearing in Figures 2-5. The numerically calculated starting values of the sampling period for the small-h region ( 5.99 ≤ p [ 2 ] ( h ) ≤ 6.01 for n = 3 and 3.99 ≤ p [ 2 ] ( h ) ≤ 4.01 for n = 2 ) are given in <xref ref-type="table" rid="table3">Table 3</xref> and <xref ref-type="table" rid="table4">Table 4</xref>, the values of h being listed in descending order.</p><p>A careful analysis of our numerical data presented in <xref ref-type="table" rid="table3">Table 3</xref> leads to the conclusion that the relationship between h s t a r t and α (integer or half-integer) can be described by the following simple formula:</p><p>h s t a r t ( α ) ≃ 2 π / r s t a r t ( α ) (26)</p><p>for the 5-point central difference approximation of f ″ ( x ) , where</p><p>r s t a r t = 1325.77 α . (27)</p><p>From the numerical data of <xref ref-type="table" rid="table4">Table 4</xref>, we found that the small-h region associated with the 7-point central difference approximation of f ″ ( x ) is such that</p><p>h s t a r t ( α ) ≃ 2 π / r ˜ s t a r t ( α ) (28)</p><p>with</p><p>r ˜ s t a r t ( α ) = 5780 α (29)</p><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> Starting values of the sampling period for the small-h region in the case where n = 2 (5-point central difference formula). Fifteen values of the parameter α are considered</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >α</th><th align="center" valign="middle" >0.5</th><th align="center" valign="middle" >1</th><th align="center" valign="middle" >1.5</th><th align="center" valign="middle" >2</th><th align="center" valign="middle" >2.5</th><th align="center" valign="middle" >3</th><th align="center" valign="middle" >4</th><th align="center" valign="middle" >5</th><th align="center" valign="middle" >6</th><th align="center" valign="middle" >7</th><th align="center" valign="middle" >8</th><th align="center" valign="middle" >9</th><th align="center" valign="middle" >10</th><th align="center" valign="middle" >20</th><th align="center" valign="middle" >40</th></tr></thead><tr><td align="center" valign="middle" >h s t a r t</td><td align="center" valign="middle" >2 π 663</td><td align="center" valign="middle" >2 π 1326</td><td align="center" valign="middle" >2 π 1989</td><td align="center" valign="middle" >2 π 2652</td><td align="center" valign="middle" >2 π 3315</td><td align="center" valign="middle" >2 π 3979</td><td align="center" valign="middle" >2 π 5305</td><td align="center" valign="middle" >2 π 6630</td><td align="center" valign="middle" >2 π 7957</td><td align="center" valign="middle" >2 π 9280</td><td align="center" valign="middle" >2 π 10606</td><td align="center" valign="middle" >2 π 11935</td><td align="center" valign="middle" >2 π 13260</td><td align="center" valign="middle" >2 π 26520</td><td align="center" valign="middle" >2 π 53030</td></tr></tbody></table></table-wrap><table-wrap id="table4" ><label><xref ref-type="table" rid="table4">Table 4</xref></label><caption><title> Starting values of the sampling period for the small-h region in the case where n = 3 (7-point central difference formula). Six values of the parameter α are considered</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >α</th><th align="center" valign="middle" >0.5</th><th align="center" valign="middle" >1</th><th align="center" valign="middle" >1.5</th><th align="center" valign="middle" >2</th><th align="center" valign="middle" >2.5</th><th align="center" valign="middle" >3</th></tr></thead><tr><td align="center" valign="middle" >h s t a r t</td><td align="center" valign="middle" >2 π 5780</td><td align="center" valign="middle" >2 π 11560</td><td align="center" valign="middle" >2 π 17340</td><td align="center" valign="middle" >2 π 23120</td><td align="center" valign="middle" >2 π 28900</td><td align="center" valign="middle" >2 π 34679</td></tr></tbody></table></table-wrap></sec><sec id="s5"><title>5. Conclusions</title><p>The focus of our work was to investigate the influence of forward and backward finite difference approximations on the orders of central difference approximations for the second derivative of a periodic function. First, we have briefly presented very practical closed-form expressions for the finite difference approximations of first and second derivatives based on Taylor series and found in the literature. Next, these expressions were used to obtain forward, backward and central difference formulas of several orders for the first two derivatives of any function of one variable. Thereafter, we have described one major method to determine numerically and graphically the order of a finite difference formula for the second derivative of a certain degree q. Finally, we have applied the method in question to the second derivative of the periodic function f ( x ) = sin ( α x ) with α &gt; 0 and x ∈ [ 0 , 2 π ] . The results obtained from this application led to the conclusion that any ( 2 n + 1 ) -point central difference formula for the second derivative of the considered periodic function is of order 2 n + 1 for medium values of the sampling period h and of order 2n for small values of this parameter in the case where it is necessary to use forward and backward approximations of the derivative of interest at some points belonging to a given grid of equally spaced points. Sizes and starting points of the small-h and the medium-h regions depend on h and α. There is no medium-h region when the parameter α is neither integer nor half-integer. Careful analysis of our numerical results led us to very simple formulas to describe relationships between the starting values of h for the small-h region and the α parameter in the cases of n = 2 and n = 3 , the values of h being listed in descending order.</p><p>One has to add that errors E [ 2 ] ( h ) defined by Equation (18) become too small to be well calculated when h is of very small magnitude and the parameter α not large ( α &lt; 4 ), unless the computation is performed with sufficiently high-precision. To deal with this problem, we appealed to a new software package for arbitrary precision computation, named MPFUN2020 and developed by David H. Bailey [<xref ref-type="bibr" rid="scirp.129548-ref14">14</xref>] .</p></sec><sec id="s6"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest.</p></sec><sec id="s7"><title>Cite this paper</title><p>Nyengeri, H., Sinzingayo, J.J., Dusabe, B. and Ndenzako, E. (2023) Effect of Asymmetric Finite Difference Formulas on the Orders of Central Difference Approximations for the Second Derivative of a Periodic Function. Open Access Library Journal, 10: e10875. https://doi.org/10.4236/oalib.1110875</p></sec></body><back><ref-list><title>References</title><ref id="scirp.129548-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Hassan, H.Z., Mohamad, A.A. and Atteia, G.E. (2012) An Algorithm for the Finite Difference Approximation of Derivatives With Arbitrary Degree and Order of Accuracy. Journal of Computational and Applied Mathematics, 256, 2622-2631.  
https://doi.org/10.1016/j.cam.2011.12.019</mixed-citation></ref><ref id="scirp.129548-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Li, J. (2005) General Explicit Formulas for Numerical. Journal of Computational and Applied Mathematics, 183, 29-52. https://doi.org/10.1016/j.cam.2004.12.026</mixed-citation></ref><ref id="scirp.129548-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Jordan, C. (1950) Calculus of Finite Differences. 2nd Edition, Springer, New York.  
https://doi.org/10.1017/S0025557200230271</mixed-citation></ref><ref id="scirp.129548-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Collatz, L. (1966) The Numerical Treatment of Differential Equations. 2nd Edition, Springer, Berlin.</mixed-citation></ref><ref id="scirp.129548-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Chapra, S.C. and Canale, R.P. (2010) Numerical Methods for Engineers. 6th Edition, McGraw-Hill, New York.  
https://ds.amu.edu.et/xmlui/bitstream/handle/123456789/17416/Numerical_methods_for_engineers.pdf?equence=1&amp;isAllowed=y</mixed-citation></ref><ref id="scirp.129548-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Hoffman, J.D. (2001) Numerical Methods for Engineers and Scientists. 2nd Edition, Marcel Dekker, New York.  
http://freeit.free.fr/Finite%20Element/Hoffman,_Numerical_Methods_for_Engineers&amp;Scientists,2001.pdf</mixed-citation></ref><ref id="scirp.129548-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Khan, I.R. and Ohba, R. (2003) Taylor Series Based Finite of Difference Approximations of Higher-Degree Derivatives. Journal of Computational and Applied Mathematics, 154, 115-124. https://doi.org/10.1016/S0377-0427(02)00816-6</mixed-citation></ref><ref id="scirp.129548-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Dahlquist, G. and Bjorck, A. (1974) Numerical Methods. Prentice Hall, Englewood Cliffs. https://doi.org/10.1137/1.9780898717785</mixed-citation></ref><ref id="scirp.129548-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Burden, R.L. and Faires, J.D. (1993) Numerical Analysis. 5th Edition, PWS-Kent Pub. Co., Boston.</mixed-citation></ref><ref id="scirp.129548-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Gerald, C.F. and Wheatley, P.O. (1994) Applied Numerical Analysis. 5th Edition, Addison-Wesley, Michigan.</mixed-citation></ref><ref id="scirp.129548-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Robert, D.V. (2009) An Improved Numerical Approximation for First Derivative. Journal of Chemical Sciences, 121, 935-950.  
https://www.ias.ac.in/article/fulltext/jcsc/121/05/0935-0950</mixed-citation></ref><ref id="scirp.129548-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Khan, I.R. and Ohba, R. (1999) New Finite Difference Formulas for Numerical Differentiation. Journal of Computational and Applied Mathematics, 126, 269-276.  
https://doi.org/10.1016/S0377-0427(99)00358-1</mixed-citation></ref><ref id="scirp.129548-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Khan, I.R. and Ohba, R. (1999) Closed-Form Expressions for Finite Difference Approximations of First and Higher Derivatives Based on Taylor Series. Journal of Computational and Applied Mathematics, 107, 179-193.  
https://doi.org/10.1016/S0377-0427(99)0088-6</mixed-citation></ref><ref id="scirp.129548-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Bailey, D.H. (2023) MPFUN2020: A Thread-Safe Arbitrary Precision Package with Special Functions (Full Documentation).  
https://www.davidhbailey.com/dhbpapers/mpfun2020.pdf</mixed-citation></ref></ref-list></back></article>