What is the exponential integral Eₙ(x)?
The generalized exponential integral \(E_{n}(x)\) is a standard special function defined by the integral of e−x·t/tn over t from 1 to infinity. It appears throughout applied mathematics, physics (notably radiative transfer and neutron transport), and engineering. The parameter n is the integer order and x is the real argument. For n = 1 it reduces to the classic exponential integral via \(E_{1}(x) = -\operatorname{Ei}(-x)\).
How to use this calculator
Enter the order n as a non-negative integer (0, 1, 2, 3, …) and the argument x as a real number. Press calculate to get \(E_{n}(x)\) in double precision (about 15 significant digits). The function is real-valued only when x is at least 0. For n = 0 or n = 1 the argument must be strictly positive, because both diverge as x approaches 0; for n at least 2 the value at x = 0 is finite and equals \(\frac{1}{n-1}\).
The formula and algorithm
The defining integral is $$E_{n}(x) = \int_{1}^{\infty} \frac{e^{-x\,t}}{t^{\,n}}\,dt.$$ This implementation follows the numerically stable "expint" routine: for x > 1 it uses a Lentz continued fraction, and for 0 < x ≤ 1 it uses a convergent power series involving the Euler–Mascheroni constant \(\gamma \approx 0.5772156649\). Special cases are handled directly: \(E_{0}(x) = \frac{e^{-x}}{x}\) and \(E_{n}(0) = \frac{1}{n-1}\) for \(n \geq 2\).
Worked example
Take the defaults n = 2 and x = 1. Because x ≤ 1, the power series is used with nm1 = 1. The series begins at 1 and the successive terms (−0.4227843, −0.5, +0.0833333, −0.0138889, …) accumulate to \(E_{2}(1) \approx 0.1484955\). As a sanity check, \(E_{2}(0) = \frac{1}{2-1} = 1\), and \(E_{1}(1) \approx 0.2193839\).
Reference values of Eₙ(x)
Values of \(E_n(x)=\int_1^\infty e^{-xt}t^{-n}\,dt\) for real \(x>0\), rounded to about 7 significant digits. For n = 0 the integral reduces to the closed form \(E_0(x)=e^{-x}/x\).
| x | E₀(x) | E₁(x) | E₂(x) | E₃(x) |
|---|---|---|---|---|
| 0 | diverges | diverges | 1 | 0.5 |
| 0.1 | 9.048374 | 1.822924 | 0.7225450 | 0.4162915 |
| 0.5 | 1.213061 | 0.5597736 | 0.3266439 | 0.2216044 |
| 1 | 0.3678794 | 0.2193839 | 0.1484955 | 0.1096920 |
| 2 | 0.06766764 | 0.04890051 | 0.03753426 | 0.03013338 |
| 5 | 0.001347589 | 0.001148296 | 0.0009964690 | 0.0008778009 |
Notes on the x = 0 row: E₀(0) and E₁(0) diverge (E₁ grows like \(-\ln x\) as \(x\to 0^+\), E₀ like \(1/x\)). For every integer \(n\ge 2\), \(E_n(0)=\dfrac{1}{n-1}\), giving E₂(0) = 1 and E₃(0) = 1/2.
Key identities and constants
- Euler–Mascheroni constant: \(\gamma \approx 0.5772156649015329\). It appears in the small-argument expansion \(E_1(x)=-\gamma-\ln x+x-\dfrac{x^2}{4}+\cdots\) for \(x>0\).
- Recurrence: $$n\,E_{n+1}(x)=e^{-x}-x\,E_n(x),\qquad n\ge 1.$$ Starting from E₁(x), this generates all higher orders (it is how the E₂ and E₃ columns above are related to E₁). It is numerically stable for upward recursion when x is not large; for large n and small x, other methods may be preferable.
- Derivative: $$E_n'(x)=-E_{n-1}(x).$$ For example, \(E_1'(x)=-E_0(x)=-e^{-x}/x\).
- Relation to the exponential integral Ei: for \(x>0\), \(E_1(x)=-\mathrm{Ei}(-x)\), where Ei is the principal-value exponential integral.
- Large-x asymptotics: $$E_n(x)\sim \frac{e^{-x}}{x}\left(1-\frac{n}{x}+\frac{n(n+1)}{x^2}-\cdots\right),$$ so to leading order \(E_n(x)\approx e^{-x}/x\) for every fixed n. This is an asymptotic (divergent) series, so use only a few terms.
FAQ
Why does it return an error for negative x? The function is not real-valued for x < 0, so the calculator flags it as undefined.
What happens at x = 0? For \(n \geq 2\) the result is \(\frac{1}{n-1}\); for n = 0 or n = 1 the function diverges, so x must be positive.
How accurate is the result? Double-precision arithmetic gives roughly 15 significant digits, more than enough for typical scientific and engineering work.