Plot y = exp(x) in the interval [-3, 3] using a solid line. Now plot a linear ap
ID: 3789449 • Letter: P
Question
Plot y = exp(x) in the interval [-3, 3] using a solid line. Now plot a linear approximation of e^x (i.e. y = x) using a dashed line with a square marker in a different color and a quadratic approximation of e^x (i.e. y = 1 + x + x^2/2) using a dotted line and a circle marker in another color. Title the plot "Plots of Approximations of exp(x)." Label the y-axis as "Approximations of exp(x)" and the x-axis as "x". Use text to label the exp(x) curve at position (2, 8). Use gtext to label the linear and quadratic approximations of exp(x) appropriately. Set axes limits to [-3, 3, -5, 15]. Repeat the plots in a. but this time identify the plotted lines using legend instead of text and gtext.Explanation / Answer
%we take out differentiation to find out the linear approximation.
Y=X;
plot(X,Y,'--bs');
Y=1+X+0.5*x^2;
plot(X,Y,':mo');
---------
------------
2)