Taylor Polynomials II

Part 1. Geometric Polynomials

Enter the function f.

f[x_] :=  1/(1 - x);

Mathematica's Series command generates a Taylor polynomial expanded about a given point.  The syntax for generating the n-th order Taylor about the point (Subscript[x, 0]) is Series[f, {x, (Subscript[x, 0]), n}].  By changing n, you can find as many Taylor polynomials as you wish.

Series[f[x], {x, 0, 1}]

For step 2, enter and check your conjecture using the input cell below.

The next commands calculate (∑_(k = 0)^n) (x^k).  Enter your explanation after you see the result.

Sum[x^k, {k, 0, n}] // Simplify

Explanation:

Part 2. Convergence and Divergence

Answer question 1 here.

The function f is already defined.  Enter the Taylor polynomials here, one at a time, and plot all of the functions together.  As you replace "0" by each proper definition, you see one more approximating polynomial added to the picture.  If necessary, enlarge the plot box so you can see clearly what is happening at each step.  Then answer question 2 in the text cell below.

p0[x_] :=  1;
p1[x_] :=  0;
p2[x_] :=  0;
p3[x_] :=  0;
p4[x_] :=  0;
p5[x_] :=  0;
plotf  =  
        Plot[f[x], {x, -2, 2}, PlotRange -> {-5, 7}, 
          PlotStyle -> RGBColor[0, 0, 1], 
          DisplayFunction -> Identity];
plotp0  =  
        Plot[p0[x], {x, -2, 2}, PlotRange -> {-5, 7}, 
          PlotStyle -> CMYKColor[1, 0, 0, 0], 
          DisplayFunction -> Identity];
plotp1  =  
        Plot[p1[x], {x, -2, 2}, PlotRange -> {-5, 7}, 
          PlotStyle -> CMYKColor[0, 1, 0, 0], 
          DisplayFunction -> Identity];
plotp2  =  
        Plot[p2[x], {x, -2, 2}, PlotRange -> {-5, 7}, 
          PlotStyle -> RGBColor[0, 1, 0], 
          DisplayFunction -> Identity];
plotp3  =  
        Plot[p3[x], {x, -2, 2}, PlotRange -> {-5, 7}, 
          PlotStyle -> CMYKColor[0.8, 0.8, 1, 0], 
          DisplayFunction -> Identity];
plotp4  =  
        Plot[p4[x], {x, -2, 2}, PlotRange -> {-5, 7}, 
          PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
plotp5  =  
        Plot[p5[x], {x, -2, 2}, PlotRange -> {-5, 7}, 
          DisplayFunction -> Identity];
Show[plotf, plotp0, plotp1, plotp2, plotp3, plotp4, plotp5, 
        DisplayFunction -> $DisplayFunction];

Answer to question 2:

Next we use the summation formula to plot Taylor polynomials of high degree.  We also plot the error f[x]-(Subscript[p, n])[x]  in the approximation.  Change n as necessary, and then answer question 3.

n  =  20;
p[x_] :=  (1 - x^(n + 1))/(1 - x); 
plotf  =  
        Plot[f[x], {x, -1.2, 1.2}, PlotStyle -> RGBColor[0, 0, 1], 
          DisplayFunction -> Identity];
plotpn  =  
        Plot[p[x], {x, -1.2, 1.2}, PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
Show[plotf, plotpn, PlotRange -> {-10, 10}, 
        DisplayFunction -> $DisplayFunction];

Plot[f[x] - p[x], {x, -1.2, 1.2}, 
        PlotRange -> {-0.01, 0.01}];

Answer to question 3:

Answer to question 4:

Answer to question 5:

Part 3. New Polynomials from Old

Calculate the Taylor polynomials of (1/(1  +  t)).  Vary the degree as necessary.

Series[1/(1 + t), {t, 0, 1}]

Answer question 2 here.

Part 4. Polynomial Approximations to Log[1+x]

Answer question 1 here.

Enter g[x], and calculate appropriate taylor polynomials.

g[x_] :=  Log[1 + x];

Series[g[x], {x, 0, 2}]

Enter the n-th Taylor polynomial here, and plot it together with g.  (Add additional terms one at a time to the definition of p.)  Also plot the error function g[x]-p[x].  If necessary, enlarge the plot boxes so you can see clearly what is happening at each step.  Then answer question 3 in the text cell below.

p[x_] :=  x;
plotg  =  
        Plot[g[x], {x, -2, 2}, PlotStyle -> RGBColor[0, 0, 1], 
          DisplayFunction -> Identity];
plotpn  =  
        Plot[p[x], {x, -2, 2}, PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
Show[plotg, plotpn, 
        DisplayFunction -> $DisplayFunction];

Plot[g[x] - p[x], {x, -1.2, 1.2}, 
        PlotRange -> {-0.01, 0.01}];

Answer to question 3:

The following commands define a Taylor polynomial for step 4.  Construct the polynomial p by pasting the output from the Series command and deleting the O[(x^(n + 1))] term.  Make sure that in selecting the expression, the whole expression is not immediately highlighted.  Place the cursor directly on the first term so that you can highlight successive terms, else Mathematica will include the O[(x^(n + 1))] term even though you delete it later.  Vary n as necessary.

n  =  10;
Series[g[x], {x, 0, n + 1}]

p[x_] :=  ?;

The following commands construct the plots for step 4.  After you have done the required plots, answer the questions in step 4.

plotg  =  
        Plot[g[x], {x, -2, 2}, PlotStyle -> RGBColor[0, 0, 1], 
          DisplayFunction -> Identity];
plotpn  =  
        Plot[p[x], {x, -2, 2}, PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
Show[plotg, plotpn, PlotRange -> {-10, 10}, 
        DisplayFunction -> $DisplayFunction];

Plot[g[x] - p[x], {x, -1.2, 1.2}, 
        PlotRange -> {-0.01, 0.01}];

Answer to the question in step 4:

Answer to the question in step 5:

Part 5. Polynomial Approximations to ArcTan[x]

Answers to questions 1, 2, and 3:

Do any necessary calculations using the input cell below.

Use the following command to confirm your Taylor polynomials.  Change the degree as necessary.

Series[ArcTan[x], {x, 0, 2}]

Enter the n-th Taylor polynomial here, and plot it together with the arctangent function.  (Add additional terms one at a time to the definition of p.) Also plot the error function g[x]-p[x].  If necessary, enlarge the plot boxes so you can see clearly what is happening at each step.  Then answer question 4.

p[x_] :=  x;
plotg  =  
        Plot[ArcTan[x], {x, -2, 2}, PlotStyle -> RGBColor[0, 0, 1], 
          DisplayFunction -> Identity];
plotpn  =  
        Plot[p[x], {x, -2, 2}, PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
Show[plotg, plotpn, 
        DisplayFunction -> $DisplayFunction];

Plot[ArcTan[x] - p[x], {x, -1.2, 1.2}, 
        PlotRange -> {-0.01, 0.01}];

Answer to question 4:

The following commands define a Taylor polynomial for step 5.  Construct the polynomial p by pasting the output from the Series command and deleting the O[(x^(n + 1))] term.  Make sure that in selecting the expression, the whole expression is not immediately highlighted.  Place the cursor directly on the first term so that you can highlight successive terms, else Mathematica will include the O[(x^(n + 1))] term even though you delete it later.  Vary n as necessary.

n  =  10;
Series[ArcTan[x], {x, 0, n + 1}]

p[x_] :=  ?;

The following commands construct the plots for step 5. After you have done the required plots, answer the questions in step 5.

plotpn  =  
        Plot[p[x], {x, -2, 2}, PlotStyle -> RGBColor[1, 0, 0], 
          DisplayFunction -> Identity];
Show[plotg, plotpn, 
        DisplayFunction -> $DisplayFunction];

Plot[ArcTan[x] - p[x], {x, -1.2, 1.2}, 
        PlotRange -> {-0.01, 0.01}];

Answers to the questions in step 5:

Part 6. Summary

Answers to the summary questions: