# Ein(x) is the entire function;
# Ein(x)=sum( -(-1)^k*x^k/(k!*k),k from 1 to inf)
=integrate( (1-exp(-t))/t,t from 0 to x);


Ein(x_,0):=0;
Ein(x_,1):=0;
Ein(x_,inf):=Ein(x);

Ein(-x_):=log(x)+gamma-Ei(x);