# Ei(x) is exponential integral; # Ei(x)= - integrate(exp(-t)/t,t from -x to inf); # Ei(n,x)=(d/dx)^n Ei(x) is the nth derivative of exponential integral Ei(x); Ei(n_,0):= 1/(n-1); Ei(0,x_):= exp(-x)/x; Ei(1,x_) := -Ei(-x); #Ei(0.5,x_) := sqrt(pi)*erfc(sqrt(x))/sqrt(x); #Ei(-0.5,x_) := sqrt(pi)*erf(sqrt(x))*x^(-1.5); Ei(n_,inf) := 0; Ei(n_,-inf) := -inf; Ei(log(x_)):=li(x); Ei(0) := -inf; Ei(-inf) := 0; Ei(inf) := inf;