Taylor Polynomials I

Part 1. Polynomial Coefficients

Answer to questions in Part 1:

One at a time, determine appropriate values for the coefficients (Subscript[a, 0]), ..., (Subscript[a, 4]), and replace the 0's in the following definitions.  With each new definition of q[x], the plot will be automatic when you enter the following block of commands.  Compare with the graph of p[x] in the web page.

a[0]  =  45;
a[1]  =  40;
a[2]  = -60;
a[3]  = 15;
a[4]  = -1;
q[x_] :=  
        a[0] + a[1]*x + a[2]*x^2 + a[3]*x^3 + 
          a[4]*x^4;
Plot[q[x], {x, -2,  10}, 
        PlotRange -> {-600, 200}];

Part 2. Polynomial Approximations to (e^x)

Answers to questions 1 and 2:

Enter functions and coefficients here, and plot f and p together.

f[x_] :=  Exp[x];
a[0]  =  1;
a[1]  =  1;
a[2]  =  1/2;
a[3]  =  1/6;
a[4]  =  1/24;
p[x_] :=  
        a[0] + a[1]*x + a[2]*x^2 + a[3]*x^3 + 
          a[4]*x^4;
plot1  =  
        Plot[f[x], {x, -3, 3},  PlotRange -> {-2, 16},  
          PlotStyle ->  RGBColor[0, 0, 1],  
          DisplayFunction -> Identity];
plot2  =  
        Plot[p[x], {x, -3, 3},  PlotRange -> {-2, 16},  
          PlotStyle ->  RGBColor[1, 0, 0],  
          DisplayFunction -> Identity];
Show[plot1, plot2,  
        DisplayFunction -> $DisplayFunction];

Plot the error function, and answer question 4.

Plot[f[x] - p[x], {x, -3, 3},  
        PlotRange -> {-1, 1}];

Answer to question 4:

Answer to question 5:

Part 3. Polynomial Approximations to Sin[x]

Answers to questions 1 and 2:

Enter functions and coefficients here, and plot g and p together.

g[x_] :=  Sin[x];
a[0]  =  0;
a[1]  =  1;
a[2]  =  0;
a[3]  =  -1/6;
a[4]  =  0;
a[5]  =  1/20;
p[x_] :=  
        a[0] + a[1]*x + a[2]*x^2 + a[3]*x^3 + 
          a[4]*x^4;
plot1  =  
        Plot[g[x], {x, -Pi, Pi} ,  PlotRange -> {-2, 2}, 
          PlotStyle -> RGBColor[0, 0, 1],  
          DisplayFunction -> Identity];
plot2  =  
        Plot[p[x], {x, -Pi, Pi} ,  PlotRange -> {-2, 2}, 
          PlotStyle -> RGBColor[1, 0, 0],  
          DisplayFunction -> Identity];
Show[plot1, plot2,  
        DisplayFunction -> $DisplayFunction];

Plot the error function, and answer question 4.

Plot[g[x] - p[x], {x, -Pi, Pi}];

Answer to question 4:

Answer to question 5:

Part 4. Summary

Answers to the summary questions: