Module for Numerical Differentiation, Part I

Check out the new Numerical Analysis Projects page.

 

Background. Numerical differentiation formulas formulas can be derived by first constructing the Lagrange interpolating polynomial  [Graphics:Images/NumericalDiffMod_gr_1.gif] through three points, differentiating the Lagrange polynomial, and finally evaluating  [Graphics:Images/NumericalDiffMod_gr_2.gif]  at the desired point.  The truncation error will be investigated, but round off error from computer arithmetic using computer numbers will be studied in another lab.

Three point rule for [Graphics:Images/NumericalDiffMod_gr_3.gif].  The centered formula for  the first derivative, based on three points is  

    [Graphics:Images/NumericalDiffMod_gr_4.gif],  

and the error bound is  [Graphics:Images/NumericalDiffMod_gr_5.gif]  where  [Graphics:Images/NumericalDiffMod_gr_6.gif].  
 

Proof of the Three point rule for f '

Big "O" error term for [Graphics:Images/NumericalDiffMod_gr_23.gif].  

    [Graphics:Images/NumericalDiffMod_gr_24.gif].   

Three point rule for [Graphics:Images/NumericalDiffMod_gr_25.gif].  The centered formula for the second derivative, based on three points is  [Graphics:Images/NumericalDiffMod_gr_26.gif],  

and the error bound is  [Graphics:Images/NumericalDiffMod_gr_27.gif]  where  [Graphics:Images/NumericalDiffMod_gr_28.gif].  
 

Proof of the Three point rule for f ''

Big "O" error term for [Graphics:Images/NumericalDiffMod_gr_45.gif].  

    [Graphics:Images/NumericalDiffMod_gr_46.gif] [Graphics:Images/NumericalDiffMod_gr_47.gif].  

Animations (Numerical Differentiation  Numerical Differentiation).  Internet hyperlinks to animations.

Project I.  Investigate the numerical differentiation formula  [Graphics:Images/NumericalDiffMod_gr_48.gif]  and error bound  [Graphics:Images/NumericalDiffMod_gr_49.gif]  where  [Graphics:Images/NumericalDiffMod_gr_50.gif].   The truncation error is investigated.  The round off error from computer arithmetic using computer numbers will be studied in another module.

Enter the three point formula for numerical differentiation.

 

[Graphics:Images/NumericalDiffMod_gr_51.gif]

[Graphics:Images/NumericalDiffMod_gr_52.gif]

Aside.  From a mathematical standpoint, we expect that the limit of the difference quotient is the derivative. Such is the case, check it out.

[Graphics:Images/NumericalDiffMod_gr_53.gif]

[Graphics:Images/NumericalDiffMod_gr_54.gif]

Enter the function, use  [Graphics:Images/NumericalDiffMod_gr_55.gif].

[Graphics:Images/NumericalDiffMod_gr_56.gif]

[Graphics:Images/NumericalDiffMod_gr_57.gif]

Example 1.  Find the formula for the third derivative  [Graphics:Images/NumericalDiffMod_gr_58.gif].  
Use  [Graphics:Images/NumericalDiffMod_gr_59.gif].

Solution 1.

 

Example 2.  Graph  [Graphics:Images/NumericalDiffMod_gr_67.gif].  Find the bound  [Graphics:Images/NumericalDiffMod_gr_68.gif].  Look at a graph and estimate the value  [Graphics:Images/NumericalDiffMod_gr_69.gif], be sure to take the absolute value if necessary.

Solution 2.

 

Example 3 (a).  Compute numerical approximations for the derivative  [Graphics:Images/NumericalDiffMod_gr_81.gif],  using step sizes  [Graphics:Images/NumericalDiffMod_gr_82.gif].  
3 (b).  Compute numerical approximations for the derivatives [Graphics:Images/NumericalDiffMod_gr_83.gif],  using step sizes [Graphics:Images/NumericalDiffMod_gr_84.gif].  
3 (c).  Plot the numerical approximation  [Graphics:Images/NumericalDiffMod_gr_85.gif] over the interval  [Graphics:Images/NumericalDiffMod_gr_86.gif].  Compare it with the graph of  [Graphics:Images/NumericalDiffMod_gr_87.gif]  over the interval  [Graphics:Images/NumericalDiffMod_gr_88.gif].

Solution 3.

 

Example 4.  Plot the absolute error  [Graphics:Images/NumericalDiffMod_gr_147.gif]  over the interval  [Graphics:Images/NumericalDiffMod_gr_148.gif],  and estimate the maximum absolute error over the interval.
4 (a).  Compute the error bound  [Graphics:Images/NumericalDiffMod_gr_149.gif]  and observe that  [Graphics:Images/NumericalDiffMod_gr_150.gif]  over  [Graphics:Images/NumericalDiffMod_gr_151.gif].  
4 (b).  Since we the function f[x] and its derivative is well known, and we have the graph for [Graphics:Images/NumericalDiffMod_gr_152.gif],  we can observe that the maximum error on the given interval occurs at x=0.  Thus we can do better that "theory", we see that [Graphics:Images/NumericalDiffMod_gr_153.gif]  over  [Graphics:Images/NumericalDiffMod_gr_154.gif].

Solution 4.

 

Example 5.  Investigate the behavior of  [Graphics:Images/NumericalDiffMod_gr_169.gif].  If the step size is reduced by a factor of  [Graphics:Images/NumericalDiffMod_gr_170.gif]  then the error bound is reduced by  [Graphics:Images/NumericalDiffMod_gr_171.gif].  This is the  [Graphics:Images/NumericalDiffMod_gr_172.gif]  behavior.
 

Solution 5.

 

Project II.  Investigate the numerical differentiation formulae  [Graphics:Images/NumericalDiffMod_gr_191.gif]  and error bound  [Graphics:Images/NumericalDiffMod_gr_192.gif]  where  [Graphics:Images/NumericalDiffMod_gr_193.gif].  The truncation error is investigated.  The round off error from computer arithmetic using computer numbers will be studied in another module.

Enter the formula for numerical differentiation.

[Graphics:Images/NumericalDiffMod_gr_194.gif]

[Graphics:Images/NumericalDiffMod_gr_195.gif]

Aside.  It looks like the formula is a second divided difference, i.e. the difference quotient of two difference quotients.  Such is the case.

[Graphics:Images/NumericalDiffMod_gr_196.gif]

[Graphics:Images/NumericalDiffMod_gr_197.gif]

Aside.  From a mathematical standpoint, we expect that the limit of the second divided difference is the second derivative. Such is the case.

[Graphics:Images/NumericalDiffMod_gr_198.gif]

[Graphics:Images/NumericalDiffMod_gr_199.gif]

Enter the function, use  [Graphics:Images/NumericalDiffMod_gr_200.gif].

[Graphics:Images/NumericalDiffMod_gr_201.gif]

[Graphics:Images/NumericalDiffMod_gr_202.gif]

Example 6.  Find the formula for the fourth derivative of f(x).
Use  [Graphics:Images/NumericalDiffMod_gr_203.gif].

Solution 6.

 

Example 7.  Graph  [Graphics:Images/NumericalDiffMod_gr_212.gif].  Find the bound  [Graphics:Images/NumericalDiffMod_gr_213.gif].  Look at a graph and estimate the value  [Graphics:Images/NumericalDiffMod_gr_214.gif],  be sure to take the absolute value if necessary.

Solution 7.

Example 8 (a).  Compute numerical approximations for the derivatives [Graphics:Images/NumericalDiffMod_gr_228.gif],  using step sizes [Graphics:Images/NumericalDiffMod_gr_229.gif] .  
8 (b).  Plot the numerical approximation  [Graphics:Images/NumericalDiffMod_gr_230.gif] over the interval  [Graphics:Images/NumericalDiffMod_gr_231.gif].  Compare it with the graph of  [Graphics:Images/NumericalDiffMod_gr_232.gif]  over the interval  [Graphics:Images/NumericalDiffMod_gr_233.gif]

Solution 8.

 

Example 9.  Plot the absolute error  [Graphics:Images/NumericalDiffMod_gr_260.gif]  over the interval  [Graphics:Images/NumericalDiffMod_gr_261.gif],  and estimate the maximum absolute error over the interval.  
9 (a).  Compute the error bound  [Graphics:Images/NumericalDiffMod_gr_262.gif]  and observe that  [Graphics:Images/NumericalDiffMod_gr_263.gif]  over  [Graphics:Images/NumericalDiffMod_gr_264.gif].  
9 (b).  Since we the function f[x] and its derivative is well known, and we have the graph for [Graphics:Images/NumericalDiffMod_gr_265.gif],  we can observe that the maximum error on the given interval occurs at x=0.  Thus we can do better that "theory", we see that [Graphics:Images/NumericalDiffMod_gr_266.gif]  over  [Graphics:Images/NumericalDiffMod_gr_267.gif].

Solution 9.

 

Example 10.  Investigate the behavior of  [Graphics:Images/NumericalDiffMod_gr_287.gif].  If the step size is reduced by a factor of  [Graphics:Images/NumericalDiffMod_gr_288.gif]  then the error bound is reduced by  [Graphics:Images/NumericalDiffMod_gr_289.gif].  This is the  [Graphics:Images/NumericalDiffMod_gr_290.gif]  behavior.

Solution 10.

 

Old Lab Project (Numerical Differentiation  Numerical Differentiation).  Internet hyperlinks to an old lab project.  

 

Research Experience for Undergraduates

Numerical Differentiation  Numerical Differentiation  Internet hyperlinks to web sites and a bibliography of articles.  
  

Downloads (Numerical Differentiation Numerical Differentiation).  

Download this Mathematica notebook.  

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003