% Written by Min-Hua Huang
% June 9, 2011
% Figure 6 of "Indefinite Integration of the Gamma Integral".
% Functional Plots of $x^{-n}\exp(-x)$.
clear; clc; format long;
record=ones(501,5); 
record(:,1)=0:0.01:5;
for s=-1:-2:-5
   kkk=1; 
   for i=0:0.01:5
     record(kkk,(-s+3)/2)=exp(-i)*i^s;
     kkk=kkk+1;
   end
end
s=-1000; kkk=1;
   for i=0:0.01:5
     record(kkk,5)=exp(-1)*i^s;
     kkk=kkk+1;
   end
x=record(:,1);
y1=record(:,2);
y2=record(:,3);
y3=record(:,4);
y4=record(:,5);
plot(x,y1,'-k','LineWidth',2)
hold on
plot(x,y2,'-k+','MarkerSize',2)
plot(x,y3,'-ko','MarkerSize',2)
plot(x,y4,'--k','LineWidth',2)
hold off
axis([0, 5, 0, 50]);
box off;
xlabel('x');
ylabel('integrand values')
legend('x^{-1}exp(-x)','x^{-3}exp(-x)','x^{-5}exp(-x)','x^{-\infty}exp(-x)');