8.9 Applications of Taylor Polynomials

Mathematica script by Chris Parrish,
   cparrish@sewanee.edu

Sources and references for some of these problems include
    James Stewart, "Calculus: Concepts and Contexts," Second Edition, Brooks/Cole, 2001
    Deborah Hughes-Hallett, Andrew M. Gleason, et. al., "Calculus," Second Edition, John Wiley & Sons, 1998
    Robert Fraga, ed., "Calculus Problems for a New Century," The Mathematical Association of America, 1993
    Selwyn Hollis, "CalcLabs with
Mathematica" for Stewart's "Single Variable Calculus, Concepts and Contexts, Second Edition," Brooks/Cole, 2001

3rd-degree Taylor polynomial for Log[1 + 2x]
Centered on x = 1

Stewart, 8.9.16, page 633

Let's find the 3rd degree Taylor Polynomial for ln(1+2x) centered on x = 1.

In[459]:=

<<Graphics`Colors`

In[460]:=

Clear[f,taylor3,x,x0,a,b,n,max,error,errorBound]

x0 = 1;
n =3;

f[x_] := Log[1 + 2x]

taylor3[x_] = Normal[Series[f[x],{x,x0,n}]]

Out[464]=

2/3 (-1 + x) - 2/9 (-1 + x)^2 + 8/81 (-1 + x)^3 + Log[3]

In[465]:=

a = -0.5;
b = 5;

Plot[{f[x],taylor3[x]},{x,a,b},
     PlotLabel -> "Taylor Polynomial Approximation",
     PlotStyle ->{Orchid,ForestGreen}];

[Graphics:HTMLFiles/8.9_applications_3.gif]

If we confine x to the interval [0.5,1.5] then |x - 1| <= 0.5, so by Taylor's Inequality, we have ...

In[468]:=

RowBox[{error,  , ≤,  , RowBox[{max,  , *,  , RowBox[{RowBox[{0.5, ^, 4}], /, 4 !}]}]}]

Out[468]=

RowBox[{error, ≤, RowBox[{0.00260417,  , max}]}]

... where "max" is an upper bound for the fourth derivative of f over the interval [0.5,1.5].

In[469]:=

RowBox[{RowBox[{Plot, [, RowBox[{f''''[x], ,, RowBox[{{, RowBox[{x, ,, 0.5, ,, 1.5}], }}], ,, , PlotStyleMarsOrange, ,, , PlotRangeAll}], ]}], ;}]

[Graphics:HTMLFiles/8.9_applications_7.gif]

It seems that the largest (negative) value for f'''' over the interval [0.5,1.5] is taken on at the endpoint x = 0.5.

In[470]:=

RowBox[{max,  , =,  , RowBox[{Abs, [, RowBox[{f'''', [, 0.5, ]}], ]}]}] RowBox[{RowBox[{errorB ... p;, RowBox[{max,  , *,  , RowBox[{RowBox[{0.5, ^, 4}], /, 4 !}]}]}], ;}] error ≤ errorBound

Out[470]=

6.

Out[472]=

RowBox[{error, ≤, 0.015625}]

Let's check that result by graphing the absolute value of the difference of f(x) and that particular Taylor Polynomial over the interval [0.5,1.5].

In[473]:=

r3[x_] := Abs[f[x] - taylor3[x]]  RowBox[{RowBox[{Plot, [, RowBox[{r3[x], ,, RowBox[{{ ... , PlotLabel->"Abs[f[x] - taylor3[x]]", ,, , PlotRangeAll}], ]}], ;}]

[Graphics:HTMLFiles/8.9_applications_12.gif]

The largest actual error over the interval [0.5,1.5] occurs at the endpoint x = 0.5.

In[475]:=

RowBox[{RowBox[{RowBox[{c,  , =,  , 0.5}], ;}], }] actualError = Abs[f[c] - taylor3[c]]

Out[476]=

0.00423054

That largest actual error is considerably less than the upper bound for the error that we obtained from Taylor's Inequality.

In[477]:=

Print["actualError = ", actualError, " ≤ ", errorBound, " = errorBound"]

RowBox[{actualError = , , 0.00423054, ,  ≤ , , 0.015625, ,  = errorBound}]


Created by Mathematica  (May 5, 2004)