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\).
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.