format compact format short % The first plot p = [256 0 -576 0 432 0 -120 0 9 -.1] x = linspace(0,2*pi/3); f = cos(9*x); f1 = polyval(p,cos(x)); figure(1); subplot (1,2,1); plot(x,f,x,f1) axis equal % The first limit! format rat x1 = 0.25.^[0:8] y = (tan(4*x1)-sin(4*x1))./x1.^3; [x1;y]' % Clearly, the limit is 32. % The second limit! format short y1 = (1+9*x1).^(1./x1); y2 = (1+x1).^(9./x1); [x1; log(y1); log(y2)]' % The limit is e^9 % Another plot! f3 = cos(4*x); x3 = pi/12; y3 = cos(4*x3); m = -4*sin(4*x3); tangentline = m*(x-x3)+y3; subplot(1,2,2); plot(x,f3,x,tangentline,'k',x3,y3,'o'); axis ([0 pi/2 -1 1])