
function esame2(numero)

clf;


switch numero
    case 1
        
        clf;
        
        
        x=linspace(-5,5,100);
        y=fA(x);
        plot(x,y,'-k','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);
        
        format short e
        % [x' y']
        
    case 2
        
        x=linspace(-1.5,1.5,100);
        [X,Y]=meshgrid(x);
        Z=2*(X.^2)+(Y.^2)-X;
        
        t=0:0.01:2*pi;
        XX=cos(t);
        YY=sin(t);
        
        ZZ=2*(XX.^2)+(YY.^2)-XX;
        
        hold on
        plot3(X,Y,Z)
        plot3(XX,YY,ZZ,'Ko','LineWidth',5,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','k',...
            'MarkerSize',5)
        hold off;
        
    case 3
        
        x=linspace(-1.5,1.5,100);
        [X,Y]=meshgrid(x);
        Z=(X.^2)+2*(Y.^2)-Y;
        
        t=0:0.01:2*pi;
        XX=cos(t);
        YY=sin(t);
        
        ZZ=(XX.^2)+2*(YY.^2)-YY;
        
        hold on
        plot3(X,Y,Z)
        plot3(XX,YY,ZZ,'Ko','LineWidth',5,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','k',...
            'MarkerSize',5)
        plot3(sqrt(3/4),1/2,1/4-1/2+1,'ro','LineWidth',5,...
            'MarkerEdgeColor','r',...
            'MarkerFaceColor','r',...
            'MarkerSize',10)
        plot3(-sqrt(3/4),1/2,1/4-1/2+1,'ro','LineWidth',5,...
            'MarkerEdgeColor','r',...
            'MarkerFaceColor','r',...
            'MarkerSize',10)
        plot3(0,-1,3,'go','LineWidth',5,...
            'MarkerEdgeColor','g',...
            'MarkerFaceColor','g',...
            'MarkerSize',10)
        hold off;
        
        [XX' YY' ZZ']
        [S,I]=min(ZZ');
        [XX(I) YY(I) ZZ(I)]
        
        [S,I]=max(ZZ');
        [XX(I) YY(I) ZZ(I)]
        
    case 4
        
        clf;
        
        
        x=linspace(-5,5,100);
        y=fA(x);
        plot(x,y,'-k','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);
        
        format short e
        % [x' y']
        
        
    case 5
        
        clf;
        
        a=0; b=1.3;
        x=linspace(a,b,100);
        y=fA(x);
        plot(x,y,'-k','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);
        
        format short e
        % [x' y']
        
        
    case 6
        
        clf;
        
        
        x=linspace(-5,5,100);
        y=fA(x);
        plot(x,y,'-k','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);
        
        format short e
        % [x' y']
        
        
    case 7
        
        clf;
        
        a=2/3; b=2.2;
        x=linspace(a,b,100);
        y=fA(x);
        plot(x,y,'-k','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);
        
        format short e
        % [x' y']
        
    case 8
        
        syms x
        simplify( diff(   (x+1)*exp(3*x) ,1) )
        
        simplify( diff(   (x+1)*exp(3*x) ,2) )
        
        
    case 9
        
        x=linspace(-1.5,1.5,100);
        [X,Y]=meshgrid(x);
        
        f=@(x,y) 2*(x.^2)-y.^2+x;
        
        Z=feval(f,X,Y);
        
        t=0:0.01:2*pi;
        XX=cos(t);
        YY=sin(t);
        
        ZZ=feval(f,XX,YY);
        
        hold on
        plot3(X,Y,Z)
        plot3(XX,YY,ZZ,'Ko','LineWidth',5,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','k',...
            'MarkerSize',5)
        
        x1=-1/6; x2=sqrt(1-x1^2); x3=feval(f,x1,x2);
        plot3(x1,x2,x3,'ro','LineWidth',5,...
            'MarkerEdgeColor','r',...
            'MarkerFaceColor','r',...
            'MarkerSize',10)
        
        x1=-1/6; x2=-sqrt(1-x1^2); x3=feval(f,x1,x2);
        plot3(x1,x2,x3,'ro','LineWidth',5,...
            'MarkerEdgeColor','r',...
            'MarkerFaceColor','r',...
            'MarkerSize',10)
        
        x1=1; x2=sqrt(1-x1^2); x3=feval(f,x1,x2);
        plot3(x1,x2,x3,'go','LineWidth',5,...
            'MarkerEdgeColor','g',...
            'MarkerFaceColor','g',...
            'MarkerSize',10)
        hold off;
        
        [XX' YY' ZZ']
        [S,I]=min(ZZ');
        [XX(I) YY(I) ZZ(I)]
        
        [S,I]=max(ZZ');
        [XX(I) YY(I) ZZ(I)]
        
            case 10
        
        clf;
        
        
        x=linspace(-5,5,100);
        y=fA(x);
        plot(x,y,'-k','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);
        
        format short e
        % [x' y']
        
    case 11
        
                clf;
        
        
        x=linspace(-2,-0.7,100);
        y=fA(x);
        plot(x,y,'-k','LineWidth',2,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','g',...
            'MarkerSize',1);
        
        format short e
        % [x' y']
        
        
        case 12
        
        x=linspace(-1.5,1.5,100);
        [X,Y]=meshgrid(x);
        
        f=@(x,y) 2*(y.^2)-x.^2+y;
        
        Z=feval(f,X,Y);
        
        t=0:0.01:2*pi;
        XX=cos(t);
        YY=sin(t);
        
        ZZ=feval(f,XX,YY);
        
        hold on
        plot3(X,Y,Z)
        plot3(XX,YY,ZZ,'Ko','LineWidth',5,...
            'MarkerEdgeColor','k',...
            'MarkerFaceColor','k',...
            'MarkerSize',5)
        
        x2=-1/6; x1=sqrt(1-x2^2); x3=feval(f,x1,x2);
        plot3(x1,x2,x3,'ro','LineWidth',5,...
            'MarkerEdgeColor','r',...
            'MarkerFaceColor','r',...
            'MarkerSize',10)
        
        x2=-1/6; x1=-sqrt(1-x2^2); x3=feval(f,x1,x2);
        plot3(x1,x2,x3,'ro','LineWidth',5,...
            'MarkerEdgeColor','r',...
            'MarkerFaceColor','r',...
            'MarkerSize',10)
        
        x2=1; x1=sqrt(1-x2^2); x3=feval(f,x1,x2);
        plot3(x1,x2,x3,'go','LineWidth',5,...
            'MarkerEdgeColor','g',...
            'MarkerFaceColor','g',...
            'MarkerSize',10)
        hold off;
        
        [XX' YY' ZZ']
        [S,I]=min(ZZ');
        [XX(I) YY(I) ZZ(I)]
        
        [S,I]=max(ZZ');
        [XX(I) YY(I) ZZ(I)]
        
end














function y=fA(x)

y=abs(x+2).*exp(3*x);
y=abs(x-1).*exp(2*x);
y=abs(x-2).*exp(3*x);
y=abs(x+1).*exp(3*x);



function y=f1A(x)

y=sign(x+2).*(3*x+7).*exp(3*x);
