scipy.special.expi(x, out=None) = <ufunc 'expi'>#

Exponential integral Ei.

For real \(x\), the exponential integral is defined as [1]

\[Ei(x) = \int_{-\infty}^x \frac{e^t}{t} dt.\]

For \(x > 0\) the integral is understood as a Cauchy principal value.

It is extended to the complex plane by analytic continuation of the function on the interval \((0, \infty)\). The complex variant has a branch cut on the negative real axis.


Real or complex valued argument

outndarray, optional

Optional output array for the function results

scalar or ndarray

Values of the exponential integral

See also


Exponential integral \(E_1\)


Generalized exponential integral \(E_n\)


The exponential integrals \(E_1\) and \(Ei\) satisfy the relation

\[E_1(x) = -Ei(-x)\]

for \(x > 0\).



Digital Library of Mathematical Functions, 6.2.5


>>> import numpy as np
>>> import scipy.special as sc

It is related to exp1.

>>> x = np.array([1, 2, 3, 4])
>>> -sc.expi(-x)
array([0.21938393, 0.04890051, 0.01304838, 0.00377935])
>>> sc.exp1(x)
array([0.21938393, 0.04890051, 0.01304838, 0.00377935])

The complex variant has a branch cut on the negative real axis.

>>> sc.expi(-1 + 1e-12j)
>>> sc.expi(-1 - 1e-12j)

As the complex variant approaches the branch cut, the real parts approach the value of the real variant.

>>> sc.expi(-1)

The SciPy implementation returns the real variant for complex values on the branch cut.

>>> sc.expi(complex(-1, 0.0))
>>> sc.expi(complex(-1, -0.0))