Derivatives of any size (the hard case)

Now, let's look at something a little more challenging.  Let's look at the base function for a normal distribution:  [Graphics:../Images/index_gr_46.gif].  We would like to approximate this function using a [Graphics:../Images/index_gr_47.gif] degree Taylor series, but we need to find out what domain this falls within our error tolerence.  (That way, we can do things like integrate it and use it in differential equations.)  

[Graphics:../Images/index_gr_48.gif]

I defined an xDomain here, even though we are trying to determine this.  This is for two reasons:
1)  To draw the graphs
2)  Because there is no way to determine the maximum value of the [Graphics:../Images/index_gr_49.gif] derivative without choosing an interval.  If you find the domain of our Taylor series extends outside this interval, you should make the xDomain larger and recompute the domain.

The problem here is that the derivatives are not bounded over our interval (or much of any interval, actually).  Let's examine the first 10 derivatives over our domain:

[Graphics:../Images/index_gr_50.gif]

[Graphics:../Images/index_gr_51.gif]

[Graphics:../Images/index_gr_52.gif]

[Graphics:../Images/index_gr_53.gif]

[Graphics:../Images/index_gr_54.gif]

[Graphics:../Images/index_gr_55.gif]

[Graphics:../Images/index_gr_56.gif]

[Graphics:../Images/index_gr_57.gif]

[Graphics:../Images/index_gr_58.gif]

[Graphics:../Images/index_gr_59.gif]

[Graphics:../Images/index_gr_60.gif]

[Graphics:../Images/index_gr_61.gif]

[Graphics:../Images/index_gr_62.gif]

[Graphics:../Images/index_gr_63.gif]

[Graphics:../Images/index_gr_64.gif]

[Graphics:../Images/index_gr_65.gif]

[Graphics:../Images/index_gr_66.gif]

[Graphics:../Images/index_gr_67.gif]

[Graphics:../Images/index_gr_68.gif]

[Graphics:../Images/index_gr_69.gif]

[Graphics:../Images/index_gr_70.gif]

[Graphics:../Images/index_gr_71.gif]

[Graphics:../Images/index_gr_72.gif]

Thus the maxNthDerivValue gets huge in this case (and depends on the value of n).  Ugh.

The following function attempts to use the Mathematica FindMinimum function to find the maximum value of the absolute value of the [Graphics:../Images/index_gr_73.gif] derivative of [Graphics:../Images/index_gr_74.gif].  Unfortunately, in the most general case, this cannot be relied on to find the absolute maximum all the time (I built in a few tricks to try to find it more often).  It is important that if you use this to compute an error bound, you should check the graph of the [Graphics:../Images/index_gr_75.gif] derivative that you decide to use to make sure you haven't missed anything important.  (It is not crucial for you to understand the details of this function.)

[Graphics:../Images/index_gr_76.gif]
[Graphics:../Images/index_gr_77.gif]
[Graphics:../Images/index_gr_78.gif]
[Graphics:../Images/index_gr_79.gif]
[Graphics:../Images/index_gr_80.gif]

We can now graph the function, Taylor series, and errors for different values of n.  (Ignore the error messages.)

[Graphics:../Images/index_gr_81.gif]
[Graphics:../Images/index_gr_82.gif]
[Graphics:../Images/index_gr_83.gif]
[Graphics:../Images/index_gr_84.gif]
[Graphics:../Images/index_gr_85.gif]

[Graphics:../Images/index_gr_86.gif]

[Graphics:../Images/index_gr_87.gif]
[Graphics:../Images/index_gr_88.gif]

[Graphics:../Images/index_gr_89.gif]

[Graphics:../Images/index_gr_90.gif]
[Graphics:../Images/index_gr_91.gif]

[Graphics:../Images/index_gr_92.gif]

[Graphics:../Images/index_gr_93.gif]

[Graphics:../Images/index_gr_94.gif]

[Graphics:../Images/index_gr_95.gif]

[Graphics:../Images/index_gr_96.gif]

[Graphics:../Images/index_gr_97.gif]

[Graphics:../Images/index_gr_98.gif]

[Graphics:../Images/index_gr_99.gif]

[Graphics:../Images/index_gr_100.gif]

[Graphics:../Images/index_gr_101.gif]

[Graphics:../Images/index_gr_102.gif]

[Graphics:../Images/index_gr_103.gif]

[Graphics:../Images/index_gr_104.gif]

[Graphics:../Images/index_gr_105.gif]

[Graphics:../Images/index_gr_106.gif]

[Graphics:../Images/index_gr_107.gif]

[Graphics:../Images/index_gr_108.gif]

[Graphics:../Images/index_gr_109.gif]

[Graphics:../Images/index_gr_110.gif]
Why does it seem that the Taylor series here only changes every [Graphics:../Images/index_gr_111.gif] degree (i.e., 3 and 4 look the same, 5 and 6 look the same, etc.)?  Are they really the same, or just "close"?

In order to find the domain that keeps the error less than [Graphics:../Images/index_gr_112.gif], we must solve:

[Graphics:../Images/index_gr_113.gif]
[Graphics:../Images/index_gr_114.gif]
[Graphics:../Images/index_gr_115.gif]

Recall what I said above about the necessity of checking that maxNthDerivValue is accurate for this degree Taylor series.  Let's compare the maximum value of the absolute value of the derivative we are using here ([Graphics:../Images/index_gr_116.gif]) with a graph of that derivative:

[Graphics:../Images/index_gr_117.gif]
[Graphics:../Images/index_gr_118.gif]
[Graphics:../Images/index_gr_119.gif]

[Graphics:../Images/index_gr_120.gif]

[Graphics:../Images/index_gr_121.gif]
Did it work?  What is the domain and radius of convergence?
Answer


Converted by Mathematica      May 12, 2003