Question: This problem of the coding assignment will be graded manually ) The third order Taylor polynomial centered at x = 0 approximating f ( x

This problem of the coding assignment will be graded manually)
The third order Taylor polynomial centered at x =0 approximating f (x)= ex is
p3(x)=1+ x + x2
2!+ x3
3!.
Write a python script that creates the plot with the following features:
(a) Create a python script that assigns x to the 1D array containing 100 evenly spaced
points between 2 and 2. One option is to use:
x1= np.linspace(-2,2,100).(formerly x = np.linspace(-2,2,100))
(b) Create the 1D array y1=1+ x1+ x1**2/2+ x1**3/6 and the 1D array f1=
np.exp(x1). Use these 1D arrays and matplotlib.pyplt to create a plot of p3(x)=
1+ x + x2
2+ x3
6 and f (x)= ex. Make sure that your plot has a legend that labels
p3(x) and f (x) correctly, has the label x on the x axis, y on the y-axis, and
has the title Taylor Approximation 1(formerly Taylor Approximation).
(c) Repeat parts a and b using x2= np.linspace(-5,5,100), y2=1+ x2+ x2**2/2
+ x2**3/6 and f2= np.exp(x2). Additionally use the title Taylor Series 2 in
the plot.
(d) Using the print() function, describe the difference in the two plots from parts b
and c in 1 or 2 sentences.
3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!