8.7.3 Finding and Using Taylor Series

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

Problems from Hughes-Hallett, Gleason, et al.

Taylor polynomials for -Log[1 - 2x] near x = 0

Hughes-Hallett, Gleason, et al, Second Edition, HHG IM 9.3.4

In[367]:=

Clear[f,taylor,x,x0,a,b,n]

x0 = 0;

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

taylor5[x_] = Normal[Series[f[x],{x,x0,5}]];
taylor10[x_] = Normal[Series[f[x],{x,x0,10}]];
taylor15[x_] = Normal[Series[f[x],{x,x0,15}]];
taylor20[x_] = Normal[Series[f[x],{x,x0,20}]]

Out[373]=

2 x + 2 x^2 + (8 x^3)/3 + 4 x^4 + (32 x^5)/5 + (32 x^6)/3 + (128 x^7)/7 + 32 x^8 + (512 x^9)/9 ... 768 x^15)/15 + 4096 x^16 + (131072 x^17)/17 + (131072 x^18)/9 + (524288 x^19)/19 + (262144 x^20)/5

In[374]:=

a = -0.8;
b = 0.499;

Plot[{f[x],taylor5[x],taylor10[x],taylor15[x],taylor20[x]},{x,a,b},
     PlotLabel -> "Taylor Polynomial Approximations",
     PlotStyle -> {Red,Green,ForestGreen,Blue,Indigo}];

[Graphics:HTMLFiles/8.7.3_usingTaylorSeries_2.gif]

Let's just plot the polynomials, in order to get beyond the point where f[x] blows up.

In[377]:=

a = -0.8;
b = +0.8;

Plot[{taylor5[x],taylor10[x],taylor15[x],taylor20[x]},{x,a,b},
     PlotLabel -> "Taylor Polynomial Approximations",
     PlotStyle -> {Green,ForestGreen,Blue,Indigo}];

[Graphics:HTMLFiles/8.7.3_usingTaylorSeries_3.gif]

Some Taylor polynomials near x = 0

Hughes-Hallett, Gleason, et al, Second Edition, 9.3.15, page 449

In[380]:=

Clear[f, g, h, k, taylor, x, x0, a, b, n] <br /> x0 = 0 ; <br /> f[x_] := 1/(1 - x^2)  ... }]] taylorH[x_] = Normal[Series[h[x], {x, x0, 2}]] taylorK[x_] = Normal[Series[k[x], {x, x0, 2}]]

Out[386]=

1 + x^2

Out[387]=

1 + x/4 - (3 x^2)/32

Out[388]=

1 + x/4 - x^2/32

Out[389]=

1 + x/2 + (3 x^2)/8

In[390]:=

a = -2;
b = 2;

Plot[{taylorF[x],taylorG[x],taylorH[x],taylorK[x]},{x,a,b},
     PlotLabel -> "Taylor Polynomials",
     PlotStyle -> {Green,ForestGreen,Blue,Indigo}];

[Graphics:HTMLFiles/8.7.3_usingTaylorSeries_9.gif]

Who's who?

Taylor polynomial for Exp[-x^2] and 1/(1 + x^2) near x = 0

Hughes-Hallett, Gleason, et al, Second Edition, 9.3.16, page 449

In[393]:=

Clear[f, g, taylor, x, x0, a, b, n] <br /> x0 = 0 ; n = 10 ; <br /> f[x_] := Exp[-x^2] g[x_] : ...  /> taylorF[x_] = Normal[Series[f[x], {x, x0, n}]] taylorG[x_] = Normal[Series[g[x], {x, x0, n}]]

Out[398]=

1 - x^2 + x^4/2 - x^6/6 + x^8/24 - x^10/120

Out[399]=

1 - x^2 + x^4 - x^6 + x^8 - x^10

In[400]:=

a = -1;
b = 1;

Plot[{taylorF[x],taylorG[x]},{x,a,b},
     PlotLabel -> "Taylor Polynomial Approximation",
     PlotStyle -> {Green,ForestGreen}];

[Graphics:HTMLFiles/8.7.3_usingTaylorSeries_15.gif]

Taylor polynomial for 1/(2+x) in terms of x^2

Hughes-Hallett, Gleason, et al, Second Edition, 9.3.17, page 449

In[403]:=

Clear[f,taylor,x,x0,a,b,n]

x0 = 0;
n = 4;

f[x_] := 1/(2 + x)

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

Out[407]=

1/2 - x/4 + x^2/8 - x^3/16 + x^4/32

In[408]:=

g[x_] := 1/(1 + x^2)  taylorG[x_] = Normal[Series[g[x], {x, x0, n}]]

Out[409]=

1 - x^2 + x^4


Created by Mathematica  (May 5, 2004)