Exponential Integral difference between Maple and Matlab

572 Views Asked by At

I try to calculate this exponential integral:

$$\int_0^1 \exp(\exp(-s))ds.$$

I obtained different results in Maple:

Maple

and Matlab:

Matlab

Which is correct?

2

There are 2 best solutions below

3
On

The two apparently different answers are in fact the same.

This is the consequence of the different notations used, with the relationship : $$ei(x)=-Ei(1,-x)$$ The typography in softwares are not exactly standard, respectively : $ei(x)\equiv Ei(x)$ and $Ei(1,x)\equiv E_1(x)$ with reference to: https://en.wikipedia.org/wiki/Exponential_integral and http://mathworld.wolfram.com/ExponentialIntegral.html , equation (3).

1
On
H := int(exp(exp(-s)),s=0..1);

                   H := -Ei(1, -1) + Ei(1, -exp(-1))

evalf(H);

                          1.913220322 + 0. I

simplify(%);

                              1.913220322

evalc(H);

                          Ei(1) - Ei(exp(-1))

evalf(%);

                              1.913220322