Main Content

La traducción de esta página aún no se ha actualizado a la versión más reciente. Haga clic aquí para ver la última versión en inglés.

Comparación gráfica de funciones exponenciales

Este ejemplo muestra un enfoque gráfico interesante para descubrir si eπ es mayor que πe.

La pregunta es: ¿cuál es mayor, eπ o πe? Una forma fácil de averiguarlo es escribirlo directamente en la línea de comandos de MATLAB®. Sin embargo, otra manera de analizar la situación es hacer una pregunta más general: ¿qué forma tiene la función z(x,y)=xy-yx?

A continuación, se muestra una gráfica de z.

% Define the mesh
x = 0:0.16:5;
y = 0:0.16:5;
[xx,yy] = meshgrid(x,y);

% The plot
zz = xx.^yy-yy.^xx;
h = surf(x,y,zz);
h.EdgeColor = [0.7 0.7 0.7];
view(20,50);
colormap(hsv);
title('$z = x^y-y^x$','Interpreter','latex')
xlabel('x')
ylabel('y')
hold on

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains an object of type surface.

La solución de la ecuación xy-yx=0 presenta una forma muy interesante y nuestra pregunta original no se resuelve fácilmente mediante observación. A continuación, se muestra una gráfica de los valores xy, que ofrecen un resultado de z=0.

c = contourc(x,y,zz,[0 0]);
list1Len = c(2,1);
xContour = [c(1,2:1+list1Len) NaN c(1,3+list1Len:size(c,2))];
yContour = [c(2,2:1+list1Len) NaN c(2,3+list1Len:size(c,2))];
% Note that the NAN above prevents the end of the first contour line from being
% connected to the beginning of the second line
line(xContour,yContour,'Color','k');

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains 2 objects of type surface, line.

Algunas combinaciones de x e y a lo largo de la curva de color negro son números enteros. La siguiente gráfica muestra las soluciones en números enteros a la ecuación xy-yx=0. Observe que 24=42 es la única solución en números enteros en la que xy.

plot([0:5 2 4],[0:5 4 2],'r.','MarkerSize',25);

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains 3 objects of type surface, line. One or more of the lines displays its values using only markers

Finalmente, represente los puntos (π,e) y (e,π) en la superficie. El resultado muestra que eπ es efectivamente mayor que πe (aunque no por mucho).

e = exp(1);
plot([e pi],[pi e],'r.','MarkerSize',25);
plot([e pi],[pi e],'y.','MarkerSize',10);
text(e,3.3,'(e,pi)','Color','k', ...
   'HorizontalAlignment','left','VerticalAlignment','bottom');
text(3.3,e,'(pi,e)','Color','k','HorizontalAlignment','left',...
   'VerticalAlignment','bottom');
hold off;

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains 7 objects of type surface, line, text. One or more of the lines displays its values using only markers

Compruebe los resultados.

e = exp(1);
e^pi
ans = 23.1407
pi^e
ans = 22.4592

Consulte también

|