function esempio(caso)

switch caso
    
    case 1
        h=0.001;
        x=-1:h:1;
        y=exp(x);
        
        y1=1+x;
        y2=1+x+(x.^2)/2;
        y3=1+x+(x.^2)/2+(x.^3)/6;
        
        clf;
        
        subplot(2,1,1)
        
        hold on;
        
        plot(x,y,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        
        plot(x,y1,'g-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        plot(x,y2,'r-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        plot(x,y3,'m-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        hold off;
        
        subplot(2,1,2)
        
        hold on;
        
        semilogy(x,abs(y-y1),'g-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        semilogy(x,abs(y-y2),'r-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        semilogy(x,abs(y-y3),'m-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        hold off;
        
        
        
        
    case 2
        h=0.001;
        x=-1:h:1;
        y=sin(x);
        
        y1=x;
        y2=x-(x.^3)/6;
        y3=x-(x.^3)/6+(x.^5)/180;
        
        clf;
        
        subplot(2,1,1)
        
        hold on;
        
        plot(x,y,'k-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        
        plot(x,y1,'g-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        plot(x,y2,'r-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        plot(x,y3,'m-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        hold off;
        
        subplot(2,1,2)
        
        hold on;
        
        semilogy(x,abs(y-y1),'g-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        semilogy(x,abs(y-y2),'r-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        semilogy(x,abs(y-y3),'m-','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',10);
        
        hold off;
        
end